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

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


  PolylineConnection conn = FigureFactory.createNewWire(null);
  return conn;
}

protected Command getConnectionCompleteCommand(CreateConnectionRequest request) { 
  ConnectionCommand command = (ConnectionCommand)request.getStartCommand();
  command.setTarget(getLogicSubpart());
  ConnectionAnchor ctor = getLogicEditPart().getTargetConnectionAnchor(request);
  if (ctor == null)
    return null;
  command.setTargetTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  return command;
}
View Full Code Here


  command.setTargetTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  return command;
}

protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
  ConnectionCommand command = new ConnectionCommand();
  command.setWire(new Wire());
  command.setSource(getLogicSubpart());
  ConnectionAnchor ctor = getLogicEditPart().getSourceConnectionAnchor(request);
  command.setSourceTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  request.setStartCommand(command);
  return command;
}
View Full Code Here

protected Command getReconnectTargetCommand(ReconnectRequest request) {
  if (getLogicSubpart() instanceof LiveOutput ||
    getLogicSubpart() instanceof GroundOutput)
      return null;
 
  ConnectionCommand cmd = new ConnectionCommand();
  cmd.setWire((Wire)request.getConnectionEditPart().getModel());

  ConnectionAnchor ctor = getLogicEditPart().getTargetConnectionAnchor(request);
  cmd.setTarget(getLogicSubpart());
  cmd.setTargetTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  return cmd;
}
View Full Code Here

  cmd.setTargetTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  return cmd;
}

protected Command getReconnectSourceCommand(ReconnectRequest request) {
  ConnectionCommand cmd = new ConnectionCommand();
  cmd.setWire((Wire)request.getConnectionEditPart().getModel());

  ConnectionAnchor ctor = getLogicEditPart().getSourceConnectionAnchor(request);
  cmd.setSource(getLogicSubpart());
  cmd.setSourceTerminal(getLogicEditPart().mapConnectionAnchorToTerminal(ctor));
  return cmd;
}
View Full Code Here

public class WireEditPolicy
  extends org.eclipse.gef.editpolicies.ConnectionEditPolicy
{

protected Command getDeleteCommand(GroupRequest request) {
  ConnectionCommand c = new ConnectionCommand();
  c.setWire((Wire)getHost().getModel());
  return c;
}
View Full Code Here

TOP

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

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.