/*
* Copyright (C) Yutaka Matsuno 2010-2012 All rights reserved.
*/
// AUTO_GENERATED:START
package net.dependableos.dcase.diagram.edit.parts;
import static net.dependableos.dcase.diagram.common.constant.SystemDefinitionConst.NODE_MARGIN_BOTTOM;
import static net.dependableos.dcase.diagram.common.constant.SystemDefinitionConst.NODE_MARGIN_LEFT;
import static net.dependableos.dcase.diagram.common.constant.SystemDefinitionConst.NODE_MARGIN_RIGHT;
import static net.dependableos.dcase.diagram.common.constant.SystemDefinitionConst.NODE_MARGIN_TOP;
import static net.dependableos.dcase.diagram.common.constant.SystemDefinitionConst.NODE_MARGIN_VERTICAL;
import java.util.ArrayList;
import java.util.List;
import net.dependableos.dcase.diagram.edit.parts.custom.CustomBorderLayout;
import net.dependableos.dcase.diagram.edit.parts.custom.CustomMultiLineFlowLayout;
import net.dependableos.dcase.diagram.edit.parts.custom.CustomWrappingLabel;
import net.dependableos.dcase.diagram.edit.parts.custom.DcaseNodeEditPart;
import net.dependableos.dcase.diagram.edit.policies.PolicyItemSemanticEditPolicy;
import net.dependableos.dcase.diagram.part.DcaseVisualIDRegistry;
import net.dependableos.dcase.diagram.providers.DcaseElementTypes;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.MouseEvent;
import org.eclipse.draw2d.MouseMotionListener;
import org.eclipse.draw2d.Panel;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.FlowLayoutEditPolicy;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.swt.graphics.Color;
/**
* @generated
*/
public class PolicyEditPart extends DcaseNodeEditPart {
/**
* @generated
*/
public static final int VISUAL_ID = 1009;
/**
* @generated
*/
protected IFigure contentPane;
/**
* @generated
*/
protected IFigure primaryShape;
/**
* @generated
*/
public PolicyEditPart(View view) {
super(view);
}
/**
* @generated
*/
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
new PolicyItemSemanticEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
}
/**
* @generated
*/
protected LayoutEditPolicy createLayoutEditPolicy() {
FlowLayoutEditPolicy lep = new FlowLayoutEditPolicy() {
protected Command createAddCommand(EditPart child, EditPart after) {
return null;
}
protected Command createMoveChildCommand(EditPart child,
EditPart after) {
return null;
}
protected Command getCreateCommand(CreateRequest request) {
return null;
}
};
return lep;
}
/**
* @generated
*/
protected IFigure createNodeShape() {
PolicyFigure figure = new PolicyFigure();
return primaryShape = figure;
}
/**
* @generated
*/
public PolicyFigure getPrimaryShape() {
return (PolicyFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof PolicyUserdef001EditPart) {
((PolicyUserdef001EditPart) childEditPart)
.setLabel(getPrimaryShape()
.getFigurePolicyUserdef001Figure());
return true;
}
if (childEditPart instanceof PolicyUserdef002EditPart) {
((PolicyUserdef002EditPart) childEditPart)
.setLabel(getPrimaryShape()
.getFigurePolicyUserdef002Figure());
return true;
}
if (childEditPart instanceof PolicyDescEditPart) {
((PolicyDescEditPart) childEditPart).setLabel(getPrimaryShape()
.getFigurePolicyDescFigure());
return true;
}
if (childEditPart instanceof PolicyNameEditPart) {
((PolicyNameEditPart) childEditPart).setLabel(getPrimaryShape()
.getFigurePolicyNameFigure());
return true;
}
if (childEditPart instanceof PolicyResponsibilityEditPart) {
((PolicyResponsibilityEditPart) childEditPart).setLabel(getPrimaryShape()
.getFigurePolicyResponsibilityFigure());
return true;
}
return false;
}
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
if (childEditPart instanceof PolicyUserdef001EditPart) {
return true;
}
if (childEditPart instanceof PolicyUserdef002EditPart) {
return true;
}
if (childEditPart instanceof PolicyDescEditPart) {
return true;
}
if (childEditPart instanceof PolicyNameEditPart) {
return true;
}
if (childEditPart instanceof PolicyResponsibilityEditPart) {
return true;
}
return false;
}
/**
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
}
/**
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
}
/**
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
return getContentPane();
}
/**
* @generated
*/
protected NodeFigure createNodePlate() {
DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
return result;
}
/**
* 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
*/
protected NodeFigure createNodeFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
contentPane = setupContentPane(shape);
return figure;
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
* @param nodeShape instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
}
return nodeShape; // use nodeShape itself as contentPane
}
/**
* @generated
*/
public IFigure getContentPane() {
if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
}
/**
* @generated
*/
protected void setForegroundColor(Color color) {
if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
/**
* @generated
*/
protected void setBackgroundColor(Color color) {
if (primaryShape != null) {
primaryShape.setBackgroundColor(color);
}
}
/**
* @generated
*/
protected void setLineWidth(int width) {
if (primaryShape instanceof Shape) {
((Shape) primaryShape).setLineWidth(width);
}
}
/**
* @generated
*/
protected void setLineType(int style) {
if (primaryShape instanceof Shape) {
((Shape) primaryShape).setLineStyle(style);
}
}
/**
* @generated
*/
public EditPart getPrimaryChildEditPart() {
return getChildBySemanticHint(DcaseVisualIDRegistry
.getType(PolicyNameEditPart.VISUAL_ID));
}
/**
* @generated
*/
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSource() {
List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
types.add(DcaseElementTypes.DcaseLink001_3001);
types.add(DcaseElementTypes.DcaseLink002_3002);
types.add(DcaseElementTypes.DcaseLink003_3003);
types.add(DcaseElementTypes.DcaseLink004_3004);
return types;
}
/**
* @generated
*/
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSourceAndTarget(
IGraphicalEditPart targetEditPart) {
List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
if (targetEditPart instanceof GoalEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof StrategyEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof EvidenceEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof MonitorEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof UndevelopedEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof ContextEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof JustificationEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof SystemEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof net.dependableos.dcase.diagram.edit.parts.PolicyEditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef001EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef002EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef003EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef004EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef005EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof Userdef006EditPart) {
types.add(DcaseElementTypes.DcaseLink001_3001);
}
if (targetEditPart instanceof GoalEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof StrategyEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof EvidenceEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof MonitorEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof UndevelopedEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof ContextEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof JustificationEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof SystemEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof net.dependableos.dcase.diagram.edit.parts.PolicyEditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef001EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef002EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef003EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef004EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef005EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof Userdef006EditPart) {
types.add(DcaseElementTypes.DcaseLink002_3002);
}
if (targetEditPart instanceof GoalEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof StrategyEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof EvidenceEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof MonitorEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof UndevelopedEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof ContextEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof JustificationEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof SystemEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof net.dependableos.dcase.diagram.edit.parts.PolicyEditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef001EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef002EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef003EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef004EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef005EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof Userdef006EditPart) {
types.add(DcaseElementTypes.DcaseLink003_3003);
}
if (targetEditPart instanceof GoalEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof StrategyEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof EvidenceEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof MonitorEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof UndevelopedEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof ContextEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof JustificationEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof SystemEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof net.dependableos.dcase.diagram.edit.parts.PolicyEditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef001EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef002EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef003EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef004EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef005EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
if (targetEditPart instanceof Userdef006EditPart) {
types.add(DcaseElementTypes.DcaseLink004_3004);
}
return types;
}
/**
* @generated
*/
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForTarget(
IElementType relationshipType) {
List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef003_1012);
}
return types;
}
/**
* @generated
*/
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnTarget() {
List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
types.add(DcaseElementTypes.DcaseLink001_3001);
types.add(DcaseElementTypes.DcaseLink002_3002);
types.add(DcaseElementTypes.DcaseLink003_3003);
types.add(DcaseElementTypes.DcaseLink004_3004);
return types;
}
/**
* @generated
*/
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForSource(
IElementType relationshipType) {
List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink001_3001) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink002_3002) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink003_3003) {
types.add(DcaseElementTypes.Userdef003_1012);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Goal_1001);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Evidence_1003);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Strategy_1002);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Context_1006);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Justification_1007);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef004_1013);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Undeveloped_1005);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef005_1014);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef006_1015);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Monitor_1004);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.System_1008);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Policy_1009);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef001_1010);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef002_1011);
}
if (relationshipType == DcaseElementTypes.DcaseLink004_3004) {
types.add(DcaseElementTypes.Userdef003_1012);
}
return types;
}
/**
* @generated NOT
*/
public class PolicyFigure extends Ellipse implements MouseMotionListener {
/**
* @generated NOT
*/
private CustomWrappingLabel fFigurePolicyNameFigure;
/**
* @generated NOT
*/
private CustomWrappingLabel fFigurePolicyUserdef001Figure;
/**
* @generated NOT
*/
private CustomWrappingLabel fFigurePolicyDescFigure;
/**
* @generated NOT
*/
private CustomWrappingLabel fFigurePolicyUserdef002Figure;
/**
* @generated NOT
*/
private WrappingLabel fFigurePolicyResponsibilityFigure;
/**
* @generated NOT
*/
public PolicyFigure() {
// creates a custom layout.
CustomBorderLayout layoutThis = new CustomBorderLayout();
layoutThis.setVerticalSpacing(NODE_MARGIN_VERTICAL);
// sets the padding ratio.
layoutThis.setPaddingRatio(0.8);
// sets the aspect ratio.
layoutThis.setAspectRatio(3, 2);
// stretches the Desc attribute area vertically to fill any space left over.
layoutThis.setStretchVertically(true);
this.setLayoutManager(layoutThis);
this.setLineWidth(1);
createContents();
// sets the margins.
MarginBorder border = new MarginBorder(NODE_MARGIN_TOP,
NODE_MARGIN_LEFT, NODE_MARGIN_BOTTOM, NODE_MARGIN_RIGHT);
setBorder(border);
}
/**
* @generated NOT
*/
private void createContents() {
// creates custom layout.
CustomMultiLineFlowLayout layoutTop = new CustomMultiLineFlowLayout();
layoutTop.setStretchMinorAxis(false);
layoutTop.setMinorAlignment(FlowLayout.ALIGN_LEFTTOP);
layoutTop.setMajorAlignment(FlowLayout.ALIGN_LEFTTOP);
layoutTop.setMajorSpacing(NODE_MARGIN_VERTICAL);
layoutTop.setMinorSpacing(0);
layoutTop.setHorizontal(true);
Panel panelTop = new Panel();
panelTop.setLayoutManager(layoutTop);
this.add(panelTop, BorderLayout.TOP);
fFigurePolicyNameFigure = new CustomWrappingLabel();
fFigurePolicyNameFigure.setText("");
panelTop.add(fFigurePolicyNameFigure);
fFigurePolicyUserdef001Figure = new CustomWrappingLabel();
fFigurePolicyUserdef001Figure.setText("");
fFigurePolicyUserdef001Figure.setVisible(false);
panelTop.add(fFigurePolicyUserdef001Figure);
fFigurePolicyDescFigure = new CustomWrappingLabel();
// sets the label text should wrap.
fFigurePolicyDescFigure.setTextWrap(true);
fFigurePolicyDescFigure.setText("[Undefined]");
this.add(fFigurePolicyDescFigure, BorderLayout.CENTER);
fFigurePolicyUserdef002Figure = new CustomWrappingLabel();
fFigurePolicyUserdef002Figure.setText("");
fFigurePolicyUserdef002Figure.setVisible(false);
this.add(fFigurePolicyUserdef002Figure, BorderLayout.BOTTOM);
fFigurePolicyResponsibilityFigure = new WrappingLabel();
fFigurePolicyResponsibilityFigure.setTextWrap(true);
fFigurePolicyResponsibilityFigure.setText(""); //$NON-NLS-1$
this.add(fFigurePolicyResponsibilityFigure, BorderLayout.RIGHT);
addMouseMotionListener(this);
}
/**
* @generated
*/
private boolean myUseLocalCoordinates = false;
/**
* @generated
*/
protected boolean useLocalCoordinates() {
return myUseLocalCoordinates;
}
/**
* @generated
*/
protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
myUseLocalCoordinates = useLocalCoordinates;
}
/**
* @generated
*/
public WrappingLabel getFigurePolicyNameFigure() {
return fFigurePolicyNameFigure;
}
/**
* @generated
*/
public WrappingLabel getFigurePolicyUserdef001Figure() {
return fFigurePolicyUserdef001Figure;
}
/**
* @generated
*/
public WrappingLabel getFigurePolicyDescFigure() {
return fFigurePolicyDescFigure;
}
/**
* @generated
*/
public WrappingLabel getFigurePolicyUserdef002Figure() {
return fFigurePolicyUserdef002Figure;
}
/**
* @generated NOT
*/
public WrappingLabel getFigurePolicyResponsibilityFigure() {
return fFigurePolicyResponsibilityFigure;
}
/**
* The function that mouse dragged event.
* @param arg0 the mouse event.
*/
@Override
public void mouseDragged(MouseEvent arg0) {
}
/**
* The function that mouse entered event.
* @param arg0 the mouse event.
*/
@Override
public void mouseEntered(MouseEvent arg0) {
fFigurePolicyNameFigure.setHighlightBGColor();
fFigurePolicyDescFigure.setHighlightBGColor();
fFigurePolicyUserdef001Figure.setHighlightBGColor();
fFigurePolicyUserdef002Figure.setHighlightBGColor();
}
/**
* The function that mouse exited event.
* @param arg0 the mouse event.
*/
@Override
public void mouseExited(MouseEvent arg0) {
fFigurePolicyNameFigure.setDefaultBGColor();
fFigurePolicyDescFigure.setDefaultBGColor();
fFigurePolicyUserdef001Figure.setDefaultBGColor();
fFigurePolicyUserdef002Figure.setDefaultBGColor();
}
/**
* The function that mouse hover event.
* @param arg0 the mouse event.
*/
@Override
public void mouseHover(MouseEvent arg0) {
}
/**
* The function that mouse moved event.
* @param arg0 the mouse event.
*/
@Override
public void mouseMoved(MouseEvent arg0) {
}
}
// AUTO_GENERATED:END
}