|
@@ -98,7 +98,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
private JFrame frmCyberPhysical;
|
|
private JFrame frmCyberPhysical;
|
|
|
|
|
|
- private final AlgorithmMenu simMenu;
|
|
+ private final AlgorithmMenu algorithmMenu;
|
|
|
|
|
|
private JTabbedPane tabTemp;
|
|
private JTabbedPane tabTemp;
|
|
private final JMenuBar menuBar = new JMenuBar();
|
|
private final JMenuBar menuBar = new JMenuBar();
|
|
@@ -299,7 +299,7 @@ public class GUI<E> implements CategoryListener {
|
|
control.initListener(this);
|
|
control.initListener(this);
|
|
controller.setCanvas(canvas);
|
|
controller.setCanvas(canvas);
|
|
model.setConsole(console);
|
|
model.setConsole(console);
|
|
- simMenu = new AlgorithmMenu(model, control);
|
|
+ algorithmMenu = new AlgorithmMenu(model, control);
|
|
initialize();
|
|
initialize();
|
|
updateCategories(model.getCategories());
|
|
updateCategories(model.getCategories());
|
|
updCon = new UpdateController(model, controller);
|
|
updCon = new UpdateController(model, controller);
|
|
@@ -416,7 +416,7 @@ public class GUI<E> implements CategoryListener {
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
if (tabbedPane.getMousePosition() != null) {
|
|
if (tabbedPane.getMousePosition() != null) {
|
|
tabTemp = tabbedPane;
|
|
tabTemp = tabbedPane;
|
|
- } else {
|
|
+ } else if (tabbedPane2.getMousePosition() != null) {
|
|
tabTemp = tabbedPane2;
|
|
tabTemp = tabbedPane2;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -744,50 +744,50 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
mnNewMenuView.add(mntmCanvasSize);
|
|
mnNewMenuView.add(mntmCanvasSize);
|
|
mnNewMenuView.add(mntmSplitView);
|
|
mnNewMenuView.add(mntmSplitView);
|
|
-
|
|
+
|
|
|
|
|
|
- mntmSplitView.addActionListener(new ActionListener() {
|
|
+ mntmSplitView.addActionListener(new ActionListener() {
|
|
- @Override
|
|
+ @Override
|
|
- public void actionPerformed(ActionEvent e) {
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
- if (splitPaneCanvasConsole.getLeftComponent() instanceof JSplitPane) {
|
|
+ if (splitPaneCanvasConsole.getLeftComponent() instanceof JSplitPane) {
|
|
- initSplit = true;
|
|
+ initSplit = true;
|
|
- Component tempC = tabbedPane2.getSelectedComponent();
|
|
+ Component tempC = tabbedPane2.getSelectedComponent();
|
|
- tabbedPane.setComponentAt(tabbedPane2.getSelectedIndex(), tempC);
|
|
+ tabbedPane.setComponentAt(tabbedPane2.getSelectedIndex(), tempC);
|
|
- tabbedPane2.removeAll();
|
|
+ tabbedPane2.removeAll();
|
|
- splitPaneCanvasConsole.setLeftComponent(tabbedPane);
|
|
+ splitPaneCanvasConsole.setLeftComponent(tabbedPane);
|
|
- } else {
|
|
+ } else {
|
|
- for (int i = 0; i < tabbedPane.getTabCount(); i++) {
|
|
+ for (int i = 0; i < tabbedPane.getTabCount(); i++) {
|
|
- tabbedPane2.addTab(tabbedPane.getTitleAt(i), null);
|
|
+ tabbedPane2.addTab(tabbedPane.getTitleAt(i), null);
|
|
- if (i >= 4) {
|
|
+ if (i >= 4) {
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (tabbedPane.getSelectedComponent() == statScrollPane) {
|
|
|
|
- tabbedPane.setComponentAt(0, null);
|
|
|
|
- tabbedPane2.setComponentAt(0, canvasSP);
|
|
|
|
- tabbedPane2.setSelectedIndex(0);
|
|
|
|
- } else {
|
|
|
|
- tabbedPane.setComponentAt(1, null);
|
|
|
|
- tabbedPane2.setComponentAt(1, statScrollPane);
|
|
|
|
- tabbedPane2.setSelectedIndex(1);
|
|
|
|
- }
|
|
|
|
- tempSplit = new JSplitPane();
|
|
|
|
- tempSplit.setBorder(null);
|
|
|
|
- tempSplit.setRightComponent(tabbedPane2);
|
|
|
|
- tempSplit.setLeftComponent(tabbedPane);
|
|
|
|
- tempSplit.setDividerLocation(tabbedPane.getWidth() / 2);
|
|
|
|
- tempSplit.setResizeWeight(0.9);
|
|
|
|
- splitPaneCanvasConsole.setLeftComponent(tempSplit);
|
|
|
|
- initSplit = false;
|
|
|
|
}
|
|
}
|
|
- contentPane.updateUI();
|
|
|
|
}
|
|
}
|
|
|
|
+ if (tabbedPane.getSelectedComponent() == statScrollPane) {
|
|
|
|
+ tabbedPane.setComponentAt(0, null);
|
|
|
|
+ tabbedPane2.setComponentAt(0, canvasSP);
|
|
|
|
+ tabbedPane2.setSelectedIndex(0);
|
|
|
|
+ } else {
|
|
|
|
+ tabbedPane.setComponentAt(1, null);
|
|
|
|
+ tabbedPane2.setComponentAt(1, statScrollPane);
|
|
|
|
+ tabbedPane2.setSelectedIndex(1);
|
|
|
|
+ }
|
|
|
|
+ tempSplit = new JSplitPane();
|
|
|
|
+ tempSplit.setBorder(null);
|
|
|
|
+ tempSplit.setRightComponent(tabbedPane2);
|
|
|
|
+ tempSplit.setLeftComponent(tabbedPane);
|
|
|
|
+ tempSplit.setDividerLocation(tabbedPane.getWidth() / 2);
|
|
|
|
+ tempSplit.setResizeWeight(0.9);
|
|
|
|
+ splitPaneCanvasConsole.setLeftComponent(tempSplit);
|
|
|
|
+ initSplit = false;
|
|
|
|
+ }
|
|
|
|
+ contentPane.updateUI();
|
|
|
|
+ }
|
|
|
|
|
|
- });
|
|
+ });
|
|
mnNewMenuView.add(mntmBackground);
|
|
mnNewMenuView.add(mntmBackground);
|
|
-
|
|
+
|
|
mntmBackground.addActionListener(new ActionListener() {
|
|
mntmBackground.addActionListener(new ActionListener() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -832,7 +832,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
splitPane_1.setLeftComponent(lblHolonBodySize);
|
|
splitPane_1.setLeftComponent(lblHolonBodySize);
|
|
|
|
|
|
- mnAlgorithm.add(simMenu);
|
|
+ menuBar.add(algorithmMenu);
|
|
|
|
|
|
menuBar.add(mnAlgorithm);
|
|
menuBar.add(mnAlgorithm);
|
|
|
|
|
|
@@ -840,8 +840,6 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
mnHelp.add(mntmAboutUs);
|
|
mnHelp.add(mntmAboutUs);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
tabbedPane.addChangeListener(new ChangeListener() {
|
|
tabbedPane.addChangeListener(new ChangeListener() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1918,7 +1916,7 @@ public class GUI<E> implements CategoryListener {
|
|
splitGraphHolonEl.setBottomComponent(scrollElements);
|
|
splitGraphHolonEl.setBottomComponent(scrollElements);
|
|
canvasSP.setViewportView(canvas);
|
|
canvasSP.setViewportView(canvas);
|
|
|
|
|
|
- simMenu.setBackground(new Color(240, 240, 240));
|
|
+ algorithmMenu.setBackground(new Color(240, 240, 240));
|
|
|
|
|
|
tabbedPane.setBorder(null);
|
|
tabbedPane.setBorder(null);
|
|
scrollProperties.setBorder(null);
|
|
scrollProperties.setBorder(null);
|
|
@@ -2150,7 +2148,7 @@ public class GUI<E> implements CategoryListener {
|
|
eraseCategory = tempArray[29];
|
|
eraseCategory = tempArray[29];
|
|
selectObjBeforeErase = tempArray[30];
|
|
selectObjBeforeErase = tempArray[30];
|
|
|
|
|
|
- simMenu.algoFolderButton.setText(Languages.getLanguage()[85]);
|
|
+ algorithmMenu.algoFolderButton.setText(Languages.getLanguage()[85]);
|
|
|
|
|
|
timePanel.playBtn.setToolTipText(Languages.getLanguage()[89]);
|
|
timePanel.playBtn.setToolTipText(Languages.getLanguage()[89]);
|
|
timePanel.timeResetBtn.setToolTipText(Languages.getLanguage()[90]);
|
|
timePanel.timeResetBtn.setToolTipText(Languages.getLanguage()[90]);
|