Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.structure')
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java2
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java18
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/PortSupport.java9
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/SPPSupport.java7
4 files changed, 20 insertions, 16 deletions
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
index 993837c6c..5a2575a90 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
@@ -105,7 +105,7 @@ public class ActorContainerRefSupport {
public static final int DEFAULT_SIZE_Y = 80;
public static final int MIN_SIZE_X = 100;
public static final int MIN_SIZE_Y = 60;
- public static final int MARGIN = 20;
+ public static final int MARGIN = 25;
public static final IColorConstant LINE_COLOR = new ColorConstant(0, 0, 0);
public static final IColorConstant INHERITED_COLOR = new ColorConstant(100, 100, 100);
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
index bfdad7b8c..d8b3ea14b 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
@@ -74,7 +74,9 @@ import org.eclipse.graphiti.util.IColorConstant;
public class InterfaceItemSupport {
public static final int ITEM_SIZE = StructureClassSupport.MARGIN;
- public static final int ITEM_SIZE_SMALL = ActorContainerRefSupport.MARGIN;
+ public static final int ITEM_SIZE_SMALL = (int) (ActorContainerRefSupport.MARGIN*0.8);
+ public static final int MARGIN = StructureClassSupport.MARGIN;
+ public static final int MARGIN_SMALL = ActorContainerRefSupport.MARGIN;
protected static final int LINE_WIDTH = 2;
protected static final IColorConstant DARK_COLOR = new ColorConstant(0, 0, 0);
@@ -146,7 +148,7 @@ public class InterfaceItemSupport {
boolean inherited = isInherited(port, bo, acShape);
boolean refport = (bo instanceof ActorContainerRef);
- int margin = refport?ITEM_SIZE_SMALL:ITEM_SIZE;
+ int margin = refport?MARGIN_SMALL:MARGIN;
int size = refport?ITEM_SIZE_SMALL:ITEM_SIZE;
// CONTAINER SHAPE WITH RECTANGLE
@@ -211,7 +213,7 @@ public class InterfaceItemSupport {
IGaService gaService = Graphiti.getGaService();
{
final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
- gaService.setLocationAndSize(invisibleRectangle, x, y, 2*size, 2*size);
+ gaService.setLocationAndSize(invisibleRectangle, x, y, 2*margin, 2*margin);
createItemFigure(port, refport,
containerShape,
@@ -230,7 +232,7 @@ public class InterfaceItemSupport {
label.setBackground(dark);
label.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
label.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- gaService.setLocationAndSize(label, 0, 3*size/2, 2*size, size/2);
+ gaService.setLocationAndSize(label, 0, 3*margin/2, 2*margin, margin/2);
adjustLabel(label, x, y, width, margin, size);
}
@@ -289,8 +291,8 @@ public class InterfaceItemSupport {
ContainerShape acShape = context.getTargetContainer();
boolean refport = (getBusinessObjectForPictogramElement(acShape) instanceof ActorContainerRef);
- int margin = refport?ActorContainerRefSupport.MARGIN:StructureClassSupport.MARGIN;
- int size = refport?ActorContainerRefSupport.MARGIN:ITEM_SIZE;
+ int margin = refport?MARGIN_SMALL:MARGIN;
+ int size = refport?ITEM_SIZE_SMALL:ITEM_SIZE;
int x = context.getX();
int y = context.getY();
@@ -637,7 +639,7 @@ public class InterfaceItemSupport {
Orientation align = Orientation.ALIGNMENT_CENTER;
label.setHorizontalAlignment(align);
- int pos = 3*size/2;
+ int pos = 3*margin/2;
if (x<=margin)
align = Orientation.ALIGNMENT_LEFT;
@@ -651,7 +653,7 @@ public class InterfaceItemSupport {
}
if (pos!=label.getY()) {
IGaService gaService = Graphiti.getGaService();
- gaService.setLocationAndSize(label, 0, pos, 2*size, size/2);
+ gaService.setLocationAndSize(label, 0, pos, 2*margin, margin/2);
}
}
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/PortSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/PortSupport.java
index ea970a1bf..54c59261e 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/PortSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/PortSupport.java
@@ -270,6 +270,7 @@ public class PortSupport extends InterfaceItemSupport {
boolean relay = ValidationUtil.isRelay(port);
int size = refport?ITEM_SIZE_SMALL:ITEM_SIZE;
+ int margin = refport?MARGIN_SMALL:MARGIN;
int offset = refport?REPL_OFFSET_SMALL:REPL_OFFSET;
int line = refport?LINE_WIDTH/2:LINE_WIDTH;
@@ -293,7 +294,7 @@ public class PortSupport extends InterfaceItemSupport {
rect.setForeground(darkColor);
rect.setBackground(brightDolor);
rect.setLineWidth(line);
- gaService.setLocationAndSize(rect, size/2+offset, size/2-offset, size, size);
+ gaService.setLocationAndSize(rect, margin-size/2+offset, margin-size/2-offset, size, size);
}
Rectangle rect = gaService.createRectangle(invisibleRectangle);
@@ -303,7 +304,7 @@ public class PortSupport extends InterfaceItemSupport {
rect.setLineWidth(4*line);
else
rect.setLineWidth(line);
- gaService.setLocationAndSize(rect, size/2, size/2, size, size);
+ gaService.setLocationAndSize(rect, margin-size/2, margin-size/2, size, size);
if (containerShape.getAnchors().isEmpty()) {
// here we place our anchor
@@ -326,7 +327,7 @@ public class PortSupport extends InterfaceItemSupport {
inset.setForeground(darkColor);
inset.setBackground(darkColor);
inset.setLineWidth(LINE_WIDTH);
- gaService.setLocationAndSize(inset, 3*size/4, 3*size/4, size/2, size/2);
+ gaService.setLocationAndSize(inset, margin-size/4, margin-size/4, size/2, size/2);
}
else {
Color fill = port.isConjugated()?darkColor:brightDolor;
@@ -335,7 +336,7 @@ public class PortSupport extends InterfaceItemSupport {
inset.setForeground(fill);
inset.setBackground(fill);
inset.setLineWidth(LINE_WIDTH);
- gaService.setLocationAndSize(inset, 3*size/4, 3*size/4, size/2, size/2);
+ gaService.setLocationAndSize(inset, margin-size/4, margin-size/4, size/2, size/2);
}
}
}
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/SPPSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/SPPSupport.java
index 50f0c544f..04da16dc7 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/SPPSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/SPPSupport.java
@@ -241,6 +241,7 @@ public class SPPSupport extends InterfaceItemSupport {
boolean relay = ValidationUtil.isRelay(spp);
int size = refspp?ITEM_SIZE_SMALL:ITEM_SIZE;
+ int margin = refspp?MARGIN_SMALL:MARGIN;
int line = refspp?LINE_WIDTH/2:LINE_WIDTH;
Color bg = brightDolor;
@@ -257,8 +258,8 @@ public class SPPSupport extends InterfaceItemSupport {
IGaService gaService = Graphiti.getGaService();
// TODOHRR: depicting SPPs as diamond using polygon didn't work
-// int s2 = size/2;
-// int xy[] = new int[] { s2, 0, size, s2, s2, size, 0, s2};
+// int s2 = margin-size/2;
+// int xy[] = new int[] { s2, 0, margin, s2, s2, margin, 0, s2};
// Polygon rect = gaService.createPolygon(invisibleRectangle, xy);
// rect.setForeground(darkColor);
// rect.setBackground(bg);
@@ -270,7 +271,7 @@ public class SPPSupport extends InterfaceItemSupport {
rect.setForeground(darkColor);
rect.setBackground(bg);
rect.setLineWidth(line);
- gaService.setLocationAndSize(rect, size/2, size/2, size, size);
+ gaService.setLocationAndSize(rect, margin-size/2, margin-size/2, size, size);
if (containerShape.getAnchors().isEmpty()) {
// here we place our anchor

Back to the top