Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend3
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend5
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend26
3 files changed, 31 insertions, 3 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
index 03513d7a8c8..cbb61d0e5ad 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend
@@ -15,10 +15,10 @@ package aspects.diagram.editparts
import com.google.inject.Inject
import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.CustomBehaviour
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel
import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference
import xpt.Common
-import org.eclipse.gmf.codegen.gmfgen.CustomBehaviour
@Singleton class LinkLabelEditPart extends diagram.editparts.LinkLabelEditPart{
@Inject extension Common;
@@ -70,5 +70,4 @@ import org.eclipse.gmf.codegen.gmfgen.CustomBehaviour
«ENDFOR»
}
'''
-
}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend
index 80c54cde444..1175194be6e 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend
@@ -38,5 +38,10 @@ import xpt.diagram.editparts.Common
««« End Papyrus Code
super.handleNotificationEvent(event);
'''
+
+ override additionalEditPolicies(GenLinkLabel it)
+ '''
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy());
+ '''
}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend
index 8c84ea36d0d..f6ab147f25e 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend
@@ -35,6 +35,8 @@ import xpt.diagram.editparts.EditPartFactory
import xpt.diagram.editparts.Utils_qvto
import xpt.diagram.editpolicies.TextSelectionEditPolicy
import xpt.CodeStyle
+import xpt.diagram.ViewmapAttributesUtils_qvto
+import org.eclipse.papyrus.papyrusgmfgenextension.SpecificNodePlate
@Singleton class NodeEditPart extends impl.diagram.editparts.NodeEditPart {
@Inject extension Common;
@@ -43,8 +45,10 @@ import xpt.CodeStyle
@Inject extension EditPartsUtils_qvto;
@Inject extension VisualIDRegistry;
- @Inject extension Utils_qvto;
+ @Inject extension ViewmapAttributesUtils_qvto;
+ @Inject extension Utils_qvto;
+ @Inject extension xpt.diagram.Utils_qvto;
@Inject EditPartFactory xptEditPartFactory;
@Inject impl.diagram.editparts.TextAware xptTextAware;
@@ -177,6 +181,26 @@ override addFixedChild (GenNode it)'''
// }
// '''
+ override createNodePlate(GenNode it) '''
+ «IF it.eResource.allContents.filter(typeof(SpecificNodePlate)).filter[v |v.editParts.contains(it) && v.nodePlateQualifiedName!=null].size != 0»
+ «val editPart = it.eResource.allContents.filter(typeof(SpecificNodePlate)).filter[v |v.editParts.contains(it) && v.nodePlateQualifiedName!=null].head»
+ protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
+ «editPart.nodePlateQualifiedName» result = new «editPart.nodePlateQualifiedName»(«IF getDiagram().isPixelMapMode()»«defaultSizeWidth(viewmap, 40)», «defaultSizeHeight(viewmap, 40)»«ELSE»getMapMode().DPtoLP(«defaultSizeWidth(viewmap, 40)»), getMapMode().DPtoLP(«defaultSizeHeight(viewmap, 40)»)«ENDIF»);
+ «setupNodePlate»
+ return result;
+ }
+ «««END: BEGIN: PapyrusGenCode
+ «ELSE»
+ ««« «super.createNodePlate(it)»
+ ««« By default node edit part are now RoundedRectangleNodePlateFigure
+ protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
+ org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure result = new org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure(«IF getDiagram().isPixelMapMode()»«defaultSizeWidth(viewmap, 40)», «defaultSizeHeight(viewmap, 40)»«ELSE»getMapMode().DPtoLP(«defaultSizeWidth(viewmap, 40)»), getMapMode().DPtoLP(«defaultSizeHeight(viewmap, 40)»)«ENDIF»);
+ «setupNodePlate»
+ return result;
+ }
+ «ENDIF»
+ '''
+
override borderItemSelectionEditPolicy(GenNode it)'''
«IF hasBorderItems(it)»
org.eclipse.gmf.runtime.notation.View childView = (org.eclipse.gmf.runtime.notation.View) child.getModel();

Back to the top