|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractBox
Adaptor class that implements Box
by supplying reasonable
default for most of the methods.
Field Summary | |
protected int |
height
The height of the box, defaults to -1 . |
protected int |
min_width
The minimum width of this box, defaults to -1 . |
protected int |
pref_width
The preferred width of the box, defaults to -1 . |
protected int |
width
The width of the box, defaults to -1 . |
Constructor Summary | |
AbstractBox()
|
Method Summary | |
abstract 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. |
abstract 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()
Returns a representation of the box. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int width
-1
.protected int height
-1
.protected int min_width
-1
.protected int pref_width
-1
.
The preferred width is used when someone needs to get an
indication of the size of a box.Constructor Detail |
public AbstractBox()
Method Detail |
public int getWidth()
Box
getWidth
in interface Box
Box
public int getMinimumWidth()
Box
getMinimumWidth
in interface Box
Box
public int getPreferredWidth()
Box
getPreferredWidth
in interface Box
Box
public int getHeight()
Box
getHeight
in interface Box
Box
public abstract void doLayout(java.awt.Graphics g, javax.swing.JComponent c, int w)
Box
doLayout
in interface Box
Box
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 abstract void drawAt(int x, int y, DocumentView v)
Box
x
,
y
).drawAt
in interface Box
Box
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 interface Box
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |