Class VerticalBoxStack
java.lang.Object
|
+--AbstractBox
|
+--AbstractFlexibleBox
|
+--VerticalBoxStack
- All Implemented Interfaces:
- Box, FlexibleBox
- Direct Known Subclasses:
- BlockQuote, ErrorPage, ListItem, OrderedList, TableData, UnorderedList
- public class VerticalBoxStack
- extends AbstractFlexibleBox
A vertical stack of boxes. It will place it's child-boxes on top
of each other.
Method Summary |
void |
doLayout(java.awt.Graphics g,
javax.swing.JComponent c,
int w)
Runs through the child-boxes and asks them to do layout with
the same parameters as this method was called with. |
void |
drawAt(int x,
int y,
DocumentView v)
Draws the box with it's upper-left corner at (x ,
y ). |
int |
getMinimumWidth()
The minimum width of this box. |
int |
getPreferredWidth()
The preferred width of this box. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
VerticalBoxStack
public VerticalBoxStack()
doLayout
public void doLayout(java.awt.Graphics g,
javax.swing.JComponent c,
int w)
- Description copied from class:
AbstractFlexibleBox
- Runs through the child-boxes and asks them to do layout with
the same parameters as this method was called with.
- Overrides:
doLayout
in class AbstractFlexibleBox
- Following copied from class:
AbstractFlexibleBox
- Parameters:
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.
getPreferredWidth
public int getPreferredWidth()
- The preferred width of this box. This is the greatest of the
preferred widths of all the child-boxes. If the box is resized
to it's preferred width, all the child-boxes would fit on a
single line.
- Overrides:
getPreferredWidth
in class AbstractBox
- Returns:
- the preferred width of the box.
getMinimumWidth
public int getMinimumWidth()
- The minimum width of this box. This is the greatest of the
minimum widths of all the child-boxes.
- Overrides:
getMinimumWidth
in class AbstractBox
- Returns:
- the minimum width of the box.
drawAt
public void drawAt(int x,
int y,
DocumentView v)
- Description copied from interface:
Box
- Draws the box with it's upper-left corner at (
x
,
y
).
- Overrides:
drawAt
in class AbstractBox
- Following copied from interface:
Box
- Parameters:
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.