Class AbstractFlexibleBox

java.lang.Object
  |
  +--AbstractBox
        |
        +--AbstractFlexibleBox
All Implemented Interfaces:
Box, FlexibleBox
Direct Known Subclasses:
BoxFlow, HorizontalBoxStack, Table, VerticalBoxStack

public abstract class AbstractFlexibleBox
extends AbstractBox
implements FlexibleBox

Adaptor class for FlexibleBox. It implements the common methods of all flexible boxes.


Field Summary
protected  java.util.LinkedList boxes
          The child-boxes of this box.
 
Fields inherited from class AbstractBox
height, min_width, pref_width, width
 
Constructor Summary
AbstractFlexibleBox()
           
 
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 insert(Box b)
          Inserts another box into this box.
 boolean isEmpty()
          Reports wether or not this box contains any child-boxes.
 
Methods inherited from class AbstractBox
drawAt, getHeight, getMinimumWidth, getPreferredWidth, getWidth, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Box
drawAt, getHeight, getMinimumWidth, getPreferredWidth, getWidth, toString
 

Field Detail

boxes

protected java.util.LinkedList boxes
The child-boxes of this box. All flexible boxes contains one or more child-boxes.
Constructor Detail

AbstractFlexibleBox

public AbstractFlexibleBox()
Method Detail

insert

public void insert(Box b)
Description copied from interface: FlexibleBox
Inserts another box into this box.
Specified by:
insert in interface FlexibleBox

isEmpty

public boolean isEmpty()
Description copied from interface: FlexibleBox
Reports wether or not this box contains any child-boxes.
Specified by:
isEmpty in interface FlexibleBox

doLayout

public 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.
Specified by:
doLayout in interface Box
Overrides:
doLayout in class AbstractBox
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.