diff options
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/diagram/ViewmapAttributesUtils.qvto')
-rw-r--r-- | plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/diagram/ViewmapAttributesUtils.qvto | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/diagram/ViewmapAttributesUtils.qvto b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/diagram/ViewmapAttributesUtils.qvto deleted file mode 100644 index 027bdd3a1b3..00000000000 --- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/diagram/ViewmapAttributesUtils.qvto +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Dmitry Stadnik (Borland) - initial API and implementation - * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 - *****************************************************************************/ - -import xpt.OclMigrationProblems; - -modeltype gmfgen uses "http://www.eclipse.org/papyrus/gmf/2020/GenModel"; - -library ViewmapAttributesUtils; - -helper isStoringChildPositions(layoutType : gmfgen::ViewmapLayoutType) : Boolean { - return gmfgen::ViewmapLayoutType::XY_LAYOUT = layoutType -} - -helper gmfgen::Viewmap::isFixedFont() : Boolean { - return self.attributes[gmfgen::StyleAttributes]->exists(fixedFont) -} - -helper gmfgen::Viewmap::isFixedForeground() : Boolean { - return self.attributes[gmfgen::StyleAttributes]->exists(fixedForeground) -} - -helper gmfgen::Viewmap::isFixedBackground() : Boolean { - return self.attributes[gmfgen::StyleAttributes]->exists(fixedBackground) -} - -helper gmfgen::Viewmap::canUseShapeStyle() : Boolean { - return not (self.isFixedFont() or self.isFixedForeground() or self.isFixedBackground()); -} - -helper getResizeConstraints(viewmap : gmfgen::Viewmap) : gmfgen::ResizeConstraints { - return (if null = viewmap then null else firstOrNull(viewmap.attributes[gmfgen::ResizeConstraints]) endif) -} - -helper getDefaultSizeAttributes(viewmap : gmfgen::Viewmap) : gmfgen::DefaultSizeAttributes { - return (if null = viewmap then null else firstOrNull(viewmap.attributes[gmfgen::DefaultSizeAttributes]) endif) -} - -helper defaultSizeWidth(viewmap : gmfgen::Viewmap, defaultValue : Integer) : Integer { - return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.width endif) -} - -helper defaultSizeHeight(viewmap : gmfgen::Viewmap, defaultValue : Integer) : Integer { - return let a = getDefaultSizeAttributes(viewmap) in (if null = a then defaultValue else a.height endif) -} - -helper getLabelOffsetAttributes(viewmap : gmfgen::Viewmap) : gmfgen::LabelOffsetAttributes { - return (if null = viewmap then null else firstOrNull(viewmap.attributes[gmfgen::LabelOffsetAttributes]) endif) -} - -helper labelOffsetX(viewmap : gmfgen::Viewmap, defaultValue : Integer) : Integer { - return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.x endif) -} - -helper labelOffsetY(viewmap : gmfgen::Viewmap, defaultValue : Integer) : Integer { - return let a = getLabelOffsetAttributes(viewmap) in (if null = a then defaultValue else a.y endif) -} |