|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Specifies a box. A box has two characteristic properties: it's
width
and height
which is accessed with
getWidth()
and getHeight()
.
A box should also be able to draw itself, see drawAt(int, int, DocumentView)
, but after it has been given a
chance to calculate it's layout with a call to doLayout(Graphics, JComponent, int)
.
Method Summary | |
void |
doLayout(java.awt.Graphics g,
javax.swing.JComponent c,
int w)
Makes the box update it's own width and height, and layout it's child-boxes. |
void |
drawAt(int x,
int y,
DocumentView v)
Draws the box with it's upper-left corner at ( x ,
y ). |
int |
getHeight()
Returns the height of this box. |
int |
getMinimumWidth()
Returns the minimum width of this box. |
int |
getPreferredWidth()
Returns the preferred width of this box. |
int |
getWidth()
Returns the width of this box. |
java.lang.String |
toString()
Gives you information about the box. |
Method Detail |
public int getWidth()
public int getMinimumWidth()
public int getPreferredWidth()
public int getHeight()
public void doLayout(java.awt.Graphics g, javax.swing.JComponent c, int w)
g
- the graphics context. Some boxes, like TextFragments,
need a graphics context before they can determine their width
and height.c
- the component into which the box will be drawn. An
ImageBox needs to know the component to calculate the width
and height.w
- the width available for to the Box.public void drawAt(int x, int y, DocumentView v)
x
,
y
).v
- the DocumentView
that does the actual
drawing.x
- the x-coordinate of the upper-left corner.x
- the y-coordinate of the upper-left corner.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |