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; }
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)); }
public void setLabelAtIndex (int index) { try { this.remove(label); } catch (Exception ignore) { } add(label, new MidpointLocator(this, index)); }
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)); }
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; }
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; }
public MidpointLocatorWrapper(MidpointLocator locator) { super(); this.locator = locator; }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }