public class DrawBorder extends Drawable
Modifier and Type | Field and Description |
---|---|
protected Color |
color
A non-null Color, giving the color of the bortder.
|
protected int |
width
A non-negative integer giving the width of the border in pixels.
|
Constructor and Description |
---|
DrawBorder()
Create a black border that is one pixel thick.
|
DrawBorder(Color color,
int width)
Create a border with the spcified color and width.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics g,
boolean changed)
Draw the border in the given graphics context.
|
Color |
getColor()
Get the color of the border.
|
int |
getWidth()
Get the width of the border, in pixels.
|
void |
setColor(Color c)
Set the color of the border to the specified color.
|
void |
setWidth(int w)
Set the width of the border to be w pixels.
|
getVisible, needsRedraw, setOwnerData, setVisible
protected Color color
protected int width
public DrawBorder()
public DrawBorder(Color color, int width)
public Color getColor()
public void setColor(Color c)
public int getWidth()
public void setWidth(int w)
w
- the desired width for the border.public void draw(Graphics g, boolean changed)
draw
in class Drawable
g
- The graphics context in which the Drawble is to be drawn. (The drawing
can change the color in g, but should not permanently change font, painting mode, etc.
Thus, every drawable is responsible for setting the color it wants to use.)changed
- Indicates whether the CoordinateRect has changed.