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

项目: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));
}
项目:statecharts    文件:PreferredSizeHandlerEditPolicy.java   
public PreferredSizeSquareHandle(GraphicalEditPart editpart) {
    super(editpart, new RelativeLocator(getHostFigure(), 0.75, 1) {
        protected Rectangle getReferenceBox() {
            IFigure f = getReferenceFigure();
            if (f instanceof HandleBounds)
                return ((HandleBounds) f).getHandleBounds();
            return super.getReferenceBox();
        }
    });
}