Package info.textgrid.lab.noteeditor.commands

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


  @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

    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

  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

    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

  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

    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

TOP

Related Classes of info.textgrid.lab.noteeditor.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.