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

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


public class WireBendpointEditPolicy
  extends org.eclipse.gef.editpolicies.BendpointEditPolicy
{

protected Command getCreateBendpointCommand(BendpointRequest request) {
  CreateBendpointCommand com = new CreateBendpointCommand();
  Point p = request.getLocation();
  Connection conn = getConnection();
 
  conn.translateToRelative(p);
 
  com.setLocation(p);
  Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
  Point ref2 = getConnection().getTargetAnchor().getReferencePoint();
 
  conn.translateToRelative(ref1);
  conn.translateToRelative(ref2);
 
 
  com.setRelativeDimensions(p.getDifference(ref1),
          p.getDifference(ref2));
  com.setWire((Wire)request.getSource().getModel());
  com.setIndex(request.getIndex());
  return com;
}
View Full Code Here

TOP

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

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.