Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2016-04-28 09:38:19 +0000
committerGerrit Code Review @ Eclipse.org2016-05-02 12:49:53 +0000
commit91841ef05ae54bee5f93ee0ea12e8e794eceeca1 (patch)
treeab82463a5f430d4b406283bba7d52cf415f3adfc /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src
parent714cc1a20451e4e059e756457b0b9142493a0374 (diff)
downloadorg.eclipse.papyrus-91841ef05ae54bee5f93ee0ea12e8e794eceeca1.tar.gz
org.eclipse.papyrus-91841ef05ae54bee5f93ee0ea12e8e794eceeca1.tar.xz
org.eclipse.papyrus-91841ef05ae54bee5f93ee0ea12e8e794eceeca1.zip
Bug 492458 - [Composite Structure Diagram] Ports incorrectly placed in
the four corner cases including graphical glitches and incorrect location of behavior adornment https://bugs.eclipse.org/bugs/show_bug.cgi?id=492458 Fix for NE NW SE SW: - Portpositionlocator - behavior width and height - behavior line decorator Change-Id: Id94e776350184d6fdbb6b2bd3ddf6a7c00efc429 Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/figures/BehaviorFigure.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/locators/LineDecoratorLocator.java14
2 files changed, 11 insertions, 7 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/figures/BehaviorFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/figures/BehaviorFigure.java
index 7f9091a4ea8..d83c19e32e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/figures/BehaviorFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/figures/BehaviorFigure.java
@@ -29,10 +29,10 @@ public class BehaviorFigure extends RoundedCompartmentFigure {
}
public void setPosition(int parentPosition) {
- if (parentPosition == PositionConstants.NORTH) {
+ if (PositionConstants.NORTH == (parentPosition & PositionConstants.NORTH)) {
doHorizontalFigure();
}
- if (parentPosition == PositionConstants.SOUTH) {
+ if (PositionConstants.SOUTH == (parentPosition & PositionConstants.SOUTH)) {
doHorizontalFigure();
}
if (parentPosition == PositionConstants.EAST) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/locators/LineDecoratorLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/locators/LineDecoratorLocator.java
index a5a5936be02..c90f17ed51f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/locators/LineDecoratorLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/locators/LineDecoratorLocator.java
@@ -37,34 +37,38 @@ public class LineDecoratorLocator extends BasePortChildLocator {
Point start = portBounds.getCenter();
Point end = new Point();
- LineDecorator ld = (LineDecorator)target;
+ LineDecorator ld = (LineDecorator) target;
int lineWidth = ld.getLineWidth();
switch (getPortSide()) {
case PositionConstants.WEST:
start.x = start.x + portBounds.width / 2 - 1;
end.x = start.x + BehaviorFigure.BEHAVIOR_OFFSET;
- start.y = start.y - lineWidth/2 - lengthAndWidthCorrection;
+ start.y = start.y - lineWidth / 2 - lengthAndWidthCorrection;
end.y = start.y + lineWidth;
ld.setHorizontal(true);
break;
case PositionConstants.EAST:
start.x = start.x - portBounds.width / 2 - 1;
end.x = start.x - BehaviorFigure.BEHAVIOR_OFFSET;
- start.y = start.y - lineWidth/2 - lengthAndWidthCorrection;
+ start.y = start.y - lineWidth / 2 - lengthAndWidthCorrection;
end.y = start.y + lineWidth;
ld.setHorizontal(true);
break;
case PositionConstants.SOUTH:
+ case PositionConstants.SOUTH_EAST:
+ case PositionConstants.SOUTH_WEST:
start.y = start.y - portBounds.height / 2 - 1;
end.y = start.y - BehaviorFigure.BEHAVIOR_OFFSET;
- start.x = start.x - lineWidth/2 - lengthAndWidthCorrection;
+ start.x = start.x - lineWidth / 2 - lengthAndWidthCorrection;
end.x = start.x + lineWidth;
ld.setHorizontal(false);
break;
case PositionConstants.NORTH:
+ case PositionConstants.NORTH_EAST:
+ case PositionConstants.NORTH_WEST:
start.y = start.y + portBounds.width / 2 - 1;
end.y = start.y + BehaviorFigure.BEHAVIOR_OFFSET;
- start.x = start.x - lineWidth/2 - lengthAndWidthCorrection;
+ start.x = start.x - lineWidth / 2 - lengthAndWidthCorrection;
end.x = start.x + lineWidth;
ld.setHorizontal(false);
break;

Back to the top