Browse Source

Edit-mode for multipleSelection fixed

Edgardo Palza 8 years ago
parent
commit
00d790c031
1 changed files with 24 additions and 0 deletions
  1. 24 0
      src/ui/view/GUI.java

+ 24 - 0
src/ui/view/GUI.java

@@ -567,6 +567,30 @@ public class GUI<E> implements CategoryListener {
 						// Multiple Selection
 						int selectedValueX = (int) Math.floor(xTHIS / (tableHolonElement.getWidth() / 5));
 						int selectedValueBX = (int) Math.floor(xBTHIS / (tableHolonElement.getWidth() / 5));
+						if (getHolonObj(yMouse) != null) {
+							if (selectedValueBX == 4) {
+								HolonElement eleBTemp = getActualHolonElement(null, yBMouse);
+								String newBStuff = tableModelHolonElementMulti
+										.getValueAt(selectedValueBY, selectedValueBX).toString();
+								Boolean bTemp = Boolean.parseBoolean(newBStuff);
+								eleBTemp.setActive(bTemp);
+							} else {
+								HolonElement eleTemp = getActualHolonElement(null, yMouse);
+								String newStuff = tableModelHolonElementMulti.getValueAt(selectedValueY, selectedValueX)
+										.toString();
+								// Small bug, when it comes to edit the name of
+								// the HolonElement
+								if (selectedValueX == 1) {
+									eleTemp.setEleName(newStuff);
+								} else if (selectedValueX == 2) {
+									Float ftemp = Float.parseFloat(newStuff);
+									eleTemp.setEnergy(ftemp);
+								} else if (selectedValueX == 3) {
+									Integer iTemp = Integer.parseInt(newStuff);
+									eleTemp.setAmount(iTemp);
+								}
+							}
+						}
 					} else if (model.getSelectedCpsObjects().size() == 1) {
 						// Single Selection
 						int selectedValueX = (int) Math.floor(xTHIS / (tableHolonElement.getWidth() / 4));