|
@@ -291,10 +291,12 @@ public class GUI implements CategoryListener {
|
|
|
toolBarHolonEl.add(btnDelHolEL);
|
|
|
btnDelHolEL.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
|
- HolonObject obj = (HolonObject) getActualCps();
|
|
|
- tempElement = getActualHolonElement(obj, yValueElements);
|
|
|
- if (tempElement != null && obj.getClass() == HolonObject.class && obj.getID() != 0) {
|
|
|
- controller.deleteElementCanvas(obj.getID(), tempElement.getEleName());
|
|
|
+ if (getActualCps().getClass() == HolonObject.class) {
|
|
|
+ HolonObject obj = (HolonObject) getActualCps();
|
|
|
+ tempElement = getActualHolonElement(obj, yValueElements);
|
|
|
+ if (tempElement != null && obj.getClass() == HolonObject.class && obj.getID() != 0) {
|
|
|
+ controller.deleteElementCanvas(obj.getID(), tempElement.getEleName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|