Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2014-08-18 14:29:49 +0000
committermgolubev2014-08-18 16:22:09 +0000
commit907dde71b234aef15b1e697245e7c26a75ff626e (patch)
tree8251f4357290d14bdcd3a70af2521020b652f464 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java
parentca773032c60138a39138d0566a925a4c0796cf10 (diff)
downloadorg.eclipse.papyrus-907dde71b234aef15b1e697245e7c26a75ff626e.tar.gz
org.eclipse.papyrus-907dde71b234aef15b1e697245e7c26a75ff626e.tar.xz
org.eclipse.papyrus-907dde71b234aef15b1e697245e7c26a75ff626e.zip
LinksLF: common framework for improved links-anchors-bendpoints behavior
(usecase, class, activity, communic, comp, csd, deploy, profile, state) Change-Id: I58f81529e619ff56c7b3582cf6b65db7b2518a15 Signed-off-by: mgolubev <golubev@montages.com>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java
new file mode 100644
index 00000000000..cdcae044922
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/linkslf/LinksLFCommentEditPart.java
@@ -0,0 +1,41 @@
+package org.eclipse.papyrus.uml.diagram.common.editparts.linkslf;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.linklf.ShapeNodeAnchorDelegate;
+import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart;
+
+
+public class LinksLFCommentEditPart extends AbstractCommentEditPart {
+
+ private ShapeNodeAnchorDelegate myShapeNodeAnchorDelegate;
+
+ public LinksLFCommentEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ DefaultEditPolicies.installNodeEditPolicies(this);
+ }
+
+ @Override
+ public final ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ return getShapeNodeAnchorDelegate().getSourceConnectionAnchor(request);
+ }
+
+ @Override
+ public final ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ return getShapeNodeAnchorDelegate().getTargetConnectionAnchor(request);
+ }
+
+ private ShapeNodeAnchorDelegate getShapeNodeAnchorDelegate() {
+ if(myShapeNodeAnchorDelegate == null) {
+ myShapeNodeAnchorDelegate = new ShapeNodeAnchorDelegate(getNodeFigure());
+ }
+ return myShapeNodeAnchorDelegate;
+ }
+
+}

Back to the top