diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java')
-rwxr-xr-x | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java | 78 |
1 files changed, 48 insertions, 30 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java index 4592dbb7cc1..b1f680f3e44 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPart.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2014 CEA LIST. - * + * * 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: * CEA LIST - Initial API and implementation */ @@ -96,6 +96,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void createDefaultEditPolicies() { installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); super.createDefaultEditPolicies(); @@ -104,18 +105,15 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); - //in Papyrus diagrams are not strongly synchronised - //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.clazz.edit.policies.PrimitiveTypeCanonicalEditPolicy()); + // in Papyrus diagrams are not strongly synchronised + // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.clazz.edit.policies.PrimitiveTypeCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomGraphicalNodeEditPolicy()); - installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, - new AppliedStereotypeNodeLabelDisplayEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy()); - installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, - new ShowHideCompartmentEditPolicy()); - installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, - new ShowHideClassifierContentsEditPolicy()); + installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); + installEditPolicy(ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY, new ShowHideClassifierContentsEditPolicy()); installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new ClassDiagramDragDropEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies @@ -169,9 +167,11 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { } /** - *Papyrus codeGen - *@generated - **/ + * Papyrus codeGen + * + * @generated + **/ + @Override protected void handleNotificationEvent(Notification event) { /* * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart @@ -180,7 +180,8 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) { Object notifier = event.getNotifier(); List<?> modelChildren = ((View) getModel()).getChildren(); - if (false == notifier instanceof Edge && false == notifier instanceof BasicCompartment) { + if (false == notifier instanceof Edge + && false == notifier instanceof BasicCompartment) { if (modelChildren.contains(event.getNotifier())) { return; } @@ -193,14 +194,17 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected IFigure createNodeShape() { return primaryShape = new PrimitiveTypeFigure(); } /** * org.eclipse.papyrus.uml.diagram.common.figure.node.PrimitiveTypeFigure + * * @generated */ + @Override public PrimitiveTypeFigure getPrimaryShape() { return (PrimitiveTypeFigure) primaryShape; } @@ -214,28 +218,31 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { return true; } + if (childEditPart instanceof PrimitiveTypeAttributeCompartmentEditPart) { IFigure pane = getPrimaryShape().getAttributeCompartmentFigure(); - setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way + setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way pane.add(((PrimitiveTypeAttributeCompartmentEditPart) childEditPart).getFigure()); return true; } if (childEditPart instanceof PrimitiveTypeOperationCompartmentEditPart) { IFigure pane = getPrimaryShape().getOperationCompartmentFigure(); - setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way + setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way pane.add(((PrimitiveTypeOperationCompartmentEditPart) childEditPart).getFigure()); return true; } - //Papyrus Gencode :precise the locator for a template signature + + + // Papyrus Gencode :precise the locator for a template signature if (childEditPart instanceof RedefinableTemplateSignatureEditPart) { IBorderItemLocator locator = new TemplateBorderItemLocator(getMainFigure(), PositionConstants.EAST); - getBorderedFigure().getBorderItemContainer() - .add(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure(), locator); + getBorderedFigure().getBorderItemContainer().add(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure(), locator); return true; } + return false; } @@ -257,8 +264,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { return true; } if (childEditPart instanceof RedefinableTemplateSignatureEditPart) { - getBorderedFigure().getBorderItemContainer() - .remove(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure()); + getBorderedFigure().getBorderItemContainer().remove(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure()); return true; } return false; @@ -267,6 +273,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void addChildVisual(EditPart childEditPart, int index) { if (addFixedChild(childEditPart)) { return; @@ -277,6 +284,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void removeChildVisual(EditPart childEditPart) { if (removeFixedChild(childEditPart)) { return; @@ -287,6 +295,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { if (editPart instanceof PrimitiveTypeAttributeCompartmentEditPart) { return getPrimaryShape().getAttributeCompartmentFigure(); @@ -303,6 +312,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof PrimitiveTypeFloatingNameEditPart) { IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); @@ -315,6 +325,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected NodeFigure createNodePlate() { RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(100, 50); return result; @@ -322,12 +333,13 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * Creates figure for this edit part. - * + * * Body of this method does not depend on settings in generation model * so you may safely remove <i>generated</i> tag and modify it. - * + * * @generated */ + @Override protected NodeFigure createMainFigure() { return new SelectableBorderedNodeFigure(createMainFigureWithSVG()); @@ -336,9 +348,12 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * Default implementation treats passed figure as content pane. * Respects layout one may have set for generated figure. - * @param nodeShape instance of generated figure class + * + * @param nodeShape + * instance of generated figure class * @generated */ + @Override protected IFigure setupContentPane(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); @@ -351,6 +366,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override public IFigure getContentPane() { if (contentPane != null) { return contentPane; @@ -361,6 +377,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void setForegroundColor(Color color) { if (primaryShape != null) { primaryShape.setForegroundColor(color); @@ -370,6 +387,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void setLineWidth(int width) { super.setLineWidth(width); } @@ -377,6 +395,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override protected void setLineType(int style) { if (primaryShape instanceof IPapyrusNodeFigure) { ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); @@ -386,6 +405,7 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override public EditPart getPrimaryChildEditPart() { return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPart.VISUAL_ID)); } @@ -393,18 +413,16 @@ public class PrimitiveTypeEditPart extends ClassifierEditPart { /** * @generated */ + @Override public EditPart getTargetEditPart(Request request) { if (request instanceof CreateViewAndElementRequest) { - CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor() - .getCreateElementRequestAdapter(); + CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter(); IElementType type = (IElementType) adapter.getAdapter(IElementType.class); if (UMLElementTypes.isKindOf(type, UMLElementTypes.Property_PrimitiveTypeAttributeLabel)) { - return getChildBySemanticHint( - UMLVisualIDRegistry.getType(PrimitiveTypeAttributeCompartmentEditPart.VISUAL_ID)); + return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeAttributeCompartmentEditPart.VISUAL_ID)); } if (UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_PrimitiveTypeOperationLabel)) { - return getChildBySemanticHint( - UMLVisualIDRegistry.getType(PrimitiveTypeOperationCompartmentEditPart.VISUAL_ID)); + return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeOperationCompartmentEditPart.VISUAL_ID)); } } return super.getTargetEditPart(request); |