Class OrderedList
java.lang.Object
|
+--AbstractBox
|
+--AbstractFlexibleBox
|
+--VerticalBoxStack
|
+--OrderedList
- All Implemented Interfaces:
- Box, FlexibleBox
- public class OrderedList
- extends VerticalBoxStack
An ordered list, eg. one with numbers before each item.
Constructor Summary |
OrderedList(int n,
java.awt.Font f)
Creates an ordered list. |
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 ). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OrderedList
public OrderedList(int n,
java.awt.Font f)
- Creates an ordered list. The list will either use labels like
1., 2. and so on or labels like (a), (b), depending on the
argument.
- Parameters:
n
- the nesting. If the nesting is even, then the lables
will be numbers, but if it's odd the labels will be letters.
Strange things will happen if there is more than 25 items
in a list that uses letters as the labels... (at first you'll
get brackets as labels, but later you'll get small squares, as
you run out of characters.)
f
- the font used for the labels.
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 VerticalBoxStack
- 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.
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 VerticalBoxStack
- 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.