Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Leacu2017-11-01 11:11:49 -0400
committerPaul Leacu2017-11-01 11:11:49 -0400
commitb396c38f78b6ee15afa80f77cc1aee03343f5e13 (patch)
tree2cea272fe24f45191b41669738d30c3ea3a2dd0b
parent239df7852d54eb73ee85951fd5c8ac8bd4024074 (diff)
downloadorg.eclipse.bpmn2-modeler-b396c38f78b6ee15afa80f77cc1aee03343f5e13.tar.gz
org.eclipse.bpmn2-modeler-b396c38f78b6ee15afa80f77cc1aee03343f5e13.tar.xz
org.eclipse.bpmn2-modeler-b396c38f78b6ee15afa80f77cc1aee03343f5e13.zip
[497647] Allow grid dimensions to include 0. Update display on application.
Change-Id: Ia9f4837dc810bf9c400b7519ae355c75c9d75f8a Signed-off-by: Paul Leacu <pleacu@redhat.com>
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java10
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DefaultBPMN2Editor.java1
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorAppearancePreferencePage.java9
3 files changed, 12 insertions, 8 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
index cdbe88d0..86f286c0 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
@@ -417,7 +417,7 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
}
public int getDefaultWidth() {
- if (defaultWidth<=0) {
+ if (defaultWidth<0) {
if (object.toLowerCase().contains("gateway")) //$NON-NLS-1$
return 50;
if (object.toLowerCase().contains("event")) //$NON-NLS-1$
@@ -431,15 +431,15 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
return defaultWidth;
}
- public void setDefaultWidth(int defaultWidth) {
- if (this.defaultWidth!=defaultWidth) {
- this.defaultWidth = defaultWidth;
+ public void setDefaultWidth(int newWidth) {
+ if (this.defaultWidth != newWidth) {
+ this.defaultWidth = newWidth;
changeMask |= SS_DEFAULT_WIDTH;
}
}
public int getDefaultHeight() {
- if (defaultHeight<=0) {
+ if (defaultHeight<0) {
if (object.toLowerCase().contains("gateway")) //$NON-NLS-1$
return 50;
if (object.toLowerCase().contains("event")) //$NON-NLS-1$
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DefaultBPMN2Editor.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DefaultBPMN2Editor.java
index c3b39f2c..f3df4551 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DefaultBPMN2Editor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/DefaultBPMN2Editor.java
@@ -831,6 +831,7 @@ public class DefaultBPMN2Editor extends DiagramEditor implements IPreferenceChan
ga.setForeground(gaService.manageColor(diagram, ss.getShapeForeground()));
refresh();
getGraphicalControl().redraw();
+ getGraphicalControl().getDisplay().update();
}
});
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorAppearancePreferencePage.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorAppearancePreferencePage.java
index 062bad91..ca605473 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorAppearancePreferencePage.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/Bpmn2EditorAppearancePreferencePage.java
@@ -650,6 +650,7 @@ public class Bpmn2EditorAppearancePreferencePage extends PreferencePage implemen
catch(Exception e) {
}
super.performDefaults();
+ Display.getDefault().update();
}
@Override
@@ -1070,14 +1071,16 @@ public class Bpmn2EditorAppearancePreferencePage extends PreferencePage implemen
@Override
public Integer getValue() {
- if (text!=null) {
- return Integer.parseInt(text.getText());
+ if (text != null) {
+ String textVal = text.getText();
+ if (!textVal.isEmpty())
+ return Integer.parseInt(textVal);
}
return -1;
}
public void setValue(int value) {
- if (text!=null) {
+ if (text != null) {
text.setText(Integer.toString(value, 10));
}
}

Back to the top