Java 类org.eclipse.gef.requests.BendpointRequest 实例源码

项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointMoveCommand cmd = new BendpointMoveCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setIndex(request.getIndex());
    cmd.setNewLocation(p);
    return cmd;
}
项目:bdf2    文件:ConnectionBendpointEditPolicy.java   
protected Command getCreateBendpointCommand(BendpointRequest request) {
    CreateBendpointCommand com = new CreateBendpointCommand();
    Point p = request.getLocation();
    conn = getConnection();
    conn.translateToRelative(p);
    com.setLocation(p);
    Point ref1 = conn.getSourceAnchor().getReferencePoint();
    Point ref2 = conn.getTargetAnchor().getReferencePoint();

    conn.translateToRelative(ref1);
    conn.translateToRelative(ref2);

    com.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    com.setConn((Connection) request.getSource().getModel());
    com.setIndex(request.getIndex());
    return com;
}
项目:bdf2    文件:ConnectionBendpointEditPolicy.java   
protected Command getMoveBendpointCommand(BendpointRequest request) {
    MoveBendpointCommand com = new MoveBendpointCommand();
    Point p = request.getLocation();
    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.setConn((Connection) request.getSource().getModel());
    com.setIndex(request.getIndex());
    return com;
}
项目:ermasterr    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(final BendpointRequest bendpointrequest) {
    final AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) getHost();
    final ConnectionElement connection = (ConnectionElement) connectionEditPart.getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    final Point point = bendpointrequest.getLocation();
    getConnection().translateToRelative(point);

    final CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
项目:ermaster-k    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(
        BendpointRequest bendpointrequest) {
    AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) this
            .getHost();
    ConnectionElement connection = (ConnectionElement) connectionEditPart
            .getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    Point point = bendpointrequest.getLocation();
    this.getConnection().translateToRelative(point);

    CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(
            this.diagram.getCurrentCategory(),
            connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
项目:NEXCORE-UML-Modeler    文件:SequenceBendpointEditPolicy.java   
/**
 * setReferencePoints
 *  
 * @param request void
 */
private void setReferencePoints(BendpointRequest request) {
    PointList points = getConnection().getPoints();
    int bpIndex = -1;
    List bendPoints = (List)getConnection().getRoutingConstraint();
    Point bp = ((Bendpoint)bendPoints.get(request.getIndex())).getLocation();

    int smallestDistance = -1;

    for (int i = 0; i < points.size(); i++) {
        if (smallestDistance == -1
                || points.getPoint(i).getDistance2(bp) < smallestDistance) {
            bpIndex = i;
            smallestDistance = points.getPoint(i).getDistance2(bp);
            if (smallestDistance == 0)
                break;
        }
    }

    points.getPoint(ref1, bpIndex - 1);
    getConnection().translateToAbsolute(ref1);
    points.getPoint(ref2, bpIndex + 1);
    getConnection().translateToAbsolute(ref2);
}
项目:NEXCORE-UML-Modeler    文件:SequenceBendpointEditPolicy.java   
/**
 * Shows feedback when a bendpoint is being created.  The original figure is used for
 * feedback and the original constraint is saved, so that it can be restored when feedback
 * is erased.
 * @param request the BendpointRequest
 */
protected void showCreateBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    List constraint;
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    if (originalConstraint == null) {
        saveOriginalConstraint();
        constraint = (List)getConnection().getRoutingConstraint();
        constraint.add(request.getIndex(), bp);
    } else {
        constraint = (List)getConnection().getRoutingConstraint();
    }
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
项目:NEXCORE-UML-Modeler    文件:SequenceBendpointEditPolicy.java   
/**
 * Shows feedback when a bendpoint is being moved.  Also checks to see if the bendpoint 
 * should be deleted and then calls {@link #showDeleteBendpointFeedback(BendpointRequest)}
 * if needed.  The original figure is used for feedback and the original constraint is 
 * saved, so that it can be restored when feedback is erased.
 * @param request the BendpointRequest
 */
protected void showMoveBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    if (!isDeleting)
        setReferencePoints(request);

    if (lineContainsPoint(ref1, ref2, p)) {
        if (!isDeleting) {
            isDeleting = true;
            eraseSourceFeedback(request);
            showDeleteBendpointFeedback(request);
        }
        return;
    }
    if (isDeleting) {
        isDeleting = false;
        eraseSourceFeedback(request);
    }
    if (originalConstraint == null)
        saveOriginalConstraint();
    List constraint = (List)getConnection().getRoutingConstraint();
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
项目:NEXCORE-UML-Modeler    文件:MessageBendpointEditPolicy.java   
/**
 * @see org.eclipse.gef.editpolicies.BendpointEditPolicy#showCreateBendpointFeedback(org.eclipse.gef.requests.BendpointRequest)
 */
@Override
protected void showCreateBendpointFeedback(BendpointRequest request) {

    IFigure feedback = getDragSourceFeedbackFigure();

    Rectangle bounds = new Rectangle(getInitialFeedbackBounds().getCopy());
    PrecisionRectangle rect = new PrecisionRectangle(bounds);
    getHostFigure().translateToAbsolute(rect);
    Point movePoint = request.getLocation();

    movePoint.x = ((GraphicalEditPart) getHost()).getFigure().getBounds().x;//movePoint.x - rect.getSize().width / 2;
    rect.setLocation(movePoint);
    feedback.translateToRelative(rect);
    feedback.setBounds(rect);
}
项目:erflute    文件:ERDiagramBendpointEditPolicy.java   
@Override
protected Command getCreateBendpointCommand(BendpointRequest bendpointrequest) {
    final AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) getHost();
    final WalkerConnection connection = (WalkerConnection) connectionEditPart.getModel();

    if (connection.getSourceWalker() == connection.getTargetWalker()) {
        return null;
    }

    final Point point = bendpointrequest.getLocation();
    getConnection().translateToRelative(point);

    final CreateBendpointCommand createBendpointCommand =
            new CreateBendpointCommand(connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
项目:ermaster-nhit    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(
        BendpointRequest bendpointrequest) {
    AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) this
            .getHost();
    ConnectionElement connection = (ConnectionElement) connectionEditPart
            .getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    Point point = bendpointrequest.getLocation();
    this.getConnection().translateToRelative(point);

    CreateBendpointCommand createBendpointCommand = new CreateBendpointCommand(
            connection, point.x, point.y, bendpointrequest.getIndex());

    return createBendpointCommand;
}
项目:gef-gwt    文件:BendpointEditPolicy.java   
private void setReferencePoints(BendpointRequest request) {
    PointList points = getConnection().getPoints();
    int bpIndex = -1;
    List bendPoints = (List) getConnection().getRoutingConstraint();
    Point bp = ((Bendpoint) bendPoints.get(request.getIndex()))
            .getLocation();

    int smallestDistance = -1;

    for (int i = 0; i < points.size(); i++) {
        if (smallestDistance == -1
                || points.getPoint(i).getDistance2(bp) < smallestDistance) {
            bpIndex = i;
            smallestDistance = points.getPoint(i).getDistance2(bp);
            if (smallestDistance == 0)
                break;
        }
    }

    points.getPoint(ref1, bpIndex - 1);
    getConnection().translateToAbsolute(ref1);
    points.getPoint(ref2, bpIndex + 1);
    getConnection().translateToAbsolute(ref2);
}
项目:gef-gwt    文件:BendpointEditPolicy.java   
/**
 * Shows feedback when a bendpoint is being created. The original figure is
 * used for feedback and the original constraint is saved, so that it can be
 * restored when feedback is erased.
 * 
 * @param request
 *            the BendpointRequest
 */
protected void showCreateBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    List constraint;
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    if (originalConstraint == null) {
        saveOriginalConstraint();
        constraint = (List) getConnection().getRoutingConstraint();
        constraint.add(request.getIndex(), bp);
    } else {
        constraint = (List) getConnection().getRoutingConstraint();
    }
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
项目:gef-gwt    文件:BendpointEditPolicy.java   
/**
 * Shows feedback when a bendpoint is being moved. Also checks to see if the
 * bendpoint should be deleted and then calls
 * {@link #showDeleteBendpointFeedback(BendpointRequest)} if needed. The
 * original figure is used for feedback and the original constraint is
 * saved, so that it can be restored when feedback is erased.
 * 
 * @param request
 *            the BendpointRequest
 */
protected void showMoveBendpointFeedback(BendpointRequest request) {
    Point p = new Point(request.getLocation());
    if (!isDeleting)
        setReferencePoints(request);

    if (lineContainsPoint(ref1, ref2, p)) {
        if (!isDeleting) {
            isDeleting = true;
            eraseSourceFeedback(request);
            showDeleteBendpointFeedback(request);
        }
        return;
    }
    if (isDeleting) {
        isDeleting = false;
        eraseSourceFeedback(request);
    }
    if (originalConstraint == null)
        saveOriginalConstraint();
    List constraint = (List) getConnection().getRoutingConstraint();
    getConnection().translateToRelative(p);
    Bendpoint bp = new AbsoluteBendpoint(p);
    constraint.set(request.getIndex(), bp);
    getConnection().setRoutingConstraint(constraint);
}
项目:FRaMED    文件:ORMRelationBendpointEditPolicy.java   
/**
 * This method creats and returns a command for changing the position of a {@link Bendpoint}.
 * 
 * @return {@link ORMRelationMoveBendpointCommand}
 */
@Override
protected Command getMoveBendpointCommand(final BendpointRequest request) {
  final ORMRelationMoveBendpointCommand command = new ORMRelationMoveBendpointCommand();

  Point p = request.getLocation();
  Connection conn = getConnection();

  conn.translateToRelative(p);
  Point sourceP = conn.getSourceAnchor().getReferencePoint();
  Point targetP = conn.getTargetAnchor().getReferencePoint();

  conn.translateToRelative(sourceP);
  conn.translateToRelative(targetP);

  command.setRelation((Relation) request.getSource().getModel());
  command.setNewDimension(p.getDifference(sourceP), p.getDifference(targetP));
  command.setIndex(request.getIndex());

  return command;
}
项目:wt-studio    文件:ConnectionBendPointEditPolicy.java   
protected Command getCreateBendpointCommand(BendpointRequest request) {
    CreateBendpointCommand cmd = new CreateBendpointCommand();
    Point p = request.getLocation();
    Connection conn = (Connection) getConnection();

     conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

     conn.translateToRelative(ref1);
     conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((com.wt.studio.plugin.modeldesigner.editor.model.NodeConnection) request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:wt-studio    文件:ConnectionBendPointEditPolicy.java   
protected Command getMoveBendpointCommand(BendpointRequest request) {
    MoveBendpointCommand cmd = new MoveBendpointCommand();
    Point p = request.getLocation();
    Connection conn = getConnection();

    conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

    conn.translateToRelative(ref1);
    conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((com.wt.studio.plugin.modeldesigner.editor.model.NodeConnection) request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:wt-studio    文件:ConnectionBendPointEditPolicy.java   
protected Command getCreateBendpointCommand(BendpointRequest request) {
    CreateBendpointCommand cmd = new CreateBendpointCommand();
    Point p = request.getLocation();
    Connection conn = (Connection) getConnection();

     conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

     conn.translateToRelative(ref1);
     conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((ColumnConnection)request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:wt-studio    文件:ConnectionBendPointEditPolicy.java   
protected Command getMoveBendpointCommand(BendpointRequest request) {
    MoveBendpointCommand cmd = new MoveBendpointCommand();
    Point p = request.getLocation();
    Connection conn = getConnection();

    conn.translateToRelative(p);

    Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
    Point ref2 = getConnection().getTargetAnchor().getReferencePoint();

    conn.translateToRelative(ref1);
    conn.translateToRelative(ref2);

    cmd.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
    cmd.setConnection((ColumnConnection) request.getSource()
            .getModel());
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointCreateCommand cmd = new BendpointCreateCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointDeleteCommand cmd = new BendpointDeleteCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointCreateCommand cmd = new BendpointCreateCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointDeleteCommand cmd = new BendpointDeleteCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointMoveCommand cmd = new BendpointMoveCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setIndex(request.getIndex());
    cmd.setNewLocation(p);
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointCreateCommand cmd = new BendpointCreateCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointDeleteCommand cmd = new BendpointDeleteCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setLocation(p);
    cmd.setIndex(request.getIndex());
    return cmd;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:BendpointPolicy.java   
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
    Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
    Point viewSize = vp.getViewLocation();
    Point p = request.getLocation();
    p.setX(p.x + viewSize.x);
    p.setY(p.y + viewSize.y);
    BendpointMoveCommand cmd = new BendpointMoveCommand();
    cmd.setLink((Link) request.getSource().getModel());
    cmd.setIndex(request.getIndex());
    cmd.setNewLocation(p);
    return cmd;
}
项目:gw4e.project    文件:GW4ELinkBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getCreateBendpointCommand(final BendpointRequest request) {
    LinkCreateBendpointCommand command = new LinkCreateBendpointCommand();
    Point p = request.getLocation();
    command.setLink((GWLink) request.getSource().getModel());
    command.setLocation(p);
    command.setIndex(request.getIndex());
    return command;
}
项目:gw4e.project    文件:GW4ELinkBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getMoveBendpointCommand(final BendpointRequest request) {
    LinkMoveBendpointCommand command = new LinkMoveBendpointCommand();
    Point p = request.getLocation();
    command.setLink((GWLink) request.getSource().getModel());
    command.setLocation(p);
    command.setIndex(request.getIndex());
    return command;
}
项目:gw4e.project    文件:GW4ELinkBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getDeleteBendpointCommand(final BendpointRequest request) {
    LinkDeleteBendpointCommand command = new LinkDeleteBendpointCommand();

    command.setLink((GWLink) request.getSource().getModel());
    command.setIndex(request.getIndex());
    return command;
}
项目:bdf2    文件:TransitionBendpointEditPolicy.java   
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
    CreateBendpointCommand command=new CreateBendpointCommand();
    Point point = request.getLocation();
    int index=request.getIndex();
    Transition transition=(Transition)getHost().getModel();
    command.setIndex(index);
    command.setPoint(point);
    command.setTransition(transition);
    return command;
}
项目:bdf2    文件:TransitionBendpointEditPolicy.java   
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
    DeleteBendpointCommand command=new DeleteBendpointCommand();
    int index=request.getIndex();
    Transition transition=(Transition)getHost().getModel();
    command.setIndex(index);
    command.setTransition(transition);
    return command;
}
项目:bdf2    文件:TransitionBendpointEditPolicy.java   
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
    MoveBendpointCommand command=new MoveBendpointCommand();
    Point point = request.getLocation();
    int index=request.getIndex();
    Transition transition=(Transition)getHost().getModel();
    command.setIndex(index);
    command.setPoint(point);
    command.setTransition(transition);
    return command;
}
项目:bdf2    文件:ConnectionBendpointEditPolicy.java   
protected Command getDeleteBendpointCommand(BendpointRequest request) {
    BaseBendpointCommand com = new DeleteBendpointCommand();
    Point p = request.getLocation();
    com.setLocation(p);
    com.setConn((Connection) request.getSource().getModel());
    com.setIndex(request.getIndex());
    return com;
}
项目:ermasterr    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getDeleteBendpointCommand(final BendpointRequest bendpointrequest) {
    final ConnectionElement connection = (ConnectionElement) getHost().getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    final DeleteBendpointCommand command = new DeleteBendpointCommand(connection, bendpointrequest.getIndex());

    return command;
}
项目:ermasterr    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getMoveBendpointCommand(final BendpointRequest bendpointrequest) {
    final ConnectionEditPart editPart = (ConnectionEditPart) getHost();

    final Point point = bendpointrequest.getLocation();
    getConnection().translateToRelative(point);

    final MoveBendpointCommand command = new MoveBendpointCommand(editPart, point.x, point.y, bendpointrequest.getIndex());

    return command;
}
项目:ermasterr    文件:RelationBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected void showCreateBendpointFeedback(final BendpointRequest bendpointrequest) {
    final Relation relation = (Relation) getHost().getModel();

    if (relation.getSource() == relation.getTarget()) {
        return;
    }
    super.showCreateBendpointFeedback(bendpointrequest);
}
项目:ermaster-k    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getDeleteBendpointCommand(
        BendpointRequest bendpointrequest) {
    ConnectionElement connection = (ConnectionElement) getHost().getModel();

    if (connection.getSource() == connection.getTarget()) {
        return null;
    }

    DeleteBendpointCommand command = new DeleteBendpointCommand(
            diagram, connection, bendpointrequest.getIndex());

    return command;
}
项目:ermaster-k    文件:ERDiagramBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected Command getMoveBendpointCommand(BendpointRequest bendpointrequest) {
    ConnectionEditPart editPart = (ConnectionEditPart) this.getHost();

    Point point = bendpointrequest.getLocation();
    this.getConnection().translateToRelative(point);

    MoveBendpointCommand command = new MoveBendpointCommand(
            diagram, editPart, point.x, point.y, bendpointrequest.getIndex());

    return command;
}
项目:ermaster-k    文件:RelationBendpointEditPolicy.java   
/**
 * {@inheritDoc}
 */
@Override
protected void showCreateBendpointFeedback(BendpointRequest bendpointrequest) {
    Relation relation = (Relation) getHost().getModel();

    if (relation.getSource() == relation.getTarget()) {
        return;
    }
    super.showCreateBendpointFeedback(bendpointrequest);
}