Class AbstractRigidBox

java.lang.Object
  |
  +--AbstractBox
        |
        +--AbstractRigidBox
All Implemented Interfaces:
Box, RigidBox
Direct Known Subclasses:
Break, HorizontalRule, ImageBox, RigidBoxGroup, TextFragment

public abstract class AbstractRigidBox
extends AbstractBox
implements RigidBox

Adaptor class for rigid boxes. It implements all methods specified in Box.


Field Summary
protected  java.awt.Graphics pen
          The Graphics context used when drawing this rigid box.
 
Fields inherited from class AbstractBox
height, min_width, pref_width, width
 
Fields inherited from interface RigidBox
BOTH, LEFT, RIGHT
 
Constructor Summary
AbstractRigidBox()
           
 
Method Summary
 Box getLargestTail()
          Tries to make the largest right part from a split.
 Box getSmallestHead()
          Tries to make the smallest left part from a split.
 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)
          Pretends to trim the box - it does nothing as the body of the method is empty.
 
Methods inherited from class AbstractBox
doLayout, 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
doLayout, drawAt, getHeight, getMinimumWidth, getPreferredWidth, getWidth, toString
 

Field Detail

pen

protected java.awt.Graphics pen
The Graphics context used when drawing this rigid box.
Constructor Detail

AbstractRigidBox

public AbstractRigidBox()
Method Detail

splitIsPossible

public boolean splitIsPossible(int w)
Reports wether or not the box can be split at w.
Specified by:
splitIsPossible in interface RigidBox
Parameters:
w - the place where the split should be.
Returns:
true if w is greather than the value returned by AbstractBox.getMinimumWidth().

splitHead

public Box splitHead(int w)
Tries to split the box at w.
Specified by:
splitHead in interface RigidBox
Parameters:
w - the place where the split should be.
Returns:
always null to indicate that the box can't be split.

splitTail

public Box splitTail(int w)
Tries to split the box at w.
Specified by:
splitTail in interface RigidBox
Parameters:
w - the place where the split should be.
Returns:
always null to indicate that the box can't be split.

getSmallestHead

public Box getSmallestHead()
Tries to make the smallest left part from a split.
Specified by:
getSmallestHead in interface RigidBox
Returns:
always null to indicate that the box can't be split.

getLargestTail

public Box getLargestTail()
Tries to make the largest right part from a split.
Specified by:
getLargestTail in interface RigidBox
Returns:
always null to indicate that the box can't be split.

trim

public void trim(int edge)
Pretends to trim the box - it does nothing as the body of the method is empty.
Specified by:
trim in interface RigidBox
Parameters:
edge - to be trimmed. The value is discarded.