diff options
author | Henrik Rentz-Reichert | 2011-03-20 00:08:16 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2011-03-20 00:08:16 +0000 |
commit | 2ca206a86c1c01b18a17f7193bc2e816db44ff30 (patch) | |
tree | 5233ff2b4531c7e5bcfe4090b1a8489e6acfe9c7 /plugins | |
parent | 19f25d3efca29903a08edee8a1f3897a7b1d75ae (diff) | |
download | org.eclipse.etrice-2ca206a86c1c01b18a17f7193bc2e816db44ff30.tar.gz org.eclipse.etrice-2ca206a86c1c01b18a17f7193bc2e816db44ff30.tar.xz org.eclipse.etrice-2ca206a86c1c01b18a17f7193bc2e816db44ff30.zip |
ui.behavior: make states wider if name is long
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java index a464de4a1..8e6e9193e 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java @@ -203,8 +203,16 @@ public class StateSupport { Graphiti.getPeService().setPropertyValue(containerShape, Constants.TYPE_KEY, Constants.STATE_TYPE);
- int width = context.getWidth() <= 0 ? DEFAULT_SIZE_X : context.getWidth();
- int height = context.getHeight() <= 0 ? DEFAULT_SIZE_Y : context.getHeight();
+ int width = context.getWidth();
+ int height = context.getHeight();
+ if (width<=0) {
+ width = DEFAULT_SIZE_X;
+ int textSize = s.getName().length()*6;
+ if (width<textSize)
+ width = textSize;
+ }
+ if (height<=0)
+ height = DEFAULT_SIZE_Y;
boolean inherited = isInherited(getDiagram(), s);
Color lineColor = manageColor(inherited?INHERITED_COLOR:LINE_COLOR);
|