diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCheckboxPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCheckboxPart.java index a0efb30c21906df461032231558d23d546573821..21ca996cdbc9996cdb904bd4c51f51bc2ce956bf 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCheckboxPart.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCheckboxPart.java @@ -36,27 +36,23 @@ public class BCheckboxPart extends AppAbstractEditPart { private ChangeListener changeListener = new ChangeListener() { @Override public void handleStateChanged(ChangeEvent event) { - if (event.getPropertyName().equals(ButtonModel.PRESSED_PROPERTY)) { - - BControl control = (BControl) getModel(); - - // Recheck observer after click - control.getVisualization().getAnimation().checkObserver(); - - if (Boolean.valueOf(control.getAttributeValue( - AttributeConstants.ATTRIBUTE_CHECKED).toString())) { - control.setAttributeValue( - AttributeConstants.ATTRIBUTE_CHECKED, false); - } else { - control.setAttributeValue( - AttributeConstants.ATTRIBUTE_CHECKED, true); + AbstractBMotionFigure f = (AbstractBMotionFigure) getFigure(); + if (f.getModel().isPressed()) { + BControl control = (BControl) getModel(); + // Recheck observer after click + control.getVisualization().getAnimation().checkObserver(); + if (Boolean.valueOf(control.getAttributeValue( + AttributeConstants.ATTRIBUTE_CHECKED).toString())) { + control.setAttributeValue( + AttributeConstants.ATTRIBUTE_CHECKED, false); + } else { + control.setAttributeValue( + AttributeConstants.ATTRIBUTE_CHECKED, true); + } } - } - } - }; @Override