Examples of CreateCommand


Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

    return false;
  }
 
  public Command createAddPossibleChildrenCommand() {
    CompoundCommand compoundCmd = new CompoundCommand(getCompoundCommandName());
    CreateCommand createCmd = new CreateCommand();
    createCmd.setParent(this.parent);
    createCmd.setChild(this.child);
    compoundCmd.add(createCmd);
    return compoundCmd;
  }
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

  @Override
  protected Command getCreateCommand(CreateRequest request) {

    if (request.getType() == REQ_CREATE
        && getHost() instanceof MusicContainerEditPart) {
      CreateCommand cmd = new CreateCommand();
      cmd.setParent((MusicContainerForm) getHost().getModel());
      cmd.setChild((BasicElement) request.getNewObject());
      return cmd;
    }
    return null;
  }
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

    return true;
  }

  public Command createCloneCommand(BasicElement child, MusicContainerForm parent) {
    CompoundCommand compoundCmd = new CompoundCommand(ACTION_ID);
    CreateCommand createCmd = new CreateCommand();
    createCmd.setParent(parent);
    try {
      createCmd.setChild(child.getClass().newInstance());
      createCmd.setMeiNode((MeiNode) child.getMeiNode().clone());
    } catch (InstantiationException e) {
      LogService.error(e.getMessage(), e);
    } catch (IllegalAccessException e) {
      LogService.error(e.getMessage(), e);
    }
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

  return clone;
}

@Override
protected Command getCreateCommand(CreateRequest request) {
  CreateCommand create = new CreateCommand();
  create.setParent((MusicContainerForm)getHost().getModel());
  BasicElement newPart = (BasicElement)request.getNewObject();
  create.setChild(newPart);
  Rectangle constraint = (Rectangle)getConstraintFor(request);
  create.setLocation(constraint);
  create.setLabel(MusicMessages.MusicXYLayoutEditPolicy_CreateCommandLabelText);
  return create;
}
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

    return ACTION_ID;
  }

  private void insertCompoundCommand(MusicContainerForm parent,
      BasicElement child) {
    CreateCommand createCmd = new CreateCommand();
    createCmd.setParent(parent);
    createCmd.setChild(child);
    this.compoundCmd.add(createCmd);
  }
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

  extends TreeContainerEditPolicy
{
 
protected Command createCreateCommand(BasicElement 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((MusicContainerForm)getHost().getModel());
  cmd.setChild(child);
  cmd.setLabel(label);
  if(index >= 0)
    cmd.setIndex(index);
  return cmd;
}
View Full Code Here

Examples of info.textgrid.lab.noteeditor.commands.CreateCommand

    return ACTION_ID;
  }

  private void insertCompoundCommand(MusicContainerForm parent,
      BasicElement child) {
    CreateCommand createCmd = new CreateCommand();
    createCmd.setParent(parent);
    createCmd.setChild(child);
    this.compoundCmd.add(createCmd);
  }
View Full Code Here

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

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

  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

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

  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
Copyright © 2018 www.massapi.com. 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.