|
@@ -100,7 +100,7 @@ public class GUI<E> implements CategoryListener {
|
|
private final JMenuItem canvasSize = new JMenuItem("View Size");
|
|
private final JMenuItem canvasSize = new JMenuItem("View Size");
|
|
private final JSplitPane splitPane = new JSplitPane();
|
|
private final JSplitPane splitPane = new JSplitPane();
|
|
private final JSplitPane splitPane1 = new JSplitPane();
|
|
private final JSplitPane splitPane1 = new JSplitPane();
|
|
- private final JSplitPane splitPaneTreeConsole = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
|
|
|
|
|
|
+ private final JSplitPane splitPaneCanvasConsole = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
|
|
|
|
|
|
private final JScrollPane canvasSP = new JScrollPane();
|
|
private final JScrollPane canvasSP = new JScrollPane();
|
|
private final JScrollPane scrollPane1 = new JScrollPane();
|
|
private final JScrollPane scrollPane1 = new JScrollPane();
|
|
@@ -303,7 +303,6 @@ public class GUI<E> implements CategoryListener {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
unitGraph.empty();
|
|
unitGraph.empty();
|
|
- controller.addTextToConsole("undo", Color.BLACK, 12, false, false, true);
|
|
|
|
} catch (IOException eex) {
|
|
} catch (IOException eex) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
eex.printStackTrace();
|
|
eex.printStackTrace();
|
|
@@ -337,7 +336,6 @@ public class GUI<E> implements CategoryListener {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
unitGraph.empty();
|
|
unitGraph.empty();
|
|
- controller.addTextToConsole("redo", Color.BLACK, 12, false, false, true);
|
|
|
|
} catch (IOException ex) {
|
|
} catch (IOException ex) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
@@ -525,8 +523,9 @@ public class GUI<E> implements CategoryListener {
|
|
myPanel.add(field1);
|
|
myPanel.add(field1);
|
|
myPanel.add(field2);
|
|
myPanel.add(field2);
|
|
JOptionPane.showMessageDialog(null, myPanel);
|
|
JOptionPane.showMessageDialog(null, myPanel);
|
|
- canvas.setPreferredSize(
|
|
|
|
- new Dimension(Integer.parseInt(field1.getText()), Integer.parseInt(field2.getText())));
|
|
|
|
|
|
+ controller.setCanvasX(Integer.parseInt(field1.getText()));
|
|
|
|
+ controller.setCanvasY(Integer.parseInt(field2.getText()));
|
|
|
|
+ canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
|
|
canvas.repaint();
|
|
canvas.repaint();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -552,7 +551,7 @@ public class GUI<E> implements CategoryListener {
|
|
mnHelp.add(aboutUs);
|
|
mnHelp.add(aboutUs);
|
|
|
|
|
|
canvas.setBackground(Color.WHITE);
|
|
canvas.setBackground(Color.WHITE);
|
|
- canvas.setPreferredSize(new Dimension(1000, 1000));
|
|
|
|
|
|
+ canvas.setPreferredSize(new Dimension(model.getCanvasX(), model.getCanvasY()));
|
|
|
|
|
|
/********************
|
|
/********************
|
|
* RIGHT CONTAINER (INFORMATION)
|
|
* RIGHT CONTAINER (INFORMATION)
|
|
@@ -909,7 +908,7 @@ public class GUI<E> implements CategoryListener {
|
|
@Override
|
|
@Override
|
|
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
|
|
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
|
|
boolean leaf, int row, boolean hasFocus) {
|
|
boolean leaf, int row, boolean hasFocus) {
|
|
- JLabel label = new JLabel();
|
|
|
|
|
|
+ JLabel label = new JLabel();
|
|
Image imgR = null;
|
|
Image imgR = null;
|
|
if (leaf) {
|
|
if (leaf) {
|
|
for (Category cat : model.getCategories()) {
|
|
for (Category cat : model.getCategories()) {
|
|
@@ -1477,12 +1476,12 @@ public class GUI<E> implements CategoryListener {
|
|
splitPane.setRightComponent(splitPane1);
|
|
splitPane.setRightComponent(splitPane1);
|
|
splitPane.setDividerLocation(200);
|
|
splitPane.setDividerLocation(200);
|
|
splitPane1.setDividerLocation(500);
|
|
splitPane1.setDividerLocation(500);
|
|
- splitPaneTreeConsole.setDividerLocation(500);
|
|
|
|
|
|
+ splitPaneCanvasConsole.setDividerLocation(500);
|
|
|
|
|
|
- splitPane.setLeftComponent(splitPaneTreeConsole);
|
|
|
|
- splitPaneTreeConsole.setLeftComponent(scrollPane1);
|
|
|
|
- splitPaneTreeConsole.setRightComponent(console);
|
|
|
|
- splitPane1.setLeftComponent(canvasSP);
|
|
|
|
|
|
+ splitPane.setLeftComponent(scrollPane1);
|
|
|
|
+ splitPaneCanvasConsole.setLeftComponent(canvasSP);
|
|
|
|
+ splitPaneCanvasConsole.setRightComponent(console);
|
|
|
|
+ splitPane1.setLeftComponent(splitPaneCanvasConsole);
|
|
splitPane1.setRightComponent(splitHolonElPro);
|
|
splitPane1.setRightComponent(splitHolonElPro);
|
|
|
|
|
|
splitHolonElPro.setDividerLocation(400);
|
|
splitHolonElPro.setDividerLocation(400);
|
|
@@ -1501,7 +1500,7 @@ public class GUI<E> implements CategoryListener {
|
|
scrollElements.setBorder(null);
|
|
scrollElements.setBorder(null);
|
|
splitPane.setBorder(null);
|
|
splitPane.setBorder(null);
|
|
splitPane1.setBorder(null);
|
|
splitPane1.setBorder(null);
|
|
- splitPaneTreeConsole.setBorder(null);
|
|
|
|
|
|
+ splitPaneCanvasConsole.setBorder(null);
|
|
splitHolonElPro.setBorder(null);
|
|
splitHolonElPro.setBorder(null);
|
|
splitGraphHolonEl.setBorder(null);
|
|
splitGraphHolonEl.setBorder(null);
|
|
panelHolonEl.setBorder(null);
|
|
panelHolonEl.setBorder(null);
|
|
@@ -1509,16 +1508,17 @@ public class GUI<E> implements CategoryListener {
|
|
tableHolonElementScrollPane.setBorder(null);
|
|
tableHolonElementScrollPane.setBorder(null);
|
|
|
|
|
|
frmCyberPhysical.getContentPane().add(timePanel, BorderLayout.SOUTH);
|
|
frmCyberPhysical.getContentPane().add(timePanel, BorderLayout.SOUTH);
|
|
-
|
|
|
|
|
|
+
|
|
String autoPath = System.getProperty("user.home") + "/HolonGUI/Autosave/";
|
|
String autoPath = System.getProperty("user.home") + "/HolonGUI/Autosave/";
|
|
File dest = new File(autoPath);
|
|
File dest = new File(autoPath);
|
|
- if(dest.listFiles().length>1){
|
|
|
|
|
|
+ if (dest.listFiles().length > 1) {
|
|
int dialogButton = JOptionPane.YES_NO_OPTION;
|
|
int dialogButton = JOptionPane.YES_NO_OPTION;
|
|
- int dialogResult = JOptionPane.showConfirmDialog (null, "Old autosave file was found, should it be loaded?", "Warning",dialogButton);
|
|
|
|
- if(dialogResult == JOptionPane.YES_OPTION){
|
|
|
|
- model.setAutoSaveNr(dest.listFiles().length-1);
|
|
|
|
|
|
+ int dialogResult = JOptionPane.showConfirmDialog(null, "Old autosave file was found, should it be loaded?",
|
|
|
|
+ "Warning", dialogButton);
|
|
|
|
+ if (dialogResult == JOptionPane.YES_OPTION) {
|
|
|
|
+ model.setAutoSaveNr(dest.listFiles().length - 1);
|
|
mntmRedo.doClick();
|
|
mntmRedo.doClick();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
controller.deleteDirectory(dest);
|
|
controller.deleteDirectory(dest);
|
|
dest.mkdirs();
|
|
dest.mkdirs();
|
|
try {
|
|
try {
|
|
@@ -1528,7 +1528,7 @@ public class GUI<E> implements CategoryListener {
|
|
e1.printStackTrace();
|
|
e1.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1788,8 +1788,10 @@ public class GUI<E> implements CategoryListener {
|
|
/**
|
|
/**
|
|
* Adds a Popup.
|
|
* Adds a Popup.
|
|
*
|
|
*
|
|
- * @param component Component
|
|
|
|
- * @param popup PopupMenu
|
|
|
|
|
|
+ * @param component
|
|
|
|
+ * Component
|
|
|
|
+ * @param popup
|
|
|
|
+ * PopupMenu
|
|
*/
|
|
*/
|
|
private static void addPopup(Component component, final JPopupMenu popup) {
|
|
private static void addPopup(Component component, final JPopupMenu popup) {
|
|
component.addMouseListener(new MouseAdapter() {
|
|
component.addMouseListener(new MouseAdapter() {
|