Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto47
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto
new file mode 100644
index 000000000..709579925
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/ViewmapAttributesUtils.qvto
@@ -0,0 +1,47 @@
+modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";
+
+library ViewmapAttributesUtils;
+
+helper isStoringChildPositions(layoutType : genModel::ViewmapLayoutType) : Boolean {
+ return genModel::ViewmapLayoutType::XY_LAYOUT = layoutType
+}
+
+helper isFixedFont(viewmap : genModel::Viewmap) : Boolean {
+ return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedFont)
+}
+
+helper isFixedForeground(viewmap : genModel::Viewmap) : Boolean {
+ return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedForeground)
+}
+
+helper isFixedBackground(viewmap : genModel::Viewmap) : Boolean {
+ return null <> viewmap and (viewmap.attributes)[genModel::StyleAttributes]->exists(e | e.fixedBackground)
+}
+
+helper getResizeConstraints(viewmap : genModel::Viewmap) : genModel::ResizeConstraints {
+ return (if null = viewmap then null else (viewmap.attributes)[genModel::ResizeConstraints]->first().oclAsType(genModel::ResizeConstraints) endif)
+}
+
+helper getDefaultSizeAttributes(viewmap : genModel::Viewmap) : genModel::DefaultSizeAttributes {
+ return (if null = viewmap then null else (viewmap.attributes)[genModel::DefaultSizeAttributes]->first().oclAsType(genModel::DefaultSizeAttributes) endif)
+}
+
+helper defaultSizeWidth(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
+ return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.width endif)
+}
+
+helper defaultSizeHeight(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
+ return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.height endif)
+}
+
+helper getLabelOffsetAttributes(viewmap : genModel::Viewmap) : genModel::LabelOffsetAttributes {
+ return (if null = viewmap then null else (viewmap.attributes)[genModel::LabelOffsetAttributes]->first().oclAsType(genModel::LabelOffsetAttributes) endif)
+}
+
+helper labelOffsetX(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
+ return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.x endif)
+}
+
+helper labelOffsetY(viewmap : genModel::Viewmap, defaultValue : Integer) : Integer {
+ return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.y endif)
+}

Back to the top