| java.lang.Object edu.hws.jcm.draw.Drawable edu.hws.jcm.draw.DrawBorder
DrawBorder | public class DrawBorder extends Drawable (Code) | | A DrawBorder object is just a simple border around the edges of its CoordinateRect, with
a specified width, in pixels, and a specified color.
|
Field Summary | |
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 Summary | |
public | DrawBorder() Create a black border that is one pixel thick. | public | DrawBorder(Color color, int width) Create a border with the spcified color and width. |
Method Summary | |
public void | draw(Graphics g, boolean changed) Draw the border in the given graphics context. | public Color | getColor() Get the color of the border. | public int | getWidth() Get the width of the border, in pixels. | public void | setColor(Color c) Set the color of the border to the specified color. | public void | setWidth(int w) Set the width of the border to be w pixels. |
color | protected Color color(Code) | | A non-null Color, giving the color of the bortder.
|
width | protected int width(Code) | | A non-negative integer giving the width of the border in pixels.
|
DrawBorder | public DrawBorder()(Code) | | Create a black border that is one pixel thick.
|
DrawBorder | public DrawBorder(Color color, int width)(Code) | | Create a border with the spcified color and width. If the color is null,
black is used. If the width is less than zero, a width of 1 is used.
A border of width zero is invisible.
|
draw | public void draw(Graphics g, boolean changed)(Code) | | Draw the border in the given graphics context. This is not ordinarily called directly.
|
getColor | public Color getColor()(Code) | | Get the color of the border.
|
getWidth | public int getWidth()(Code) | | Get the width of the border, in pixels.
|
setColor | public void setColor(Color c)(Code) | | Set the color of the border to the specified color. If the color is null, nothing is done.
|
setWidth | public void setWidth(int w)(Code) | | Set the width of the border to be w pixels. If w is negative,
this is ignored. A border of witdth 0 is invisible.
Parameters: w - the desired width for the border. |
|
|