diff options
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend index d7859ee213f..9b3aefe1dea 100644 --- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend +++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/views/ViewStyles.xtend @@ -11,20 +11,24 @@ * Artem Tikhomirov (Borland) - [257119] Create views directly, not through ViewFactories * Michael Golubev (Montages) - #386838 - migrate to Xtend2 */ -package aspects.xpt.diagram.views
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
-import xpt.diagram.ViewmapAttributesUtils_qvto
-
+package aspects.xpt.diagram.views + +import aspects.xpt.Common +import com.google.inject.Inject +import com.google.inject.Singleton +import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel +import org.eclipse.gmf.codegen.gmfgen.GenLabel +import xpt.diagram.Utils_qvto +import xpt.diagram.ViewmapAttributesUtils_qvto + /** * Renamed from xpt::diagram::views::Utils.xpt * in order to have consistent naming between Xtend files migrated from _qvto helpers and xpt templates */ @Singleton class ViewStyles extends xpt.diagram.views.ViewStyles{ - + @Inject extension Common; @Inject extension ViewmapAttributesUtils_qvto; + @Inject extension Utils_qvto; @@ -36,4 +40,15 @@ import xpt.diagram.ViewmapAttributesUtils_qvto «ENDIF» ''' + override def offset(GenLabel it, String viewVar, int x, int y) ''' + «val location = stringUniqueIdentifier.toFirstLower+'_Location'» + org.eclipse.gmf.runtime.notation.Location «location» = (org.eclipse.gmf.runtime.notation.Location) «viewVar».getLayoutConstraint(); + «IF it.getDiagram().isPixelMapMode()» + «location».setX(«x»); + «location».setY(«y»); + «ELSE» + «location».setX(org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper.getMapMode(«viewVar».getDiagram().getMeasurementUnit()).DPtoLP(«x»)); + «location».setY(org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper.getMapMode(«viewVar».getDiagram().getMeasurementUnit()).DPtoLP(«y»)); + «ENDIF» + ''' } |