diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPartCN.java')
-rwxr-xr-x | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPartCN.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/PrimitiveTypeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPartCN.java index 3d2c8b9cfa5..3c318630c1d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src-gen/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeEditPartCN.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 */ @@ -97,6 +97,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void createDefaultEditPolicies() { installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); super.createDefaultEditPolicies(); @@ -105,19 +106,16 @@ public class PrimitiveTypeEditPartCN 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.PrimitiveTypeCanonicalEditPolicyCN()); + // 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.PrimitiveTypeCanonicalEditPolicyCN()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); installEditPolicy("RESIZE_BORDER_ITEMS", new ConstrainedItemBorderLayoutEditPolicy()); //$NON-NLS-1$ 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 @@ -171,9 +169,11 @@ public class PrimitiveTypeEditPartCN 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 @@ -182,7 +182,8 @@ public class PrimitiveTypeEditPartCN 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; } @@ -195,14 +196,17 @@ public class PrimitiveTypeEditPartCN 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; } @@ -216,28 +220,31 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { return true; } + if (childEditPart instanceof PrimitiveTypeAttributeCompartmentEditPartCN) { 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(((PrimitiveTypeAttributeCompartmentEditPartCN) childEditPart).getFigure()); return true; } if (childEditPart instanceof PrimitiveTypeOperationCompartmentEditPartCN) { 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(((PrimitiveTypeOperationCompartmentEditPartCN) 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; } @@ -259,8 +266,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { return true; } if (childEditPart instanceof RedefinableTemplateSignatureEditPart) { - getBorderedFigure().getBorderItemContainer() - .remove(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure()); + getBorderedFigure().getBorderItemContainer().remove(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure()); return true; } return false; @@ -269,6 +275,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void addChildVisual(EditPart childEditPart, int index) { if (addFixedChild(childEditPart)) { return; @@ -279,6 +286,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void removeChildVisual(EditPart childEditPart) { if (removeFixedChild(childEditPart)) { return; @@ -289,6 +297,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { if (editPart instanceof PrimitiveTypeAttributeCompartmentEditPartCN) { return getPrimaryShape().getAttributeCompartmentFigure(); @@ -305,6 +314,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof PrimitiveTypeFloatingNameEditPartCN) { IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); @@ -317,6 +327,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected NodeFigure createNodePlate() { RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(100, 50); return result; @@ -324,12 +335,13 @@ public class PrimitiveTypeEditPartCN 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()); @@ -338,9 +350,12 @@ public class PrimitiveTypeEditPartCN 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(); @@ -353,6 +368,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override public IFigure getContentPane() { if (contentPane != null) { return contentPane; @@ -363,6 +379,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void setForegroundColor(Color color) { if (primaryShape != null) { primaryShape.setForegroundColor(color); @@ -372,6 +389,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void setLineWidth(int width) { super.setLineWidth(width); } @@ -379,6 +397,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override protected void setLineType(int style) { if (primaryShape instanceof IPapyrusNodeFigure) { ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); @@ -388,6 +407,7 @@ public class PrimitiveTypeEditPartCN extends ClassifierEditPart { /** * @generated */ + @Override public EditPart getPrimaryChildEditPart() { return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPartCN.VISUAL_ID)); } @@ -395,18 +415,16 @@ public class PrimitiveTypeEditPartCN 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(PrimitiveTypeAttributeCompartmentEditPartCN.VISUAL_ID)); + return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeAttributeCompartmentEditPartCN.VISUAL_ID)); } if (UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_PrimitiveTypeOperationLabel)) { - return getChildBySemanticHint( - UMLVisualIDRegistry.getType(PrimitiveTypeOperationCompartmentEditPartCN.VISUAL_ID)); + return getChildBySemanticHint(UMLVisualIDRegistry.getType(PrimitiveTypeOperationCompartmentEditPartCN.VISUAL_ID)); } } return super.getTargetEditPart(request); |