|
@@ -80,6 +80,8 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
private Hashtable<String, StatisticGraphPanel> graphHashtable;
|
|
private Hashtable<String, StatisticGraphPanel> graphHashtable;
|
|
private Hashtable<String, Integer> propValTable;
|
|
private Hashtable<String, Integer> propValTable;
|
|
private JPanel colorPanel;
|
|
private JPanel colorPanel;
|
|
|
|
+
|
|
|
|
+ //contains information about a selected property
|
|
private PropertyDataSet currentProperty = new PropertyDataSet();
|
|
private PropertyDataSet currentProperty = new PropertyDataSet();
|
|
private JComboBox colorComboBox;
|
|
private JComboBox colorComboBox;
|
|
private Control controller;
|
|
private Control controller;
|
|
@@ -95,7 +97,7 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
propValTable = new Hashtable<String, Integer>();
|
|
propValTable = new Hashtable<String, Integer>();
|
|
propValTable.put("total Production", PRODUCTION);
|
|
propValTable.put("total Production", PRODUCTION);
|
|
propValTable.put("total Consumption", CONSUMPTION);
|
|
propValTable.put("total Consumption", CONSUMPTION);
|
|
- propValTable.put("number of activated Elements", ACTIVATED_ELEMENTS);
|
|
|
|
|
|
+ propValTable.put("activated Elements", ACTIVATED_ELEMENTS);
|
|
|
|
|
|
JScrollPane dataPane = new JScrollPane();
|
|
JScrollPane dataPane = new JScrollPane();
|
|
setLeftComponent(dataPane);
|
|
setLeftComponent(dataPane);
|
|
@@ -103,6 +105,10 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
dataPane.setViewportView(panel);
|
|
dataPane.setViewportView(panel);
|
|
|
|
|
|
JScrollPane treeScrollPane = new JScrollPane();
|
|
JScrollPane treeScrollPane = new JScrollPane();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //================= LABLES ON THE LEFT SIDE =================//
|
|
|
|
+
|
|
JLabel lblObject = new JLabel("Object(s):");
|
|
JLabel lblObject = new JLabel("Object(s):");
|
|
|
|
|
|
showObjectlbl = new JLabel("...");
|
|
showObjectlbl = new JLabel("...");
|
|
@@ -114,7 +120,12 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
JLabel lblGraph = new JLabel("Graph:");
|
|
JLabel lblGraph = new JLabel("Graph:");
|
|
|
|
|
|
JLabel lblColor = new JLabel("Color:");
|
|
JLabel lblColor = new JLabel("Color:");
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ //================= LABLES END ===============================//
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //================= COLOR COMBOBOX ===========================//
|
|
|
|
+
|
|
colorComboBox = new JComboBox();
|
|
colorComboBox = new JComboBox();
|
|
colorComboBox.addItem("");
|
|
colorComboBox.addItem("");
|
|
colorComboBox.addItem("Red");
|
|
colorComboBox.addItem("Red");
|
|
@@ -183,6 +194,8 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // ==================== COLORBOX END ==========================//
|
|
|
|
|
|
// ====================GRAPH NR TEXTFIELD======================//
|
|
// ====================GRAPH NR TEXTFIELD======================//
|
|
graphNrTxtField = new JTextField();
|
|
graphNrTxtField = new JTextField();
|
|
@@ -415,7 +428,7 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
colorPanel.setBackground(Color.WHITE);
|
|
colorPanel.setBackground(Color.WHITE);
|
|
|
|
|
|
|
|
|
|
- //======================================== LAYOUT FOR COMPONENTS ON THE LEFT SIDE ============================
|
|
|
|
|
|
+ //================== LAYOUT FOR COMPONENTS ON THE LEFT SIDE ==================//
|
|
|
|
|
|
GroupLayout gl_panel = new GroupLayout(panel);
|
|
GroupLayout gl_panel = new GroupLayout(panel);
|
|
gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
|
|
gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
|
|
@@ -489,10 +502,10 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
.addPreferredGap(ComponentPlacement.RELATED).addComponent(btnAdd)
|
|
.addPreferredGap(ComponentPlacement.RELATED).addComponent(btnAdd)
|
|
.addContainerGap(35, Short.MAX_VALUE)));
|
|
.addContainerGap(35, Short.MAX_VALUE)));
|
|
|
|
|
|
- //======================================= LAYOUT END =======================================
|
|
|
|
|
|
+ //======================== LAYOUT END ================================//
|
|
|
|
|
|
|
|
|
|
- //======================================= TREE STRUCTURE====================================
|
|
|
|
|
|
+ //======================== TREE STRUCTURE=============================//
|
|
|
|
|
|
objectTree = new JTree();
|
|
objectTree = new JTree();
|
|
treeModel = (DefaultTreeModel) objectTree.getModel();
|
|
treeModel = (DefaultTreeModel) objectTree.getModel();
|
|
@@ -589,7 +602,7 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
- //=============================== TREE STRUCTURE END ====================================
|
|
|
|
|
|
+ //========================= TREE STRUCTURE END ============================//
|
|
|
|
|
|
|
|
|
|
panel.setLayout(gl_panel);
|
|
panel.setLayout(gl_panel);
|
|
@@ -604,7 +617,11 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
graphScrollPane.setViewportView(graphPanel);
|
|
graphScrollPane.setViewportView(graphPanel);
|
|
repaintTree();
|
|
repaintTree();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //=============================== END CONSTRUCTOR ==============================//
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //=============================== METHODS ======================================//
|
|
@Override
|
|
@Override
|
|
public void repaintTree() {
|
|
public void repaintTree() {
|
|
treeModel.reload();
|
|
treeModel.reload();
|
|
@@ -620,24 +637,23 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
for (AbstractCpsObject abs : hlList) {
|
|
for (AbstractCpsObject abs : hlList) {
|
|
String name = abs.getName() + " " + abs.getID();
|
|
String name = abs.getName() + " " + abs.getID();
|
|
DefaultMutableTreeNode tmp = new DefaultMutableTreeNode(name);
|
|
DefaultMutableTreeNode tmp = new DefaultMutableTreeNode(name);
|
|
|
|
+ Hashtable<String, PropertyDataSet> tmpHash = new Hashtable<String, PropertyDataSet>();
|
|
|
|
|
|
//HolonObjects
|
|
//HolonObjects
|
|
if(abs instanceof HolonObject){
|
|
if(abs instanceof HolonObject){
|
|
- Hashtable<String, PropertyDataSet> tmpHash = new Hashtable<String, PropertyDataSet>();
|
|
|
|
tmp.add(new DefaultMutableTreeNode("total Production"));
|
|
tmp.add(new DefaultMutableTreeNode("total Production"));
|
|
tmp.add(new DefaultMutableTreeNode("total Consumption"));
|
|
tmp.add(new DefaultMutableTreeNode("total Consumption"));
|
|
- tmp.add(new DefaultMutableTreeNode("number of activated Elements"));
|
|
|
|
|
|
+ tmp.add(new DefaultMutableTreeNode("activated Elements"));
|
|
tmpHash.put("total Production", new PropertyDataSet());
|
|
tmpHash.put("total Production", new PropertyDataSet());
|
|
tmpHash.put("total Consumption", new PropertyDataSet());
|
|
tmpHash.put("total Consumption", new PropertyDataSet());
|
|
- tmpHash.put("number of activated Elements", new PropertyDataSet());
|
|
|
|
- GraphDataSet gS = new GraphDataSet(abs, tmpHash);
|
|
|
|
- objectHashtable.put(name, gS);
|
|
|
|
|
|
+ tmpHash.put("activated Elements", new PropertyDataSet());
|
|
objectsNode.add(tmp);
|
|
objectsNode.add(tmp);
|
|
}
|
|
}
|
|
|
|
|
|
//HolonSwitches
|
|
//HolonSwitches
|
|
if(abs instanceof HolonSwitch){
|
|
if(abs instanceof HolonSwitch){
|
|
tmp.add(new DefaultMutableTreeNode("activated"));
|
|
tmp.add(new DefaultMutableTreeNode("activated"));
|
|
|
|
+ tmpHash.put("activated", new PropertyDataSet());
|
|
switchesNode.add(tmp);
|
|
switchesNode.add(tmp);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -645,15 +661,20 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
if(abs instanceof CpsUpperNode){
|
|
if(abs instanceof CpsUpperNode){
|
|
tmp.add(new DefaultMutableTreeNode("total Production"));
|
|
tmp.add(new DefaultMutableTreeNode("total Production"));
|
|
tmp.add(new DefaultMutableTreeNode("total Consumption"));
|
|
tmp.add(new DefaultMutableTreeNode("total Consumption"));
|
|
|
|
+ tmpHash.put("total Production", new PropertyDataSet());
|
|
|
|
+ tmpHash.put("total Consumption", new PropertyDataSet());
|
|
gridsNode.add(tmp);
|
|
gridsNode.add(tmp);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ GraphDataSet gS = new GraphDataSet(abs, tmpHash);
|
|
|
|
+ objectHashtable.put(name, gS);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(objectsNode.getChildCount() == 0){
|
|
if(objectsNode.getChildCount() == 0){
|
|
objectsNode.add(new DefaultMutableTreeNode("empty"));
|
|
objectsNode.add(new DefaultMutableTreeNode("empty"));
|
|
}
|
|
}
|
|
if(switchesNode.getChildCount() == 0){
|
|
if(switchesNode.getChildCount() == 0){
|
|
- objectsNode.add(new DefaultMutableTreeNode("empty"));
|
|
|
|
|
|
+ switchesNode.add(new DefaultMutableTreeNode("empty"));
|
|
}
|
|
}
|
|
if(gridsNode.getChildCount() == 0){
|
|
if(gridsNode.getChildCount() == 0){
|
|
gridsNode.add(new DefaultMutableTreeNode("empty"));
|
|
gridsNode.add(new DefaultMutableTreeNode("empty"));
|