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

项目:neoscada    文件:RoundDetailsPart.java   
private IFigure createTargetValue ()
{
    this.targetRect = new RoundedRectangle ();
    this.targetRect.setLayoutManager ( new BorderLayout () );
    this.targetRect.setBackgroundColor ( ColorConstants.lightGray );
    this.targetRect.setForegroundColor ( ColorConstants.black );
    this.targetRect.setBorder ( new MarginBorder ( 10 ) );

    this.targetRect.add ( this.targetLabel = new Label (), BorderLayout.CENTER );

    return this.targetRect;
}
项目:neoscada    文件:RoundDetailsPart.java   
private IFigure createSourceValue ()
{
    this.sourceRect = new RoundedRectangle ();
    this.sourceRect.setLayoutManager ( new BorderLayout () );
    this.sourceRect.setBackgroundColor ( ColorConstants.lightGray );
    this.sourceRect.setForegroundColor ( ColorConstants.black );
    this.sourceRect.setBorder ( new MarginBorder ( 10 ) );

    this.sourceRect.add ( this.sourceLabel = new Label (), BorderLayout.CENTER );

    return this.sourceRect;
}
项目:neoscada    文件:ManualOverride.java   
private Figure createRV ()
{
    final Figure rvFigure = new Figure ();
    rvFigure.setLayoutManager ( new BorderLayout () );
    final Label label = new Label ( Messages.ManualOverride_ResetValue_Label );
    label.setBorder ( new MarginBorder ( 10 ) );
    rvFigure.add ( label, BorderLayout.RIGHT );

    this.rvRect = new RoundedRectangle ();
    this.rvRect.setLayoutManager ( new BorderLayout () );
    this.rvValue = new Label ();
    this.rvRect.setBackgroundColor ( ColorConstants.lightGray );
    this.rvValue.setBorder ( new MarginBorder ( 10 ) );
    this.rvRect.add ( this.rvValue, BorderLayout.CENTER );

    this.rvRectBlinker = new StyleBlinker () {

        @Override
        public void update ( final CurrentStyle style )
        {
            ManualOverride.this.rvRect.setBackgroundColor ( style.background );
            ManualOverride.this.rvRect.setForegroundColor ( style.foreground );
            ManualOverride.this.rvRect.setFont ( style.font );
        }
    };
    this.rvRectStyler = new StateStyler ( this.rvRectBlinker );

    rvFigure.add ( this.rvRect, BorderLayout.CENTER );
    return rvFigure;
}
项目:gw4e.project    文件:VertexFigure.java   
protected void createLayout() {
    setLayoutManager(new XYLayout());
    setBackgroundColor(Activator.getVertexImageColor());
    setOpaque(true);
    setBorder(null);
    rectangle = new RoundedRectangle();
    add(rectangle);
    name = new Label("");
    add(name);
}
项目:gw4e.project    文件:SharedVertexFigure.java   
protected void createLayout () {
    setLayoutManager(new XYLayout());
    setBackgroundColor(Activator.getSharedVertexImageColor());
    setOpaque(true);
    this.setBorder(null); 
    rectangle = new RoundedRectangle();
    add(rectangle);
    name = new Label("");
    add(name);

}
项目:pandionj    文件:AbstractArrayFigure.java   
private RoundedRectangle createPositionsFig() {
    RoundedRectangle fig = new RoundedRectangle();
    fig.setOpaque(false);
    fig.setCornerDimensions(PandionJConstants.OBJECT_CORNER);
    fig.setBackgroundColor(PandionJConstants.Colors.OBJECT);

    GridLayout layout = new GridLayout(horizontal ? (model.getLength() > PandionJView.getMaxArrayLength() ? N + 1 : Math.max(1, N)) : 1, false);
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = PandionJConstants.ARRAY_POSITION_SPACING;
    layout.marginWidth = PandionJConstants.ARRAY_MARGIN;
    layout.marginHeight = PandionJConstants.ARRAY_MARGIN;
    fig.setLayoutManager(layout);

    fig.setToolTip(new Label("length = " + model.getLength()));
    if(N == 0) {
        Label empty = new Label("");
        GridData layoutData = new GridData(POSITION_WIDTH/2, POSITION_WIDTH);
        layout.setConstraint(empty, layoutData);
        fig.add(empty);
    }
    else {
        Iterator<Integer> it = model.getValidModelIndexes();
        while(it.hasNext()) {
            Integer i = it.next();
            if(!it.hasNext() && model.getLength() > PandionJView.getMaxArrayLength()) {
                Position emptyPosition = new Position(null);
                fig.add(emptyPosition);
            }
            Position p = new Position(i);
            fig.add(p);
            positions.add(p);
        }

    }
    return fig;
}
项目:statecharts    文件:TreeLayoutEditPolicy.java   
private IFigure getFeedbackFigure() {
    if (feedbackFigure == null) {
        final RoundedRectangle pl = new RoundedRectangle();
        pl.setForegroundColor(ColorConstants.black);
        pl.setBackgroundColor(ColorConstants.black);
        pl.setBounds(getFeedbackFigureBounds());
        feedbackFigure = pl;
    }
    return feedbackFigure;
}
项目:PDFReporter-Studio    文件:FromEditPart.java   
@Override
protected IFigure createFigure() {
    RoundedRectangle fig = new RoundedRectangle() {
        @Override
        public Insets getInsets() {
            return INSETS;
        }
    };
    fig.setLayoutManager(new FromLayout());
    fig.setBackgroundColor(SWTResourceManager.getColor(248, 248, 255));
    fig.setOpaque(true);
    return fig;
}
项目:PDFReporter-Studio    文件:FromEditPart.java   
protected void refreshVisuals() {
    RoundedRectangle f = (RoundedRectangle) getFigure();
    setupLayoutManager();
    MFrom mfrom = getModel();
    getFigure().setToolTip(new Label(QueryWriter.writeSubQuery(mfrom.getParent())));

    AbstractGraphicalEditPart parent = (AbstractGraphicalEditPart) getParent();
    Point location = f.getLocation();
    if (mfrom.getPropertyActualValue(MFromTable.PROP_X) != null)
        location.x = (Integer) mfrom.getPropertyValue(MFromTable.PROP_X);
    if (mfrom.getPropertyActualValue(MFromTable.PROP_Y) != null)
        location.y = (Integer) mfrom.getPropertyValue(MFromTable.PROP_Y);
    parent.setLayoutConstraint(this, f, new Rectangle(location.x, location.y, -1, -1));
}
项目:snaker-designer    文件:RoundedRectangleElementFigure.java   
protected void customizeFigure() {
    this.rectangle = new RoundedRectangle();
    this.rectangle.setCornerDimensions(new Dimension(25, 25));
    add(this.rectangle, 0);
    setSize(92, 52);
    setSelected(false);
}
项目:FRaMED    文件:ORMRoleGroupFigure.java   
/**
 * The constructor of this class, where the constructor {@link ORMShapeFigure#ORMShapeFigure()}
 * is called, the basic {@link RoundedRectangle} is initialized and the
 * child figure for the name( {@link Label}) is added to the basic rectangle.
 * */
public ORMRoleGroupFigure() {
  super();
  rectangle = new RoundedRectangle();

  setLayoutManager(new BorderLayout());
  setBackgroundColor(ColorConstants.white);

  BorderLayout layout = new BorderLayout();

  layout.setHorizontalSpacing(-1);
  layout.setVerticalSpacing(-1);

  rectangle.setAntialias(SWT.ON);
  rectangle.setLayoutManager(layout);

  rectangle.setCornerDimensions(new Dimension(20, 20));

  // CODE for dashed rectangle
  rectangle.setLineDash(new float[] {5.0f, 5.0f});
  rectangle.setLineStyle(SWT.LINE_CUSTOM);


  rectangle.setFill(false);

  // add name figure
  rectangle.add(getLabel(), BorderLayout.TOP);

  add(rectangle, BorderLayout.CENTER);

}
项目:FRaMED    文件:ORMRoleGroupFigure.java   
/**
 * A getter for the basic rectangle of this figure.
 * 
 * @return rectangle {@link ShadowRoundedRectangle}
 * */
public RoundedRectangle getBasicRec() {
  return rectangle;
}
项目:chrysalix    文件:FocusTree.java   
/**
 * {@inheritDoc} Default is a cell with a {@link RoundedRectangle} view.
 * 
 * @see org.modeshape.modeler.ui.FocusTreeView.Preferences#createCell(java.lang.Object)
 */
@Override
public Cell createCell( final Object item ) {
    return new Cell( new RoundedRectangle() );
}
项目:chrysalix    文件:FocusTree.java   
/**
 * @param item
 *        an item in the tree
 * @return Creates a cell for the supplied item. Must not be <code>null</code>. Default is a {@link RoundedRectangle}.
 */
public IFigure createCell( final Object item ) {
    return new RoundedRectangle();
}