Java 类org.eclipse.draw2d.MidpointLocator 实例源码

项目:neoscada    文件:RoundDetailsPart.java   
private void createRoundArrow ( final Figure figure )
{
    final PolylineConnection c = new PolylineConnection ();
    c.setSourceAnchor ( new ChopboxAnchor ( this.sourceRect ) );
    c.setTargetAnchor ( new ChopboxAnchor ( this.targetRect ) );

    final PolygonDecoration dec = new PolygonDecoration ();
    dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
    c.setTargetDecoration ( dec );

    final MidpointLocator typeLocator = new MidpointLocator ( c, 0 );
    typeLocator.setRelativePosition ( PositionConstants.NORTH );
    this.typeLabel = new Label ( "" ); //$NON-NLS-1$
    c.add ( this.typeLabel, typeLocator );

    figure.add ( c );
    this.roundConnection = c;
}
项目:gw4e.project    文件:EdgeFigure.java   
public EdgeFigure() {
    tooltipFigure = new TooltipFigure();
    setToolTip(tooltipFigure);

    this.setLineWidth(this.getLineWidth() * 2);

    this.setTargetDecoration(new PolylineDecoration());

    label = new Label("e_"+ID.getId());
    label.setOpaque(true);
    label.setBackgroundColor(ColorConstants.buttonLightest);
    label.setBorder(new LineBorder());
    add(label, new MidpointLocator(this, 0));

    guardedFigure = new GuardFigure();
    blockedFigure = new BlockedFigure();
    actionFigure = new ActionFigure ();
    add (actionFigure, new RelativeLocator(label,0.5,1.5));
}
项目:gw4e.project    文件:EdgeFigure.java   
public void setLabelAtIndex (int index) {
    try {
        this.remove(label);
    } catch (Exception ignore) {
    }
    add(label, new MidpointLocator(this, index));
}
项目:jive    文件:MessageFigure.java   
protected void addBreak()
{
  final RectangleFigure messageBreak = new RectangleFigure();
  messageBreak.setBackgroundColor(ColorConstants.white);
  messageBreak.setOutline(false);
  final Rectangle bounds = Rectangle.SINGLETON;
  bounds.x = -1;
  bounds.y = -1;
  bounds.width = 4;
  bounds.height = 13;
  messageBreak.setBounds(bounds);
  messageBreak.setBorder(MessageFigure.MESSAGE_BREAK_BORDER);
  add(messageBreak, new MidpointLocator(this, 0));
}
项目:wt-studio    文件:NodeConnectionEditPart.java   
protected IFigure createFigure() {
    PolylineConnection conn = new PolylineConnection();
    conn.setTargetDecoration(new PolygonDecoration());
    conn.setConnectionRouter(new BendpointConnectionRouter());
    final Label label = new Label("Conn");
    label.setOpaque(true);
    conn.add(label, new MidpointLocator(conn, 0));
    return conn;
}
项目:wt-studio    文件:ColumnConnectionEditPart.java   
protected IFigure createFigure() {
    PolylineConnection conn = new PolylineConnection();
    conn.setTargetDecoration(new PolygonDecoration());
    conn.setConnectionRouter(new BendpointConnectionRouter());
    final Label label = new Label("Conn");
    label.setOpaque(true);
    conn.add(label, new MidpointLocator(conn, 0));
    return conn;
}
项目:xeda    文件:MessageRoutePart.java   
protected IFigure createFigure() {
    nodeConn = (MessageRoute)getModel();

    PolylineConnection conn = new PolylineConnection();
    conn.setTargetDecoration(new PolygonDecoration());
    router = new CommonStyleRouter(nodeConn.getStyle());
    conn.setConnectionRouter(router);
    conn.setForegroundColor(ColorConstants.black);

    label = new Label();
    label.setText(nodeConn.getRouteId());
    label.setOpaque(true);
    conn.add(label, new MidpointLocator(conn, 0));
    return conn;
}
项目:gw4e.project    文件:MidpointLocatorWrapper.java   
public MidpointLocatorWrapper(MidpointLocator locator) {
    super();
    this.locator = locator;
}
项目:gef-gwt    文件:BendpointCreationHandle.java   
/**
 * Creates a new BendpointCreationHandle, sets its owner to
 * <code>owner</code> and its index to <code>index</code>, and sets its
 * locator to a new {@link MidpointLocator} with the given
 * <code>locatorIndex</code>.
 * 
 * @param owner
 *            the ConnectionEditPart owner
 * @param index
 *            the index
 * @param locatorIndex
 *            the locator index
 */
public BendpointCreationHandle(ConnectionEditPart owner, int index,
        int locatorIndex) {
    setOwner(owner);
    setIndex(index);
    setLocator(new MidpointLocator(getConnection(), locatorIndex));
}
项目:NEXCORE-UML-Modeler    文件:SequenceBendpointCreationHandle.java   
/**
 * Creates a new BendpointCreationHandle, sets its owner to <code>owner</code>
 * and its index to <code>index</code>, and sets its locator to a new
 * {@link MidpointLocator}.
 * @param owner the ConnectionEditPart owner
 * @param index the index
 */
public SequenceBendpointCreationHandle(ConnectionEditPart owner, int index) {
    setOwner(owner);
    setIndex(index);
    setLocator(new MidpointLocator(getConnection(), index));
}
项目:NEXCORE-UML-Modeler    文件:SequenceBendpointCreationHandle.java   
/**
 * Creates a new BendpointCreationHandle, sets its owner to <code>owner</code>
 * and its index to <code>index</code>, and sets its locator to a new
 * {@link MidpointLocator} with the given <code>locatorIndex</code>.
 * @param owner the ConnectionEditPart owner
 * @param index the index
 * @param locatorIndex the locator index
 */
public SequenceBendpointCreationHandle(ConnectionEditPart owner, int index, int locatorIndex) {
    setOwner(owner);
    setIndex(index);
    setLocator(new MidpointLocator(getConnection(), locatorIndex));
}
项目:gef-gwt    文件:BendpointCreationHandle.java   
/**
 * Creates a new BendpointCreationHandle, sets its owner to
 * <code>owner</code> and its index to <code>index</code>, and sets its
 * locator to a new {@link MidpointLocator}.
 * 
 * @param owner
 *            the ConnectionEditPart owner
 * @param index
 *            the index
 */
public BendpointCreationHandle(ConnectionEditPart owner, int index) {
    setOwner(owner);
    setIndex(index);
    setLocator(new MidpointLocator(getConnection(), index));
}