|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A RigidBox is a box that can only be split, not resized. As you
can't resize such a box, the box must be able to find it's own
width and height as soon as it has been given a Graphics
context via a call to Box.doLayout(java.awt.Graphics, javax.swing.JComponent, int)
.
Rigid boxes are the leaves of the parse-tree, as they are the boxes with the actual contents (substrings, links, images, etc).
Field Summary | |
static int |
BOTH
The constant denoting both edges. |
static int |
LEFT
The left edge constant. |
static int |
RIGHT
The right edge constant. |
Method Summary | |
Box |
getLargestTail()
Returns the right part of a split, where the right part is as large at possible. |
Box |
getSmallestHead()
Returns the left part of a split, where the left part is as small as possible. |
Box |
splitHead(int w)
Tries to split the box at w . |
boolean |
splitIsPossible(int w)
Reports wether or not the box can be split at w . |
Box |
splitTail(int w)
Tries to split the box at w . |
void |
trim(int edge)
Trims the box. |
Methods inherited from interface Box |
doLayout, drawAt, getHeight, getMinimumWidth, getPreferredWidth, getWidth, toString |
Field Detail |
public static final int LEFT
trim(int)
on boxes.public static final int RIGHT
trim(int)
on boxes.public static final int BOTH
trim(int)
on boxes.Method Detail |
public boolean splitIsPossible(int w)
w
.w
- the place where the split should be.public Box splitHead(int w)
w
.w
- the place where the split should be.w
, if possible.
If the box can't be split, null
is returned.public Box splitTail(int w)
w
.w
- the place where the split should be.w
, if
possible. If the box can't be split, null
is
returned.public Box getSmallestHead()
null
is returned instead.public Box getLargestTail()
null
is returned instead.public void trim(int edge)
edge
- to be trimmed. It must be one of LEFT
,
RIGHT
, or BOTH
.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |