|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.AbstractBorder | +--org.eclipse.draw2d.LineBorder
Provides for a line border with sides of equal widths.
Field Summary |
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 color)
Constructs a LineBorder with the specified color and a width of 1 pixel. |
|
LineBorder(Color color,
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 | |
Color |
getColor()
Returns the line color of this border. |
Insets |
getInsets(IFigure figure)
Returns the space used by the border for the figure provided as input. |
int |
getWidth()
Returns the line width of this border. |
boolean |
isOpaque()
Returns true since this border is opaque. |
void |
paint(IFigure figure,
Graphics graphics,
Insets insets)
Paints the border. |
void |
setColor(Color color)
Sets the line color for this border. |
void |
setWidth(int width)
Sets the line width for this 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 |
Constructor Detail |
public LineBorder(Color color, int width)
color
- The color of the border.width
- The width of the border in pixels.public LineBorder(Color color)
color
- The color of the border.public LineBorder(int width)
width
- The width of the border in pixels.public LineBorder()
Method Detail |
public Color getColor()
public Insets getInsets(IFigure figure)
figure
- The figure this border belongs to
public int getWidth()
public boolean isOpaque()
true
since this border is opaque. Being opaque it is responsible
to fill in the area within its boundaries.
isOpaque
in interface Border
isOpaque
in class AbstractBorder
true
since this border is opaqueBorder.isOpaque()
public void paint(IFigure figure, Graphics graphics, Insets insets)
Border
IFigure.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(int, int)
.
figure
- The figure this border belongs tographics
- The graphics object used for paintinginsets
- The insetsBorder.paint(IFigure, Graphics, Insets)
public void setColor(Color color)
color
- The line colorpublic void setWidth(int width)
width
- The line width
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |