예제 #1
0
 /** @see org.eclipse.gef.commands.Command#execute() */
 public void execute() {
   oldSource.removeOutput(transition);
   oldTarget.removeInput(transition);
   parent.addChild(newActivity);
   newIncomingTransition = new Transition(oldSource, newActivity);
   newOutgoingTransition = new Transition(newActivity, oldTarget);
 }
예제 #2
0
 /** @see org.eclipse.gef.commands.Command#undo() */
 public void undo() {
   oldSource.removeOutput(newIncomingTransition);
   oldTarget.removeInput(newOutgoingTransition);
   newActivity.removeInput(newIncomingTransition);
   newActivity.removeOutput(newOutgoingTransition);
   parent.removeChild(newActivity);
   oldSource.addOutput(transition);
   oldTarget.addInput(transition);
 }
예제 #3
0
 /**
  * Sets the Activity to be added.
  *
  * @param activity the new activity
  */
 public void setNewActivity(Activity activity) {
   newActivity = activity;
   newActivity.setName("a " + (parent.getChildren().size() + 1));
 }