Commit d6b1a47c authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

fixed bug (Checkboxes return into their original state immediately after...

fixed bug (Checkboxes return into their original state immediately after checking/unchecking during animation)
parent ce39d328
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment