Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt302
1 files changed, 0 insertions, 302 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt
deleted file mode 100644
index 370d17c5bf0..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA) - initial API and implementation
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - Bug 335987 [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-«EXTENSION xpt::diagram::editparts::Utils»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::EMFUtils»
-«EXTENSION xpt::preferences::PrefsConstant»
-«EXTENSION aspects::impl::diagram::editparts::EditPartsUtils»
-
-«REM»-----«ENDREM»
-«REM» GMF «ENDREM»
-«REM»-----«ENDREM»
-
-
-
-«DEFINE extendsListContents FOR gmfgen::GenNode-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own extension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE-»
- «IF hasBorderItems(self)»org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart«ELSE»org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE extendsListContents FOR gmfgen::GenChildSideAffixedNode-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own eextension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE-»
- «IF hasBorderItems(self)»org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart«ELSE»org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE borderItemSelectionEP FOR gmfgen::GenNode-»
-new org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy() {
-
- protected java.util.List createSelectionHandles() {
- org.eclipse.gef.handles.MoveHandle mh = new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());
- mh.setBorder(null);
- return java.util.Collections.singletonList(mh);
- }
-}
-«ENDDEFINE»
-
-
-«AROUND addFixedChild FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean addFixedChild(org.eclipse.gef.EditPart childEditPart) {
-«FOREACH getInnerFixedLabels(self) AS label»«LET label.viewmap.oclAsType(gmfgen::ParentAssignedViewmap) AS childViewmap-»
- if (childEditPart instanceof «label.getEditPartQualifiedClassName()») {
- ((«label.getEditPartQualifiedClassName()») childEditPart).«EXPAND impl::diagram::editparts::TextAware::labelSetterName FOR childViewmap»(getPrimaryShape().«childViewmap.getterName»());
- return true;
- }
-«ENDLET»«ENDFOREACH-»
-
-«FOREACH getPinnedCompartments(self) AS compartment»«LET compartment.viewmap.oclAsType(gmfgen::ParentAssignedViewmap) AS childViewmap-»
-
- if (childEditPart instanceof «compartment.getEditPartQualifiedClassName()») {
- org.eclipse.draw2d.IFigure pane = getPrimaryShape().«childViewmap.getterName»();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((«compartment.getEditPartQualifiedClassName()») childEditPart).getFigure());
- return true;
- }
-«ENDLET»«ENDFOREACH-»
-
-«FOREACH getSideAffixedChildren(self) AS child-»
- «REM»BEGIN PapyrusGencode«ENDREM»
- «REM»adding IF else end in order to take in account the case where a specific locator is added«ENDREM»
- «IF papyrusgmfgenextension::SpecificLocator.allInstances()->select(v:papyrusgmfgenextension::SpecificLocator | v.genChildSideAffixedNode->includes(child))->size()<>0»
- «FOREACH papyrusgmfgenextension::SpecificLocator.allInstances()->select(v:papyrusgmfgenextension::SpecificLocator | v.genChildSideAffixedNode->includes(child)) AS extendedObject»
- «EXPAND genSpecificLocator(child) FOR extendedObject-»
- «ENDFOREACH-»
-
- «ELSE»
- «REM»END PapyrusGencode«ENDREM»
- if (childEditPart instanceof «child.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.«child.preferredSideName»);
- getBorderedFigure().getBorderItemContainer().add(((«child.getEditPartQualifiedClassName()») childEditPart).getFigure(), locator);
- return true;
- }
- «REM»BEGIN PapyrusGencode«ENDREM»
- «ENDIF»
- «REM»END PapyrusGencode«ENDREM»
-«ENDFOREACH-»
- return false;
- }
-
-«ENDAROUND»
-
-
-«AROUND createNodePlate FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
- String prefElementId="«elementType.displayName»";
- org.eclipse.jface.preference.IPreferenceStore store =«getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore();
- String preferenceConstantWitdh=org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.WIDTH);
- String preferenceConstantHeight=org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.HEIGHT);
- org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure result = new org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- «EXPAND setupNodePlate-»
- return result;
- }
-«ENDAROUND»
-«AROUND borderItemSelectionEditPolicy FOR gmfgen::GenNode-»
-«IF hasBorderItems(self)-»
-org.eclipse.gmf.runtime.notation.View childView = (org.eclipse.gmf.runtime.notation.View) child.getModel();
-switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(childView)) {
-«IF getExternalLabels(self)->size() > 0-»
-«FOREACH getExternalLabels(self) AS nextLabel-»
-«EXPAND xpt::Common::caseVisualID FOR nextLabel-»
-«ENDFOREACH-»
- return «EXPAND borderItemSelectionEP»;
-«ENDIF-»
-«IF getSideAffixedChildren(self)->size() > 0-»
-«FOREACH getSideAffixedChildren(self) AS nextBorderItem-»
-«EXPAND xpt::Common::caseVisualID FOR nextBorderItem-»
-«ENDFOREACH-»
- «REM»BEGIN PapyrusGenCode«ENDREM»
- «REM»The puRprose is to add replace GMF edit prolicy by an new editPolicy that allows to resize BorderItem«ENDREM»
- return new org.eclipse.papyrus.uml.diagram.common.editpolicies.BorderItemResizableEditPolicy();
- «REM»END PapyrusGenCode«ENDREM»
-«ENDIF-»
-}
-«ENDIF-»
-«ENDAROUND»
-
-«REM»---------«ENDREM»
-«REM» PAPYRUS «ENDREM»
-«REM»---------«ENDREM»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-
-«REM»BEGIN PapyrusGencode «ENDREM»
-«REM» Adding line of template to manange code thanks to a spcific locator«ENDREM»
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::GenCommonBase-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::ToolEntry-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::GenNavigatorChildReference-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR papyrusgmfgenextension::SpecificLocator-»
-//Papyrus Gencode :«self.comment»
- if (childEditPart instanceof «child.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new «self.classpath»(getMainFigure(), org.eclipse.draw2d.PositionConstants.«child.preferredSideName»);
- getBorderedFigure().getBorderItemContainer().add(((«child.getEditPartQualifiedClassName()») childEditPart).getFigure(), locator);
- return true;
- }
-
-«ENDDEFINE»
-«REM»END PapyrusGencode «ENDREM»
-
-«REM»BEGIN PapyrusGencode «ENDREM»
-«REM» Overwrite an existing method to set the preference value in the editpart«ENDREM»
-«DEFINE genPreferredValue FOR gmfgen::GenNode-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- @Override
- public Object getPreferredValue(org.eclipse.emf.ecore.EStructuralFeature feature) {
- org.eclipse.jface.preference.IPreferenceStore preferenceStore = (org.eclipse.jface.preference.IPreferenceStore) getDiagramPreferencesHint()
- .getPreferenceStore();
- Object result = null;
-
- if(feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFontStyle_FontColor() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_FillColor()){
- String prefColor = null;
- if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE);
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFontStyle_FontColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FONT);
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_FillColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL);
- }
- result = org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities
- .RGBToInteger(org.eclipse.jface.preference.PreferenceConverter
- .getColor(
- (org.eclipse.jface.preference.IPreferenceStore) preferenceStore, prefColor));
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Transparency() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Gradient()) {
- String prefGradient = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT);
- org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- preferenceStore.getString(prefGradient));
- if(feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Transparency()){
- result = new Integer(gradientPreferenceConverter
- .getTransparency());
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Gradient()){
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null){
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-«ENDDEFINE»
-«REM»END PapyrusGencode «ENDREM»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»CreateGenerator to refresh figure by taking account of event of UML element or graphical element «ENDREM»
-«DEFINE specificHandleNotificationEvent FOR gmfgen::GenNode-»
- «IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self))->size()<>0»
-/**
-*Papyrus codeGen
-*@generated
-**/
-protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
-«IF self.labels->exists(oclIsKindOf(gmfgen::GenExternalNodeLabel))-»
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- java.util.List<?> modelChildren = ((org.eclipse.gmf.runtime.notation.View)getModel()).getChildren();
- if(!(notifier instanceof org.eclipse.gmf.runtime.notation.Edge)) {
- if(modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- «ENDIF-»
- super.handleNotificationEvent(event);
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self)) AS extendedObject»
- «EXPAND specificHandleNotificationEventBody FOR extendedObject.propRefreshHook-»
- «ENDFOREACH-»
- }
- «ENDIF»
-
-«ENDDEFINE»
-
-«DEFINE specificHandleNotificationEventBody FOR papyrusgmfgenextension::PropertyRefreshHook-»
-//«self.comment»
-if (resolveSemanticElement() != null) {
-if(«self.triggeringCondition»){
- «self.action»;
- refreshVisuals();
-}
-}
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
-«DEFINE addBorderItem FOR gmfgen::GenNode-»
- «IF getExternalLabels(self)->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addBorderItem(org.eclipse.draw2d.IFigure borderItemContainer, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart borderItemEditPart) {
- «IF self.getExternalLabelsWithoutSpecificLocator()->size() > 0-»
- if («FOREACH self.getExternalLabelsWithoutSpecificLocator() AS label SEPARATOR ' || '»borderItemEditPart instanceof «label.getEditPartQualifiedClassName()»«ENDFOREACH») {
- org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.SOUTH);
- locator.setBorderItemOffset(new org.eclipse.draw2d.geometry.Dimension(-20, -20));
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- «ENDIF-»
- «FOREACH self.getExternalLabelsWithSpecificLocator() AS label-»
- if (borderItemEditPart instanceof «label.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new «label.getSpecificLocator()»(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- «ENDFOREACH-»
- {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setupNodePlate FOR gmfgen::GenNode»«ENDDEFINE»
-
-«DEFINE setupNodePlate FOR gmfgen::GenChildSideAffixedNode»
- //FIXME: workaround for #154536
- result.getBounds().setSize(result.getPreferredSize());
-«ENDDEFINE»

Back to the top