|
@@ -99,6 +99,7 @@ public class GUI implements CategoryListener {
|
|
private final JLabel medGraph = new JLabel("50%");
|
|
private final JLabel medGraph = new JLabel("50%");
|
|
private final JLabel minGraph = new JLabel("0%");
|
|
private final JLabel minGraph = new JLabel("0%");
|
|
private final JLabel elementGraph = new JLabel("None ");
|
|
private final JLabel elementGraph = new JLabel("None ");
|
|
|
|
+ private final JLabel unitGraphLocalPeriodLbl = new JLabel("Local Period:");
|
|
private final ArrayList<HolonElement> selectedElements = new ArrayList<>();
|
|
private final ArrayList<HolonElement> selectedElements = new ArrayList<>();
|
|
private final JTree tree = new JTree();
|
|
private final JTree tree = new JTree();
|
|
/******************************************
|
|
/******************************************
|
|
@@ -179,6 +180,8 @@ public class GUI implements CategoryListener {
|
|
private final MyCanvas canvas;
|
|
private final MyCanvas canvas;
|
|
private final HolonCanvas holonCanvas;
|
|
private final HolonCanvas holonCanvas;
|
|
private final UnitGraph unitGraph;
|
|
private final UnitGraph unitGraph;
|
|
|
|
+ /** Textfield to show the period of an element */
|
|
|
|
+ private final JTextField unitGraphLocalPeriod = new JTextField();
|
|
private final JSplitPane splitPane3 = new JSplitPane();
|
|
private final JSplitPane splitPane3 = new JSplitPane();
|
|
private final JSlider sizeSlider = new JSlider();
|
|
private final JSlider sizeSlider = new JSlider();
|
|
private final JLabel lblImageSize = new JLabel(Languages.getLanguage()[94]);
|
|
private final JLabel lblImageSize = new JLabel(Languages.getLanguage()[94]);
|
|
@@ -1056,14 +1059,33 @@ public class GUI implements CategoryListener {
|
|
|
|
|
|
toolBarGraph.add(lblSelectedElement);
|
|
toolBarGraph.add(lblSelectedElement);
|
|
toolBarGraph.add(elementGraph);
|
|
toolBarGraph.add(elementGraph);
|
|
|
|
+
|
|
|
|
+ Component horizontalStrut = Box.createHorizontalStrut(20);
|
|
|
|
+ /*
|
|
Component horizontalStrut = Box.createHorizontalStrut(toolBarGraph
|
|
Component horizontalStrut = Box.createHorizontalStrut(toolBarGraph
|
|
- .getWidth() - resetGraphBtn.getWidth());
|
|
|
|
|
|
+ .getWidth() - resetGraphBtn.getWidth() - unitGraphLocalPeriod.getWidth()
|
|
|
|
+ -unitGraphLocalPeriodLbl.getWidth());
|
|
|
|
|
|
|
|
+ */
|
|
toolBarGraph.add(horizontalStrut);
|
|
toolBarGraph.add(horizontalStrut);
|
|
|
|
+
|
|
|
|
+ /** Add local Graph length Textfield an Label */
|
|
|
|
+ unitGraphLocalPeriod.setPreferredSize(new Dimension(30, 12));
|
|
|
|
+ unitGraphLocalPeriod.setText(""+unitGraph.getLocalPeriod());
|
|
|
|
+ resetGraphBtn.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
|
+
|
|
|
|
+ toolBarGraph.add(unitGraphLocalPeriodLbl);
|
|
|
|
+
|
|
|
|
+ unitGraphLocalPeriodLbl.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
|
+ toolBarGraph.add(unitGraphLocalPeriod);
|
|
|
|
+
|
|
|
|
+
|
|
resetGraphBtn.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
resetGraphBtn.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
|
|
|
toolBarGraph.add(resetGraphBtn);
|
|
toolBarGraph.add(resetGraphBtn);
|
|
toolBarGraph.setFloatable(false);
|
|
toolBarGraph.setFloatable(false);
|
|
|
|
+
|
|
|
|
+
|
|
scrollGraph.setRowHeaderView(graphLabel);
|
|
scrollGraph.setRowHeaderView(graphLabel);
|
|
scrollGraph.setColumnHeaderView(toolBarGraph);
|
|
scrollGraph.setColumnHeaderView(toolBarGraph);
|
|
|
|
|
|
@@ -1521,6 +1543,27 @@ public class GUI implements CategoryListener {
|
|
*/
|
|
*/
|
|
resetGraphBtn.setBorder(new LineBorder(Color.BLACK));
|
|
resetGraphBtn.setBorder(new LineBorder(Color.BLACK));
|
|
resetGraphBtn.addActionListener(actionEvent -> unitGraph.reset());
|
|
resetGraphBtn.addActionListener(actionEvent -> unitGraph.reset());
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Update Local Period of an Element Graph
|
|
|
|
+ */
|
|
|
|
+ unitGraphLocalPeriod.addKeyListener(new KeyAdapter() {
|
|
|
|
+ @Override
|
|
|
|
+ public void keyReleased(KeyEvent e) {
|
|
|
|
+ try{
|
|
|
|
+ int localLength = Integer.parseInt(unitGraphLocalPeriod.getText());
|
|
|
|
+ unitGraphLocalPeriod.setBackground(Color.WHITE);
|
|
|
|
+ /**
|
|
|
|
+ * set local graph Period
|
|
|
|
+ */
|
|
|
|
+ unitGraph.setLocalPeriod(localLength);
|
|
|
|
+ }catch(Exception ex){
|
|
|
|
+ unitGraphLocalPeriod.setBackground(Color.RED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
/*****************************
|
|
/*****************************
|
|
* RIGHT CONTAINER DONE
|
|
* RIGHT CONTAINER DONE
|
|
*****************************/
|
|
*****************************/
|