|
@@ -1234,12 +1234,13 @@ public class GUI<E> implements CategoryListener {
|
|
|
int selValueX = (int) Math.floor(xProThis / (tableProperties.getWidth() / 2));
|
|
|
int selValueYBool = (int) Math.floor(yProThisOneClick / 16);
|
|
|
int selValueXBool = (int) Math.floor(xProThisOneClick / (tableProperties.getWidth() / 2));
|
|
|
- if (updCon.getActualCps() != null && selValueX != 0) {
|
|
|
+ if (updCon.getActualCps() != null) {
|
|
|
temp = model.getPropertyTable().getValueAt(selValueY, selValueX);
|
|
|
btemp = model.getPropertyTable().getValueAt(selValueYBool, selValueXBool);
|
|
|
|
|
|
+
|
|
|
if (updCon.getActualCps() instanceof HolonSwitch) {
|
|
|
- if (selValueY == 0) {
|
|
|
+ if (selValueY == 0 && selValueX != 0) {
|
|
|
updCon.getActualCps().setName(temp.toString());
|
|
|
}
|
|
|
if (selValueYBool == 2) {
|
|
@@ -1253,12 +1254,12 @@ public class GUI<E> implements CategoryListener {
|
|
|
} else if (selValueYBool == 3) {
|
|
|
if (((HolonSwitch) updCon.getActualCps()).getManualMode()) {
|
|
|
model.getPropertyTable().setCellEditable(3, 1, true);
|
|
|
- Boolean bTemp = Boolean.parseBoolean(temp.toString());
|
|
|
+ Boolean bTemp = Boolean.parseBoolean(btemp.toString());
|
|
|
((HolonSwitch) updCon.getActualCps()).setManualState(bTemp);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (updCon.getActualCps() instanceof CpsUpperNode) {
|
|
|
+ else if (updCon.getActualCps() instanceof CpsUpperNode && selValueX != 0) {
|
|
|
|
|
|
updCon.getActualCps().setName(temp.toString());
|
|
|
|
|
@@ -1275,7 +1276,7 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (updCon.getActualCps() instanceof HolonObject) {
|
|
|
+ else if (updCon.getActualCps() instanceof HolonObject && selValueX != 0) {
|
|
|
|
|
|
updCon.getActualCps().setName(temp.toString());
|
|
|
}
|
|
@@ -1986,18 +1987,18 @@ public class GUI<E> implements CategoryListener {
|
|
|
|
|
|
frmCyberPhysical.getContentPane().add(timePanel, BorderLayout.SOUTH);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
MouseAdapter focusCanvas = new MouseAdapter() {
|
|
|
@Override
|
|
|
public void mouseExited(MouseEvent e) {
|
|
|
contentPane.requestFocus();
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
model.getTableHolonElement().addMouseListener(focusCanvas);
|
|
|
tableProperties.addMouseListener(focusCanvas);
|
|
|
console.getConsoleText().addMouseListener(focusCanvas);
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
controller.loadAutoSave(System.getProperty("user.home") + "/.config/HolonGUI/Category/Category.json");
|
|
|
} catch (IOException e1) {
|