|
@@ -201,10 +201,10 @@ public class AddObjectPopUp extends JDialog {
|
|
|
addElement.setVisible(true);
|
|
|
HolonElement hl = addElement.getElement();
|
|
|
hl.setSaving(new Pair<String, String>(givenCategory, objectName.getText()));
|
|
|
-// if (hl != null) {
|
|
|
-// hl.setSav(givenCategory);
|
|
|
-// }
|
|
|
-// hl.setObj(objectName.getText());
|
|
|
+ // if (hl != null) {
|
|
|
+ // hl.setSav(givenCategory);
|
|
|
+ // }
|
|
|
+ // hl.setObj(objectName.getText());
|
|
|
addElement(hl);
|
|
|
}
|
|
|
});
|
|
@@ -271,22 +271,25 @@ public class AddObjectPopUp extends JDialog {
|
|
|
try {
|
|
|
if (editState) {
|
|
|
controller.delObjectCategory(givenCategory, toEdit.getName());
|
|
|
+ hElements.forEach(ele -> ele
|
|
|
+ .setSaving(new Pair<>(ele.getSaving().getKey(), objectName.getText())));
|
|
|
controller.addObject(controller.searchCategory(givenCategory),
|
|
|
objectName.getText(), hElements, imagePath);
|
|
|
+
|
|
|
} else {
|
|
|
controller.addObject(controller.searchCategory(givenCategory),
|
|
|
objectName.getText(), hElements, imagePath);
|
|
|
}
|
|
|
} catch (Exception e2) {
|
|
|
// TODO: handle exception
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// controller.addObjectCategory(controller.searchCategory(givenCategory),
|
|
|
// theObject);
|
|
|
//
|
|
|
// System.out.println(theObject.getImage());
|
|
|
- System.out.println(givenCategory);
|
|
|
+
|
|
|
dispose();
|
|
|
} else {
|
|
|
sourcePath.setBackground(new Color(255, 50, 50));
|