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

项目:limpet    文件:AxisEditPart.java   
@Override
protected IFigure createFigure()
{
  RectangleFigure figure = new RectangleFigure();
  figure.setBackgroundColor(BACKGROUND_COLOR);
  Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setOutline(false);
  GridLayout layoutManager = new GridLayout();
  // zero margin, in order to connect the dependent axes to the shared one
  layoutManager.marginHeight = 0;
  layoutManager.marginWidth = 0;
  figure.setLayoutManager(layoutManager);

  datasetsPane = new RectangleFigure();
  datasetsPane.setOutline(false);
  final SimpleLoweredBorder datasetBorder = new SimpleLoweredBorder(3);
  datasetsPane.setBorder(datasetBorder);
  GridLayout datasetsPaneLayout = new GridLayout();
  datasetsPane.setLayoutManager(datasetsPaneLayout);
  figure.add(datasetsPane);

  arrowFigure = new ArrowFigure(false);
  figure.add(arrowFigure);

  axisNameLabel = new AxisNameFigure(this);
  figure.add(axisNameLabel);

  return figure;
}
项目:limpet    文件:AxisLandingPadEditPart.java   
@Override
protected IFigure createFigure()
{
  final RectangleFigure figure = new RectangleFigure();
  figure.setOutline(false);
  final Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  final Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setLayoutManager(new GridLayout());
  nameLabel = new DirectionalLabel(Activator.FONT_8);

  final ChartPaneEditPart.AxisLandingPad pad =
      (ChartPaneEditPart.AxisLandingPad) getModel();

  nameLabel.setText(pad.pos == ChartPanePosition.MIN ? "Min Axis"
      : "Max Axis");

  figure.add(nameLabel);
  figure.getLayoutManager().setConstraint(nameLabel, new GridData(
      GridData.FILL, GridData.FILL, true, true));

  return figure;
}
项目:erflute    文件:ModelPropertiesFigure.java   
private void addRow(String name, String value, String tableStyle) {
    final Border border = new MarginBorder(5);
    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    final Label nameLabel = new Label();
    final Label valueLabel = new Label();
    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(foregroundColor);
    add(nameLabel);
    if (!DisplayMessages.getMessage("action.title.change.design.simple").equals(tableStyle)
            && !DisplayMessages.getMessage("action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);
    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(foregroundColor);
    }
    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);
    add(valueLabel);
}
项目:birt    文件:ReportFlowLayoutEditPolicy.java   
/**
 * Generates a draw2d constraint object derived from the specified child
 * EditPart using the provided Request. The returned constraint will be
 * translated to the application's model later using
 * {@link #translateToModelConstraint(Object)}.
 * 
 * @param request
 *            the ChangeBoundsRequest
 * @param child
 *            the child EditPart for which the constraint should be
 *            generated
 * @return the draw2d constraint
 */
protected Object getConstraintFor( ChangeBoundsRequest request,
        GraphicalEditPart child )
{
    IFigure figure = child.getFigure( );
    Rectangle rect = new PrecisionRectangle(figure.getBounds());
    figure.translateToAbsolute(rect);
    rect = request.getTransformedRectangle( rect );

    figure.translateToRelative(rect);
    rect.translate( getLayoutOrigin( ).getNegated( ) );
    if (figure instanceof IOutsideBorder)
    {
        Border border = ((IOutsideBorder)figure).getOutsideBorder( );
        if (border !=  null)
        {
            Insets insets = border.getInsets( figure );
            rect.shrink( insets.right, insets.bottom );
        }
    }

    return getConstraintFor( rect );
}
项目:birt    文件:ReportResizeTracker.java   
private Dimension getFigureSize()
{
    IFigure figure = getOwner( ).getFigure( );
    Dimension dim = figure.getSize( );
    if (figure instanceof IOutsideBorder)
    {
        Border border = ((IOutsideBorder)figure).getOutsideBorder( );
        Insets insets = border.getInsets( figure );
        if (PositionConstants.EAST == getResizeDirection())
        {
            dim.width = dim.width - insets.right - insets.left;
        }
        else if (PositionConstants.SOUTH == getResizeDirection())
        {
            dim.height = dim.height - insets.bottom - insets.top;
        }
    }
    return dim;
}
项目:ermasterr    文件:ModelPropertiesFigure.java   
private void addRow(final String name, final String value, final String tableStyle) {
    final Border border = new MarginBorder(5);

    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);

    final Label nameLabel = new Label();

    final Label valueLabel = new Label();

    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(foregroundColor);

    this.add(nameLabel);

    if (!ResourceString.getResourceString("action.title.change.design.simple").equals(tableStyle) && !ResourceString.getResourceString("action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);

    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(foregroundColor);
    }

    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);

    this.add(valueLabel);
}
项目:ermaster-k    文件:ModelPropertiesFigure.java   
private void addRow(String name, String value, String tableStyle) {
    Border border = new MarginBorder(5);

    ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);

    Label nameLabel = new Label();

    Label valueLabel = new Label();

    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(this.foregroundColor);

    this.add(nameLabel);

    if (!ResourceString.getResourceString(
            "action.title.change.design.simple").equals(tableStyle)
            && !ResourceString.getResourceString(
                    "action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);

    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(this.foregroundColor);
    }

    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);

    this.add(valueLabel);
}
项目:ForgedUI-Eclipse    文件:TitaniumFigure.java   
@Override
public void setBorder(Border border) {
    if (border != null){
        Assert.isTrue(border instanceof TitaniumBackgroundBorder,
                "Only TitaniumBackgroundBorder can be set in TitaniumFigure!");
    }
    super.setBorder(border);
}
项目:ermaster-nhit    文件:ModelPropertiesFigure.java   
private void addRow(String name, String value, String tableStyle) {
    Border border = new MarginBorder(5);

    ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);

    Label nameLabel = new Label();

    Label valueLabel = new Label();

    nameLabel.setBorder(border);
    nameLabel.setText(name);
    nameLabel.setLabelAlignment(PositionConstants.LEFT);
    nameLabel.setForegroundColor(this.foregroundColor);

    this.add(nameLabel);

    if (!ResourceString.getResourceString(
            "action.title.change.design.simple").equals(tableStyle)
            && !ResourceString.getResourceString(
                    "action.title.change.design.frame").equals(tableStyle)) {
        valueLabel.setBackgroundColor(ColorConstants.white);
        valueLabel.setOpaque(true);
        valueLabel.setForegroundColor(ColorConstants.black);

    } else {
        valueLabel.setOpaque(false);
        valueLabel.setForegroundColor(this.foregroundColor);
    }

    valueLabel.setBorder(border);
    valueLabel.setText(value);
    valueLabel.setLabelAlignment(PositionConstants.LEFT);

    this.add(valueLabel);
}
项目:gef-gwt    文件:InlineFlow.java   
/**
 * Overridden to assert that only {@link FlowBorder} is used.
 * <code>null</code> is still a valid value as well.
 * 
 * @param border
 *            <code>null</code> or a FlowBorder
 */
public void setBorder(Border border) {
    if (border == null || border instanceof FlowBorder)
        super.setBorder(border);
    else
        throw new RuntimeException(
                "Border must be an instance of FlowBorder"); //$NON-NLS-1$
}
项目:antlr4ide    文件:RectangleNode.java   
@Override
protected Border createBorder() {
  MarginBorder marginBorder = new MarginBorder(PADDING - 1);
  LineBorder lineBorder = new LineBorder(1);
  lineBorder.setColor(ColorConstants.black);
  return new CompoundBorder(lineBorder, marginBorder);
}
项目:birt    文件:RectangleFigure.java   
protected void fillShape( Graphics graphics )
{
    Rectangle bounds = getBounds( ).getCopy( );
    Border border = getBorder( );
    if ( border != null )
    {
        bounds = bounds.crop( border.getInsets( null ) );
    }
    if ( isOpaque( ) )
        graphics.fillRectangle( bounds );
}
项目:birt    文件:RectangleFigure.java   
protected void outlineShape( Graphics graphics )
{
    Rectangle bounds = getBounds( ).getCopy( );
    Border border = getBorder( );
    if ( border != null )
    {
        bounds = bounds.crop( border.getInsets( null ) );
    }
    graphics.drawRectangle( bounds.x,
            bounds.y,
            bounds.width - 1,
            bounds.height - 1 );

}
项目:pandionj    文件:AbstractArrayFigure.java   
@Override
public void setBorder(Border border) {
    super.setBorder(border);
    if(border != null)
        setSize(border.getPreferredSize(this));
}
项目:ForgedUI-Eclipse    文件:PickerColumnFigure.java   
@Override
public void setBorder(Border border) {
    getContentsPane().setBorder(border);
}
项目:ForgedUI-Eclipse    文件:ScrollViewFigure.java   
@Override
public void setBorder(Border border) {
    getContentsPane().setBorder(border);
}
项目:NEXCORE-UML-Modeler    文件:ActorFigure.java   
/**
 * @see org.eclipse.draw2d.Figure#setBorder(org.eclipse.draw2d.Border)
 */
@Override
public void setBorder(Border border) {
}
项目:birt    文件:ImageFigure.java   
public Border getOutsideBorder( )
{
    return getBorder( );
}
项目:chrysalix    文件:FocusTreeCanvas.java   
@Override
public void setBorder( final Border border ) {
    delegate.setBorder( border );
}
项目:birt    文件:IOutsideBorder.java   
/**Gets the outside border
 * @return
 */
Border getOutsideBorder();