From a356f382fb65b1e6a0f9c38f36949acc4a83d019 Mon Sep 17 00:00:00 2001 From: Lukas Ladenberger <lukas.ladenberger@googlemail.com> Date: Mon, 23 Jul 2012 14:14:43 +0200 Subject: [PATCH] disabled "replace default value" when setting attributes in observer --- .../gef/editor/observer/ListenOperationByPredicate.java | 2 +- .../de/bmotionstudio/gef/editor/observer/SetAttribute.java | 3 ++- .../gef/editor/observer/SwitchChildCoordinates.java | 6 ++++-- .../gef/editor/observer/SwitchCoordinates.java | 4 ++-- .../de/bmotionstudio/gef/editor/observer/SwitchImage.java | 3 ++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ListenOperationByPredicate.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ListenOperationByPredicate.java index 09c9eda4..59584f2b 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ListenOperationByPredicate.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ListenOperationByPredicate.java @@ -117,7 +117,7 @@ public class ListenOperationByPredicate extends Observer { .getAttributeValue(attributeID); if (!oldAttrVal.equals(attributeVal)) { control.setAttributeValue(attributeID, - attributeVal); + attributeVal, true, false); } } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SetAttribute.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SetAttribute.java index 7130363e..02773321 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SetAttribute.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SetAttribute.java @@ -81,7 +81,8 @@ public class SetAttribute extends Observer { if (!obj.hasError()) { Object oldAttrVal = control.getAttributeValue(attributeID); if (!oldAttrVal.equals(attributeVal)) { - control.setAttributeValue(attributeID, attributeVal); + control.setAttributeValue(attributeID, attributeVal, + true, false); } } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchChildCoordinates.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchChildCoordinates.java index 4b765982..b078e128 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchChildCoordinates.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchChildCoordinates.java @@ -83,9 +83,11 @@ public class SwitchChildCoordinates extends Observer { // } else { toggleControl.setAttributeValue( - AttributeConstants.ATTRIBUTE_X, parsedX); + AttributeConstants.ATTRIBUTE_X, parsedX, true, + false); toggleControl.setAttributeValue( - AttributeConstants.ATTRIBUTE_Y, parsedY); + AttributeConstants.ATTRIBUTE_Y, parsedY, true, + false); // } } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchCoordinates.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchCoordinates.java index f1fff2ff..0f7733a3 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchCoordinates.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchCoordinates.java @@ -84,9 +84,9 @@ public class SwitchCoordinates extends Observer { // } else { control.setAttributeValue(AttributeConstants.ATTRIBUTE_X, - parsedX); + parsedX, true, false); control.setAttributeValue(AttributeConstants.ATTRIBUTE_Y, - parsedY); + parsedY, true, false); // setCallBack(true); // checked = false; // } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchImage.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchImage.java index 471e0ae2..4422c618 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchImage.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/SwitchImage.java @@ -63,7 +63,8 @@ public class SwitchImage extends Observer { if (!control.getAttributeValue( AttributeConstants.ATTRIBUTE_IMAGE).equals(fImage)) { control.setAttributeValue( - AttributeConstants.ATTRIBUTE_IMAGE, fImage); + AttributeConstants.ATTRIBUTE_IMAGE, fImage, + true, false); } } -- GitLab