Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2007-04-18 09:51:12 -0400
committerdstadnik2007-04-18 09:51:12 -0400
commit189074a5ea00acb80ee35656060d6ed53cf430dd (patch)
tree4681173afc90b3b2ba3a192ff3fb06777d7f5d20
parent82915cf5296a2d5ceea98e642cc2e5f6b6700751 (diff)
downloadorg.eclipse.gmf-tooling-189074a5ea00acb80ee35656060d6ed53cf430dd.tar.gz
org.eclipse.gmf-tooling-189074a5ea00acb80ee35656060d6ed53cf430dd.tar.xz
org.eclipse.gmf-tooling-189074a5ea00acb80ee35656060d6ed53cf430dd.zip
regenerated
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java2
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java2
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java18
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java18
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipGraphicalNodeEditPolicy.java (renamed from examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortGraphicalNodeEditPolicy.java)4
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java24
6 files changed, 61 insertions, 7 deletions
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
index 3512660e3..abb70052f 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
@@ -31,7 +31,6 @@ import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.ResizableEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.OpenDiagramEditPolicy;
-import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.PortGraphicalNodeEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.PortItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
@@ -79,7 +78,6 @@ public class PortEditPart extends AbstractBorderedShapeEditPart {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PortItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new PortGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
index 7b7a6251a..387d3f6b3 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
@@ -24,6 +24,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipGraphicalNodeEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
@@ -69,6 +70,7 @@ public class WarshipEditPart extends ShapeNodeEditPart {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new WarshipItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new WarshipGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java
index 7d472f9e0..d307db7ef 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java
@@ -74,7 +74,7 @@ public class PortItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
return req.getTarget() == null ? getCreateStartOutgoingRoute_4003Command(req) : getCreateCompleteIncomingRoute_4003Command(req);
}
if (TaiPanElementTypes.BesiegePortOrder_4005 == req.getElementType()) {
- return req.getTarget() == null ? null : getCreateCompleteIncomingBesiegePortOrder_4005Command(req);
+ return req.getTarget() == null ? getCreateStartIncomingBesiegePortOrder_4005Command(req) : getCreateCompleteIncomingBesiegePortOrder_4005Command(req);
}
if (TaiPanElementTypes.PortRegister_4007 == req.getElementType()) {
return req.getTarget() == null ? getCreateStartOutgoingPortRegister_4007Command(req) : getCreateCompleteOutgoingPortRegister_4007Command(req);
@@ -180,6 +180,22 @@ public class PortItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
/**
* @generated
*/
+ protected Command getCreateStartIncomingBesiegePortOrder_4005Command(CreateRelationshipRequest req) {
+ EObject targetEObject = req.getSource();
+ if (false == targetEObject instanceof Port) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Port target = (Port) targetEObject;
+ if (!TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreateBesiegePortOrder_4005(null, target)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ return new Command() {
+ };
+ }
+
+ /**
+ * @generated
+ */
protected Command getCreateCompleteIncomingBesiegePortOrder_4005Command(CreateRelationshipRequest req) {
EObject sourceEObject = req.getSource();
EObject targetEObject = req.getTarget();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java
index 442a5ac80..e7fabda48 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java
@@ -111,7 +111,7 @@ public class ShipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
return req.getTarget() == null ? getCreateStartOutgoingShipDestination_4001Command(req) : null;
}
if (TaiPanElementTypes.EscortShipsOrder_4006 == req.getElementType()) {
- return req.getTarget() == null ? null : getCreateCompleteIncomingEscortShipsOrder_4006Command(req);
+ return req.getTarget() == null ? getCreateStartIncomingEscortShipsOrder_4006Command(req) : getCreateCompleteIncomingEscortShipsOrder_4006Command(req);
}
if (TaiPanElementTypes.PortRegister_4007 == req.getElementType()) {
return req.getTarget() == null ? getCreateStartIncomingPortRegister_4007Command(req) : getCreateCompleteIncomingPortRegister_4007Command(req);
@@ -129,6 +129,22 @@ public class ShipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
/**
* @generated
*/
+ protected Command getCreateStartIncomingEscortShipsOrder_4006Command(CreateRelationshipRequest req) {
+ EObject targetEObject = req.getSource();
+ if (false == targetEObject instanceof Ship) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Ship target = (Ship) targetEObject;
+ if (!TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreateEscortShipsOrder_4006(null, target)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ return new Command() {
+ };
+ }
+
+ /**
+ * @generated
+ */
protected Command getCreateCompleteIncomingEscortShipsOrder_4006Command(CreateRelationshipRequest req) {
EObject sourceEObject = req.getSource();
EObject targetEObject = req.getTarget();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortGraphicalNodeEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipGraphicalNodeEditPolicy.java
index b48e0b278..052193b0c 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortGraphicalNodeEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipGraphicalNodeEditPolicy.java
@@ -38,14 +38,14 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType;
/**
* @generated
*/
-public class PortGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+public class WarshipGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
/**
* @generated
*/
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
IElementType elementType = getElementType(request);
- if (TaiPanElementTypes.PortRegister_4007 == elementType) {
+ if (TaiPanElementTypes.BesiegePortOrder_4005 == elementType) {
if (request.getSourceEditPart() != getHost()) {
return getConnectionWithReorientedViewCompleteCommand(request);
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java
index b70edc433..5ec5205bc 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java
@@ -15,9 +15,11 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.examples.taipan.Port;
import org.eclipse.gmf.examples.taipan.Ship;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
import org.eclipse.gmf.examples.taipan.Warship;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.commands.BesiegePortOrderCreateCommand;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.commands.BesiegePortOrderReorientCommand;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.commands.EscortShipsOrderCreateCommand;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.commands.EscortShipsOrderReorientCommand;
@@ -66,7 +68,7 @@ public class WarshipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPol
return req.getTarget() == null ? getCreateStartOutgoingEscortShipsOrder_4006Command(req) : getCreateCompleteIncomingEscortShipsOrder_4006Command(req);
}
if (TaiPanElementTypes.BesiegePortOrder_4005 == req.getElementType()) {
- return req.getTarget() == null ? getCreateStartOutgoingBesiegePortOrder_4005Command(req) : null;
+ return req.getTarget() == null ? getCreateStartOutgoingBesiegePortOrder_4005Command(req) : getCreateCompleteOutgoingBesiegePortOrder_4005Command(req);
}
if (TaiPanElementTypes.PortRegister_4007 == req.getElementType()) {
return req.getTarget() == null ? getCreateStartIncomingPortRegister_4007Command(req) : getCreateCompleteIncomingPortRegister_4007Command(req);
@@ -136,6 +138,26 @@ public class WarshipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPol
/**
* @generated
*/
+ protected Command getCreateCompleteOutgoingBesiegePortOrder_4005Command(CreateRelationshipRequest req) {
+ EObject sourceEObject = req.getTarget();
+ EObject targetEObject = req.getSource();
+ if (false == sourceEObject instanceof Warship || false == targetEObject instanceof Port) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Warship source = (Warship) sourceEObject;
+ Port target = (Port) targetEObject;
+ if (!TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreateBesiegePortOrder_4005(source, target)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (req.getContainmentFeature() == null) {
+ req.setContainmentFeature(TaiPanPackage.eINSTANCE.getWarship_AttackOrders());
+ }
+ return getGEFWrapper(new BesiegePortOrderCreateCommand(req, source, target));
+ }
+
+ /**
+ * @generated
+ */
protected Command getCreateStartIncomingPortRegister_4007Command(CreateRelationshipRequest req) {
return getGEFWrapper(new PortRegisterCreateCommand(req));
}

Back to the top