Package org.eclipse.gef.examples.logicdesigner.model.commands

Examples of org.eclipse.gef.examples.logicdesigner.model.commands.AddCommand


 
  return clone;
}
 
protected Command createAddCommand(EditPart child, EditPart after) {
  AddCommand command = new AddCommand();
  command.setChild((LogicSubpart)child.getModel());
  command.setParent((LogicFlowContainer)getHost().getModel());
  int index = getHost().getChildren().indexOf(after);
  command.setIndex(index);
  return command;
}
View Full Code Here


protected Command createAddCommand(Request request, EditPart childEditPart,
    Object constraint) {
  LogicSubpart part = (LogicSubpart)childEditPart.getModel();
  Rectangle rect = (Rectangle)constraint;

  AddCommand add = new AddCommand();
  add.setParent((LogicDiagram)getHost().getModel());
  add.setChild(part);
  add.setLabel(LogicMessages.LogicXYLayoutEditPolicy_AddCommandLabelText);
  add.setDebugLabel("LogicXYEP add subpart");//$NON-NLS-1$

  SetConstraintCommand setConstraint = new SetConstraintCommand();
  setConstraint.setLocation(rect);
  setConstraint.setPart(part);
  setConstraint.setLabel(LogicMessages.LogicXYLayoutEditPolicy_AddCommandLabelText);
  setConstraint.setDebugLabel("LogicXYEP setConstraint");//$NON-NLS-1$
 
  Command cmd = add.chain(setConstraint);
  cmd = chainGuideAttachmentCommand(request, part, cmd, true);
  cmd = chainGuideAttachmentCommand(request, part, cmd, false);
  cmd = chainGuideDetachmentCommand(request, part, cmd, true);
  return chainGuideDetachmentCommand(request, part, cmd, false);
}
View Full Code Here

TOP

Related Classes of org.eclipse.gef.examples.logicdesigner.model.commands.AddCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.