|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcurzez.Rectangle
A rectangle is defined by its bounds (top
, left
,
right
, bottom
) a background pen
,
and a drawing pen
.
The first pen will be used to fill in the rectangle when new
room is created. This is a kind of background pen. The second
one is the one you should change when you want to write a new thing
on the window, using different colors and/or attributes.
This class doesn't provide drawing primitives, since drawing is
delegated to AbstractWindow
.
BackgroundColor
Field Summary | |
protected int |
bottom
bottom coordinate of this rectangle. |
protected Pen |
drawingPen
pen used to draw new cells in this rectangle. |
protected FillingPen |
fillingPen
pen used to fill in this rectangle. |
protected int |
left
left coordinate of this rectangle. |
protected int |
right
right coordinate of this rectangle. |
protected int |
top
top coordinate of this rectangle. |
Constructor Summary | |
|
Rectangle(int left,
int top,
int right,
int bottom)
Creates a new Rectangle with the specified bounds, and a default pen for drawing and filling. |
|
Rectangle(int left,
int top,
int right,
int bottom,
Pen fillingPen)
Creates a new Rectangle with the specified bounds, specified pen fo filling, and a default pen for drawing. |
protected |
Rectangle(int left,
int top,
int right,
int bottom,
Pen fillingPen,
Pen drawingPen)
Creates a new Rectangle with the specified bounds, and specified background color. |
Method Summary | |
int |
getBottom()
Returns the bottom coordinate. |
Pen |
getDrawingPen()
Returns the drawing pen of this rectangle. |
Pen |
getFillingPen()
Returns the filling pen. |
int |
getHeight()
Returns the height of the rectangle. |
int |
getLeft()
Returns the left coordinate. |
int |
getRight()
Returns the right coordinate. |
int |
getTop()
Returns the top coordinate. |
int |
getWidth()
Returns the width of the rectangle. |
java.lang.String |
toString()
Returns a representation of this . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int top
protected int left
protected int right
protected int bottom
protected final FillingPen fillingPen
protected final Pen drawingPen
Constructor Detail |
public Rectangle(int left, int top, int right, int bottom)
left
- left coordinate.top
- top coordinate.right
- right coordinate.bottom
- bottom coordinate.public Rectangle(int left, int top, int right, int bottom, Pen fillingPen)
left
- left coordinate.top
- top coordinate.right
- right coordinate.bottom
- bottom coordinate.fillingPen
- the pen used to fill cells.protected Rectangle(int left, int top, int right, int bottom, Pen fillingPen, Pen drawingPen)
left
- left coordinate.top
- top coordinate.right
- right coordinate.bottom
- bottom coordinate.fillingPen
- the pen to fill the rectangle.drawingPen
- the pen to draw new cells.Method Detail |
public int getLeft()
public int getTop()
public int getRight()
public int getBottom()
public int getHeight()
public int getWidth()
public Pen getDrawingPen()
drawingPen
.public Pen getFillingPen()
fillingPen
.public java.lang.String toString()
this
.
toString
in class java.lang.Object
this
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |