|
|||||||
| 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()
BoxgetWidth in interface BoxBoxpublic int getMinimumWidth()
BoxgetMinimumWidth in interface BoxBoxpublic int getPreferredWidth()
BoxgetPreferredWidth in interface BoxBoxpublic int getHeight()
BoxgetHeight in interface BoxBox
public abstract void doLayout(java.awt.Graphics g,
javax.swing.JComponent c,
int w)
BoxdoLayout in interface BoxBoxg - 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)
Boxx,
y).drawAt in interface BoxBoxv - 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 BoxtoString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||