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

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


  extends TreeContainerEditPolicy
{
 
protected Command createCreateCommand(LogicSubpart child, Rectangle r,
             int index, String label){
  CreateCommand cmd = new CreateCommand();
  Rectangle rect;
  if(r == null){
    rect = new Rectangle();
    rect.setSize(new Dimension(-1,-1));
  } else {
    rect = r;
  }
  cmd.setLocation(rect);
  cmd.setParent((LogicDiagram)getHost().getModel());
  cmd.setChild(child);
  cmd.setLabel(label);
  if(index >= 0)
    cmd.setIndex(index);
  return cmd;
}
View Full Code Here


  ReorderPartCommand command = new ReorderPartCommand(childModel, parentModel, newIndex);
  return command;
}

protected Command getCreateCommand(CreateRequest request) {
  CreateCommand command = new CreateCommand();
  EditPart after = getInsertionReference(request);
  command.setChild((LogicSubpart)request.getNewObject());
  command.setParent((LogicFlowContainer)getHost().getModel());
  int index = getHost().getChildren().indexOf(after);
  command.setIndex(index);
  return command;
}
View Full Code Here

  return clone;
}

protected Command getCreateCommand(CreateRequest request) {
  CreateCommand create = new CreateCommand();
  create.setParent((LogicDiagram)getHost().getModel());
  LogicSubpart newPart = (LogicSubpart)request.getNewObject();
  create.setChild(newPart);
  Rectangle constraint = (Rectangle)getConstraintFor(request);
  create.setLocation(constraint);
  create.setLabel(LogicMessages.LogicXYLayoutEditPolicy_CreateCommandLabelText);
 
  Command cmd = chainGuideAttachmentCommand(request, newPart, create, true);
  return chainGuideAttachmentCommand(request, newPart, cmd, false);
}
View Full Code Here

TOP

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

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.