|
@@ -109,6 +109,7 @@ public class GUI<E> implements CategoryListener {
|
|
private JPopupMenu popmenuEdit = new JPopupMenu();
|
|
private JPopupMenu popmenuEdit = new JPopupMenu();
|
|
private JMenuItem editItem = new JMenuItem("Edit Object");
|
|
private JMenuItem editItem = new JMenuItem("Edit Object");
|
|
private String catOfObjToBeEdited;
|
|
private String catOfObjToBeEdited;
|
|
|
|
+ private final JScrollPane statTab = new JScrollPane();
|
|
|
|
|
|
private final JLabel maxGraph = new JLabel("100%");
|
|
private final JLabel maxGraph = new JLabel("100%");
|
|
private final JLabel medGraph = new JLabel("50%");
|
|
private final JLabel medGraph = new JLabel("50%");
|
|
@@ -217,6 +218,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
private Console console = new Console();
|
|
private Console console = new Console();
|
|
private MyCanvas canvas;
|
|
private MyCanvas canvas;
|
|
|
|
+ private StatisticsTab stats;
|
|
private UnitGraph unitGraph;
|
|
private UnitGraph unitGraph;
|
|
private final JSplitPane splitPane3 = new JSplitPane();
|
|
private final JSplitPane splitPane3 = new JSplitPane();
|
|
private final JSlider sizeSlider = new JSlider();
|
|
private final JSlider sizeSlider = new JSlider();
|
|
@@ -260,6 +262,7 @@ public class GUI<E> implements CategoryListener {
|
|
this.controller = control;
|
|
this.controller = control;
|
|
this.model = control.getModel();
|
|
this.model = control.getModel();
|
|
this.canvas = new MyCanvas(model, control);
|
|
this.canvas = new MyCanvas(model, control);
|
|
|
|
+ this.stats = new StatisticsTab(model, control);
|
|
this.unitGraph = new UnitGraph(model, control);
|
|
this.unitGraph = new UnitGraph(model, control);
|
|
control.initListener(this);
|
|
control.initListener(this);
|
|
controller.setCanvas(canvas);
|
|
controller.setCanvas(canvas);
|
|
@@ -489,7 +492,7 @@ public class GUI<E> implements CategoryListener {
|
|
// mnLanguage.add(czechBtn);
|
|
// mnLanguage.add(czechBtn);
|
|
// czechBtn.setIcon(new ImageIcon(new
|
|
// czechBtn.setIcon(new ImageIcon(new
|
|
// ImageIcon("res/Button_Images/FlagCZ.png").getImage().getScaledInstance(20,
|
|
// ImageIcon("res/Button_Images/FlagCZ.png").getImage().getScaledInstance(20,
|
|
- // 20, java.awt.Image.SCALE_SMOOTH)));
|
|
|
|
|
|
+ // 20, java.awt.Image.SCALE_SMOOTH)));
|
|
mnLanguage.add(chineseBtn);
|
|
mnLanguage.add(chineseBtn);
|
|
chineseBtn.setIcon(new ImageIcon(new ImageIcon("res/Button_Images/FlagZH.png").getImage().getScaledInstance(20,
|
|
chineseBtn.setIcon(new ImageIcon(new ImageIcon("res/Button_Images/FlagZH.png").getImage().getScaledInstance(20,
|
|
20, java.awt.Image.SCALE_SMOOTH)));
|
|
20, java.awt.Image.SCALE_SMOOTH)));
|
|
@@ -592,6 +595,8 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
canvas.setBackground(Color.WHITE);
|
|
canvas.setBackground(Color.WHITE);
|
|
canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
|
|
canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
|
|
|
|
+ stats.setBackground(Color.WHITE);
|
|
|
|
+ stats.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
|
|
|
|
|
|
/********************
|
|
/********************
|
|
* RIGHT CONTAINER (INFORMATION)
|
|
* RIGHT CONTAINER (INFORMATION)
|
|
@@ -1002,10 +1007,12 @@ public class GUI<E> implements CategoryListener {
|
|
if (tempCps.getClass() == HolonTransformer.class) {
|
|
if (tempCps.getClass() == HolonTransformer.class) {
|
|
h = new HolonTransformer(tempCps);
|
|
h = new HolonTransformer(tempCps);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
h.setPosition(x, y);
|
|
h.setPosition(x, y);
|
|
controller.addObjectCanvas(h);
|
|
controller.addObjectCanvas(h);
|
|
|
|
+ canvas.invalidate();
|
|
canvas.repaint();
|
|
canvas.repaint();
|
|
|
|
+
|
|
dragging = false;
|
|
dragging = false;
|
|
}
|
|
}
|
|
} catch (Exception eex) {
|
|
} catch (Exception eex) {
|
|
@@ -1574,8 +1581,8 @@ public class GUI<E> implements CategoryListener {
|
|
splitPane.setLeftComponent(scrollPane1);
|
|
splitPane.setLeftComponent(scrollPane1);
|
|
splitPaneCanvasConsole.setLeftComponent(panelTapped_SimMenu);
|
|
splitPaneCanvasConsole.setLeftComponent(panelTapped_SimMenu);
|
|
tabbedPane.addTab("View", canvasSP);
|
|
tabbedPane.addTab("View", canvasSP);
|
|
- tabbedPane.addTab("test", new JPanel());
|
|
|
|
- //splitPaneCanvasConsole.setLeftComponent(canvasSP);
|
|
|
|
|
|
+ tabbedPane.addTab("Statistics", statTab);
|
|
|
|
+ // splitPaneCanvasConsole.setLeftComponent(canvasSP);
|
|
splitPaneCanvasConsole.setRightComponent(console);
|
|
splitPaneCanvasConsole.setRightComponent(console);
|
|
splitPane1.setLeftComponent(splitPaneCanvasConsole);
|
|
splitPane1.setLeftComponent(splitPaneCanvasConsole);
|
|
splitPane1.setRightComponent(splitHolonElPro);
|
|
splitPane1.setRightComponent(splitHolonElPro);
|
|
@@ -1589,6 +1596,7 @@ public class GUI<E> implements CategoryListener {
|
|
splitGraphHolonEl.setTopComponent(scrollGraph);
|
|
splitGraphHolonEl.setTopComponent(scrollGraph);
|
|
splitGraphHolonEl.setBottomComponent(scrollElements);
|
|
splitGraphHolonEl.setBottomComponent(scrollElements);
|
|
canvasSP.setViewportView(canvas);
|
|
canvasSP.setViewportView(canvas);
|
|
|
|
+ statTab.setViewportView(stats);
|
|
panelTapped_SimMenu.setLayout(new BorderLayout());
|
|
panelTapped_SimMenu.setLayout(new BorderLayout());
|
|
panelTapped_SimMenu.add(simMenu, BorderLayout.NORTH);
|
|
panelTapped_SimMenu.add(simMenu, BorderLayout.NORTH);
|
|
panelTapped_SimMenu.add(tabbedPane);
|
|
panelTapped_SimMenu.add(tabbedPane);
|