|
@@ -261,8 +261,10 @@ public class GUI<E> implements CategoryListener {
|
|
|
private final JMenuItem mntmResetCategory = new JMenuItem("Reset Categories");
|
|
|
private final JMenu mnLanguage = new JMenu("Language");
|
|
|
|
|
|
- private String[] columnNamesMulti = { "Object", "Nr.", "Device", "Energy", "Quantity", "Activated" };
|
|
|
- private String[] columnNamesSingle = { "Nr.", "Device", "Energy", "Quantity", "Activated" };
|
|
|
+ private String[] columnNamesMulti = { "Object", "Nr.", "Device", "Energy", "Flexibility", "Quantity", "Activated",
|
|
|
+ "Flex. activated" };
|
|
|
+ private String[] columnNamesSingle = { "Nr.", "Device", "Energy", "Flexibility", "Quantity", "Activated",
|
|
|
+ "Flex. activated" };
|
|
|
private ArrayList<PropertyTable> tables = new ArrayList<PropertyTable>();
|
|
|
private String[] comboBoxCat = { "Category", "Object", "Switch" };
|
|
|
private String warningText = "Warning";
|
|
@@ -353,7 +355,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
unitGraph.empty();
|
|
|
- } catch (IOException eex) {
|
|
|
+ } catch (IOException eex) {
|
|
|
|
|
|
eex.printStackTrace();
|
|
|
}
|
|
@@ -386,7 +388,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
unitGraph.empty();
|
|
|
- } catch (IOException ex) {
|
|
|
+ } catch (IOException ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
@@ -528,7 +530,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
try {
|
|
|
if (((JScrollPane) tabbedPane.getSelectedComponent()).getViewport()
|
|
|
.getComponent(0) instanceof UpperNodeCanvas)
|
|
|
-
|
|
|
+
|
|
|
controller.paste(
|
|
|
((UpperNodeCanvas) ((JScrollPane) tabbedPane.getSelectedComponent()).getViewport()
|
|
|
.getComponent(0)).upperNode,
|
|
@@ -947,16 +949,24 @@ public class GUI<E> implements CategoryListener {
|
|
|
int selectedValueBY = (int) Math.floor(yBMouse / 16);
|
|
|
|
|
|
if (model.getSelectedCpsObjects().size() > 1) {
|
|
|
- int selectedValueX = (int) Math.floor(xThis / (model.getTableHolonElement().getWidth() / 6));
|
|
|
- int selectedValueBX = (int) Math.floor(xBThis / (model.getTableHolonElement().getWidth() / 6));
|
|
|
+ int selectedValueX = (int) Math.floor(xThis / (model.getTableHolonElement().getWidth() / 8));
|
|
|
+ int selectedValueBX = (int) Math.floor(xBThis / (model.getTableHolonElement().getWidth() / 8));
|
|
|
if (updCon.getHolonObj(yMouse, model.getMultiTable()) != null) {
|
|
|
-
|
|
|
- if (selectedValueBX == 5) {
|
|
|
+
|
|
|
+ if (selectedValueBX == 6) {
|
|
|
HolonElement eleBTemp = updCon.getActualHolonElement(null, yBMouse, 0, tables);
|
|
|
String newBStuff = model.getMultiTable().getValueAt(selectedValueBY, selectedValueBX)
|
|
|
.toString();
|
|
|
Boolean bTemp = Boolean.parseBoolean(newBStuff);
|
|
|
eleBTemp.setActive(bTemp);
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (selectedValueBX == 7) {
|
|
|
+ HolonElement eleBTemp = updCon.getActualHolonElement(null, yBMouse, 0, tables);
|
|
|
+ String newBStuff = model.getMultiTable().getValueAt(selectedValueBY, selectedValueBX)
|
|
|
+ .toString();
|
|
|
+ Boolean bTemp = Boolean.parseBoolean(newBStuff);
|
|
|
+ eleBTemp.setActiveFlex(bTemp);
|
|
|
} else {
|
|
|
|
|
|
HolonElement eleTemp = updCon.getActualHolonElement(null, yMouse, 0, tables);
|
|
@@ -971,8 +981,13 @@ public class GUI<E> implements CategoryListener {
|
|
|
Float ftemp = Float.parseFloat(newStuff);
|
|
|
eleTemp.setEnergy(ftemp);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
else if (selectedValueX == 4) {
|
|
|
+ Float ftemp = Float.parseFloat(newStuff);
|
|
|
+ eleTemp.setFlexibility(ftemp);
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (selectedValueX == 5) {
|
|
|
Integer iTemp = Integer.parseInt(newStuff);
|
|
|
eleTemp.setAmount(iTemp);
|
|
|
}
|
|
@@ -980,17 +995,25 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
else if (model.getSelectedCpsObjects().size() == 1) {
|
|
|
- int selectedValueX = (int) Math.floor(xThis / (model.getTableHolonElement().getWidth() / 5));
|
|
|
- int selectedValueBX = (int) Math.floor(xBThis / (model.getTableHolonElement().getWidth() / 5));
|
|
|
+ int selectedValueX = (int) Math.floor(xThis / (model.getTableHolonElement().getWidth() / 7));
|
|
|
+ int selectedValueBX = (int) Math.floor(xBThis / (model.getTableHolonElement().getWidth() / 7));
|
|
|
if (updCon.getActualCps() != null && updCon.getActualCps().getClass() == HolonObject.class) {
|
|
|
-
|
|
|
- if (selectedValueBX == 4) {
|
|
|
+
|
|
|
+ if (selectedValueBX == 5) {
|
|
|
HolonElement eleBTemp = updCon
|
|
|
.getActualHolonElement((HolonObject) updCon.getActualCps(), yBMouse, 0, tables);
|
|
|
String newBStuff = model.getSingleTable().getValueAt(selectedValueBY, selectedValueBX)
|
|
|
.toString();
|
|
|
Boolean bTemp = Boolean.parseBoolean(newBStuff);
|
|
|
eleBTemp.setActive(bTemp);
|
|
|
+ }
|
|
|
+ else if (selectedValueBX == 6) {
|
|
|
+ HolonElement eleBTemp = updCon
|
|
|
+ .getActualHolonElement((HolonObject) updCon.getActualCps(), yBMouse, 0, tables);
|
|
|
+ String newBStuff = model.getSingleTable().getValueAt(selectedValueBY, selectedValueBX)
|
|
|
+ .toString();
|
|
|
+ Boolean bTemp = Boolean.parseBoolean(newBStuff);
|
|
|
+ eleBTemp.setActiveFlex(bTemp);
|
|
|
} else {
|
|
|
|
|
|
HolonElement eleTemp = updCon.getActualHolonElement((HolonObject) updCon.getActualCps(),
|
|
@@ -1004,8 +1027,13 @@ public class GUI<E> implements CategoryListener {
|
|
|
else if (selectedValueX == 2) {
|
|
|
Float ftemp = Float.parseFloat(newStuff);
|
|
|
eleTemp.setEnergy(ftemp);
|
|
|
- }
|
|
|
+ }
|
|
|
else if (selectedValueX == 3) {
|
|
|
+ Float ftemp = Float.parseFloat(newStuff);
|
|
|
+ eleTemp.setFlexibility(ftemp);
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (selectedValueX == 4) {
|
|
|
Integer iTemp = Integer.parseInt(newStuff);
|
|
|
eleTemp.setAmount(iTemp);
|
|
|
}
|
|
@@ -1669,7 +1697,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
unitGraph.empty();
|
|
|
- } catch (IOException e) {
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -1705,7 +1733,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
unitGraph.empty();
|
|
|
- } catch (IOException e) {
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
|
e.printStackTrace();
|
|
|
}
|