Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2007-04-19 05:55:42 -0400
committerdstadnik2007-04-19 05:55:42 -0400
commitf8b80cd908a218386f1e362801df4188d661bb94 (patch)
tree900ee397d23d4b8276ea0be7dbbb833fdfa75a31
parentaf4d02ed59eea063ce5fd7652a4129d2ae306acb (diff)
downloadorg.eclipse.gmf-tooling-f8b80cd908a218386f1e362801df4188d661bb94.tar.gz
org.eclipse.gmf-tooling-f8b80cd908a218386f1e362801df4188d661bb94.tar.xz
org.eclipse.gmf-tooling-f8b80cd908a218386f1e362801df4188d661bb94.zip
regenerated
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/PortRegisterCreateCommand.java17
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/ShipDestinationCreateCommand.java17
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortItemSemanticEditPolicy.java1
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipItemSemanticEditPolicy.java1
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipLargeCargoCanonicalEditPolicy.java28
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipSmallCargoCanonicalEditPolicy.java20
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/WarshipItemSemanticEditPolicy.java1
7 files changed, 46 insertions, 39 deletions
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/PortRegisterCreateCommand.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/PortRegisterCreateCommand.java
index d1aa7cb9b..c0b0a5204 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/PortRegisterCreateCommand.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/PortRegisterCreateCommand.java
@@ -50,10 +50,19 @@ public class PortRegisterCreateCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(source instanceof Port && (target == null || target instanceof Ship))) {
+ if (source == null && target == null) {
return false;
}
- return TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreatePortRegister_4007(getSource(), getTarget());
+ if (source != null && !(source instanceof Port)) {
+ return false;
+ }
+ if (target != null && !(target instanceof Ship)) {
+ return false;
+ }
+ if (getSource() != null && getTarget() != null) {
+ return TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreatePortRegister_4007(getSource(), getTarget());
+ }
+ return true; // link creation is in progress; only one end is defined
}
/**
@@ -63,10 +72,10 @@ public class PortRegisterCreateCommand extends EditElementCommand {
if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if (getTarget() != null) {
+ if (getSource() != null && getTarget() != null) {
getSource().getRegister().add(getTarget());
}
- return CommandResult.newOKCommandResult(getSource());
+ return CommandResult.newOKCommandResult();
}
/**
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/ShipDestinationCreateCommand.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/ShipDestinationCreateCommand.java
index 76678b88a..8d25899f2 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/ShipDestinationCreateCommand.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/commands/ShipDestinationCreateCommand.java
@@ -50,10 +50,19 @@ public class ShipDestinationCreateCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(source instanceof Ship && (target == null || target instanceof Port))) {
+ if (source == null && target == null) {
return false;
}
- return TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreateShipDestination_4001(getSource(), getTarget());
+ if (source != null && !(source instanceof Ship)) {
+ return false;
+ }
+ if (target != null && !(target instanceof Port)) {
+ return false;
+ }
+ if (getSource() != null && getTarget() != null) {
+ return TaiPanBaseItemSemanticEditPolicy.LinkConstraints.canCreateShipDestination_4001(getSource(), getTarget());
+ }
+ return true; // link creation is in progress; only one end is defined
}
/**
@@ -63,10 +72,10 @@ public class ShipDestinationCreateCommand extends EditElementCommand {
if (!canExecute()) {
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
- if (getTarget() != null) {
+ if (getSource() != null && getTarget() != null) {
getSource().setDestination(getTarget());
}
- return CommandResult.newOKCommandResult(getSource());
+ return CommandResult.newOKCommandResult();
}
/**
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 d307db7ef..c5a8160e6 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
@@ -224,6 +224,7 @@ public class PortItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
* @generated
*/
protected Command getCreateCompleteOutgoingPortRegister_4007Command(CreateRelationshipRequest req) {
+ req = new CreateRelationshipRequest(req.getEditingDomain(), req.getContainer(), req.getTarget(), req.getSource(), req.getElementType(), req.getContainmentFeature());
return getGEFWrapper(new PortRegisterCreateCommand(req));
}
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 e7fabda48..9a6f644e3 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
@@ -166,6 +166,7 @@ public class ShipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
* @generated
*/
protected Command getCreateStartIncomingPortRegister_4007Command(CreateRelationshipRequest req) {
+ req = new CreateRelationshipRequest(req.getEditingDomain(), req.getContainer(), req.getTarget(), req.getSource(), req.getElementType(), req.getContainmentFeature());
return getGEFWrapper(new PortRegisterCreateCommand(req));
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipLargeCargoCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipLargeCargoCanonicalEditPolicy.java
index 2811bf2de..3bb86b6c3 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipLargeCargoCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipLargeCargoCanonicalEditPolicy.java
@@ -36,22 +36,16 @@ public class ShipLargeCargoCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EObject modelObject = ((View) getHost().getModel()).getElement();
View viewObject = (View) getHost().getModel();
- EObject nextValue;
- int nodeVID;
- for (Iterator values = ((Ship) modelObject).getCargo().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
- nodeVID = TaiPanVisualIDRegistry.getNodeVisualID(viewObject, nextValue);
- switch (nodeVID) {
- case LargeItemEditPart.VISUAL_ID: {
+ Ship modelObject = (Ship) viewObject.getElement();
+ List allValues = new LinkedList();
+ allValues.addAll(modelObject.getCargo());
+ for (Iterator valuesIterator = allValues.iterator(); valuesIterator.hasNext();) {
+ EObject nextValue = (EObject) valuesIterator.next();
+ switch (TaiPanVisualIDRegistry.getNodeVisualID(viewObject, nextValue)) {
+ case LargeItemEditPart.VISUAL_ID:
+ case EmptyBoxEditPart.VISUAL_ID:
result.add(nextValue);
- break;
- }
- case EmptyBoxEditPart.VISUAL_ID: {
- result.add(nextValue);
- break;
- }
}
}
return result;
@@ -61,11 +55,7 @@ public class ShipLargeCargoCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
protected boolean shouldDeleteView(View view) {
- if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
- return view.isSetElement() && (view.getElement() == null || view.getElement().eIsProxy());
- }
- int nodeVID = TaiPanVisualIDRegistry.getVisualID(view);
- switch (nodeVID) {
+ switch (TaiPanVisualIDRegistry.getVisualID(view)) {
case LargeItemEditPart.VISUAL_ID:
case EmptyBoxEditPart.VISUAL_ID:
return true;
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipSmallCargoCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipSmallCargoCanonicalEditPolicy.java
index 927e88fe6..3ea41bc38 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipSmallCargoCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipSmallCargoCanonicalEditPolicy.java
@@ -35,14 +35,14 @@ public class ShipSmallCargoCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EObject modelObject = ((View) getHost().getModel()).getElement();
View viewObject = (View) getHost().getModel();
- EObject nextValue;
- int nodeVID;
- for (Iterator values = ((Ship) modelObject).getCargo().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
- nodeVID = TaiPanVisualIDRegistry.getNodeVisualID(viewObject, nextValue);
- if (SmallItemsEditPart.VISUAL_ID == nodeVID) {
+ Ship modelObject = (Ship) viewObject.getElement();
+ List allValues = new LinkedList();
+ allValues.addAll(modelObject.getCargo());
+ for (Iterator valuesIterator = allValues.iterator(); valuesIterator.hasNext();) {
+ EObject nextValue = (EObject) valuesIterator.next();
+ switch (TaiPanVisualIDRegistry.getNodeVisualID(viewObject, nextValue)) {
+ case SmallItemsEditPart.VISUAL_ID:
result.add(nextValue);
}
}
@@ -53,11 +53,7 @@ public class ShipSmallCargoCanonicalEditPolicy extends CanonicalEditPolicy {
* @generated
*/
protected boolean shouldDeleteView(View view) {
- if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
- return view.isSetElement() && (view.getElement() == null || view.getElement().eIsProxy());
- }
- int nodeVID = TaiPanVisualIDRegistry.getVisualID(view);
- switch (nodeVID) {
+ switch (TaiPanVisualIDRegistry.getVisualID(view)) {
case SmallItemsEditPart.VISUAL_ID:
return true;
}
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 5ec5205bc..8fbf8fec4 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
@@ -159,6 +159,7 @@ public class WarshipItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPol
* @generated
*/
protected Command getCreateStartIncomingPortRegister_4007Command(CreateRelationshipRequest req) {
+ req = new CreateRelationshipRequest(req.getEditingDomain(), req.getContainer(), req.getTarget(), req.getSource(), req.getElementType(), req.getContainmentFeature());
return getGEFWrapper(new PortRegisterCreateCommand(req));
}

Back to the top