Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-04-21 18:01:47 -0400
committeratikhomirov2010-04-21 18:01:47 -0400
commitb07f1dcfdcf2e59509375f8e4499f0e78d8120a2 (patch)
tree82033e558aea41d71ceeb97cdd5bdc83aa10d243
parentfff3cb83c5dfb94a01e0f5abaac4ad4e6e863e74 (diff)
downloadorg.eclipse.gmf-tooling-b07f1dcfdcf2e59509375f8e4499f0e78d8120a2.tar.gz
org.eclipse.gmf-tooling-b07f1dcfdcf2e59509375f8e4499f0e78d8120a2.tar.xz
org.eclipse.gmf-tooling-b07f1dcfdcf2e59509375f8e4499f0e78d8120a2.zip
[142010] Use Draw2D 'native' Polyline and Polygon shapes instead of localCoordinates hack.
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt21
1 files changed, 6 insertions, 15 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt
index a5df469a6..796eaa24e 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009 Borland Software Corporation
+ * Copyright (c) 2007, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -226,12 +226,14 @@ protected org.eclipse.draw2d.IFigure childNodesPane;
«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.draw2d.IFigure createChildNodesPane() {
- org.eclipse.draw2d.IFigure result = new org.eclipse.draw2d.RectangleFigure()«IF isXYLayout(self)»«EXPAND forceUseLocalCoordinates»«ENDIF»;
+ org.eclipse.draw2d.IFigure result = new org.eclipse.draw2d.RectangleFigure()«IF isXYLayout(self)»«EXPAND impl::diagram::editparts::NodeEditPart::forceUseLocalCoordinates»«ENDIF»;
setupChildNodesPane(result);
return result;
}
«ENDDEFINE»
+// FIXME @see Full RT impl...NodeEditPart for refactoring suggestions
+
«DEFINE createNodeShape FOR gmfgen::GenNode-»
«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.draw2d.IFigure createNodeShape() {
@@ -243,7 +245,7 @@ protected org.eclipse.draw2d.IFigure createNodeShape() {
«DEFINE initPrimaryShape(node : gmfgen::GenNode) FOR gmfgen::Viewmap»«ERROR 'Unexpected viewmap type ' + self.repr()»«ENDDEFINE»
«DEFINE initPrimaryShape(node : gmfgen::GenNode) FOR gmfgen::FigureViewmap-»
-primaryShape = new «self.primaryShapeQualifiedClassName()»()«IF node.compartments->size() = 0 and (hasDirectChildren(node) and isXYLayout(node))»«EXPAND forceUseLocalCoordinates»«ENDIF»;
+primaryShape = new «self.primaryShapeQualifiedClassName()»()«IF node.compartments->isEmpty() and node.needsXYLayout()»«EXPAND impl::diagram::editparts::NodeEditPart::forceUseLocalCoordinates»«ENDIF»;
«ENDDEFINE»
«DEFINE initPrimaryShape(node : gmfgen::GenNode) FOR gmfgen::SnippetViewmap-»
@@ -251,21 +253,10 @@ primaryShape = «body»;
«ENDDEFINE»
«DEFINE initPrimaryShape(node : gmfgen::GenNode) FOR gmfgen::InnerClassViewmap-»
-«self.primaryShapeQualifiedClassName()» figure = new «self.primaryShapeQualifiedClassName()»();
-«IF node.compartments->size() = 0 and (hasDirectChildren(node) and isXYLayout(node))-»
-figure.setUseLocalCoordinates(true);
-«ENDIF-»
+«self.primaryShapeQualifiedClassName()» figure = new «self.primaryShapeQualifiedClassName()»()«IF node.compartments->isEmpty() and node.needsXYLayout()»«EXPAND impl::diagram::editparts::NodeEditPart::forceUseLocalCoordinates»«ENDIF»;
primaryShape = figure;
«ENDDEFINE»
-«DEFINE forceUseLocalCoordinates FOR OclAny-»
-{
- protected boolean useLocalCoordinates() {
- return true;
- }
-}«-»
-«ENDDEFINE»
-
«DEFINE getPrimaryShape FOR String-»
«EXPAND xpt::Common::generatedMemberComment»
public «self» getPrimaryShape() {

Back to the top