Draw2D v2.0

org.eclipse.draw2d
Class LineBorder

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractBorder
        |
        +--org.eclipse.draw2d.LineBorder
All Implemented Interfaces:
Border

public class LineBorder
extends AbstractBorder

Provides for a line border with sides of equal widths.


Field Summary
protected  Color color
           
protected  int width
           
 
Fields inherited from class org.eclipse.draw2d.AbstractBorder
tempRect
 
Constructor Summary
LineBorder()
          Constructs a default black LineBorder with a width of one pixel.
LineBorder(Color c)
          Constructs a LineBorder with the specified color, and a width of 1 pixel.
LineBorder(Color c, int width)
          Constructs a LineBorder with the specified color, and of the specified width.
LineBorder(int width)
          Constructs a black LineBorder with the specified width.
 
Method Summary
 Insets getInsets(IFigure figure)
          Returns the Insets for this Border for the given Figure.
 boolean isOpaque()
          Returns true if the Border completely fills the region defined above in paint.
 void paint(IFigure figure, Graphics graphics, Insets insets)
          paint the Border.
 
Methods inherited from class org.eclipse.draw2d.AbstractBorder
getPaintRectangle, getPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width

color

protected Color color
Constructor Detail

LineBorder

public LineBorder(Color c,
                  int width)
Constructs a LineBorder with the specified color, and of the specified width.
Parameters:
c - Color of the border.
width - Width in pixels of the border.
Since:
2.0

LineBorder

public LineBorder(Color c)
Constructs a LineBorder with the specified color, and a width of 1 pixel.
Parameters:
c - Color of the border.
Since:
2.0

LineBorder

public LineBorder(int width)
Constructs a black LineBorder with the specified width.
Parameters:
width - width of the LineBorder in pixels.
Since:
2.0

LineBorder

public LineBorder()
Constructs a default black LineBorder with a width of one pixel.
Since:
2.0
Method Detail

getInsets

public Insets getInsets(IFigure figure)
Description copied from interface: Border
Returns the Insets for this Border for the given Figure.

isOpaque

public boolean isOpaque()
Description copied from interface: Border
Returns true if the Border completely fills the region defined above in paint.

paint

public void paint(IFigure figure,
                  Graphics graphics,
                  Insets insets)
Description copied from interface: Border
paint the Border. The border should paint inside figure's getBounds(), inset by the parameter insets. The border generally should not paint inside its own insets. More specifically, Border b should paint inside the rectangle: figure.getBounds().getCropped(insets) and outside of the rectangle: figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is defined as rectangle.contains(x,y);

Draw2D v2.0