de.dante.extex.interpreter.type.box
Class Box

java.lang.Object
  extended byde.dante.extex.interpreter.type.box.Box
All Implemented Interfaces:
BoxOrRule, java.io.Serializable

public class Box
extends java.lang.Object
implements BoxOrRule, java.io.Serializable

This class is used to represent box registers. A box register can either be void or be a horizontal or vertical list.

Version:
$Revision: 1.42 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Box(Box box)
          Creates a new object.
Box(Context context, TokenSource source, Typesetter typesetter, boolean isHorizontal, Tokens insert, GroupType groupType, Token startToken)
          Creates a new object.
Box(NodeList list)
          Creates a new object.
 
Method Summary
 void clear()
          Clear the contents of the box.
 FixedDimen getDepth()
          Getter for the depth of this box.
 FixedDimen getHeight()
          Getter for the height of this box.
protected  Localizer getLocalizer()
          Getter for the localizer.
 FixedDimen getMove()
          Getter for the move parameter.
 NodeList getNodes()
          Getter for nodes.
 FixedDimen getShift()
          Getter for the shift parameter.
 FixedDimen getWidth()
          Getter for the width of this box.
 boolean isHbox()
          Checks whether the box is a horizontal box.
 boolean isVbox()
          Checks whether the box is a vertical box.
 boolean isVoid()
          Checks whether the box is void.
 void setDepth(Dimen depth)
          Setter for the depth of the box.
 void setHeight(FixedDimen height)
          Setter for the height of the box.
 void setMove(Dimen d)
          Setter for the move parameter.
 void setShift(Dimen d)
          Setter for the shift parameter.
 void setWidth(FixedDimen width)
          Setter for the width of the box.
 void spreadHeight(FixedDimen spread)
          Adjust the height of the box if it is not void.
 void spreadWidth(FixedDimen spread)
          Adjust the width of the box if it is not void.
 java.lang.String toString()
           
 VerticalListNode vsplit(Dimen height, java.util.logging.Logger logger)
          Split off material from a vlist of a certain height.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

Box

public Box(Context context,
           TokenSource source,
           Typesetter typesetter,
           boolean isHorizontal,
           Tokens insert,
           GroupType groupType,
           Token startToken)
    throws InterpreterException
Creates a new object.

Parameters:
context - the processor context
source - the source for new tokens
typesetter - the typesetter stack
isHorizontal - indicator whether a \hbox should be constructed. The alternative is a \vbox.
insert - tokens to insert at the beginning or null for none
groupType - the type of the group just entered
startToken - the token which started the group
Throws:
InterpreterException - in case of an error

Box

public Box(NodeList list)
Creates a new object.

Parameters:
list - the node list

Box

public Box(Box box)
Creates a new object.

Parameters:
box - the box to copy (shallow)
Method Detail

clear

public void clear()
Clear the contents of the box. Afterwards the box is void.


getDepth

public FixedDimen getDepth()
Getter for the depth of this box.

Returns:
the depth of this box or 0pt in case of a void box

getHeight

public FixedDimen getHeight()
Getter for the height of this box.

Returns:
the height of this box or 0pt in case of a void box

getLocalizer

protected Localizer getLocalizer()
Getter for the localizer.

Returns:
the localizer

getMove

public FixedDimen getMove()
Getter for the move parameter. The move parameter describes how far from its original position the box is moved leftwards or rightwards. Positive values indicate a move rightwards.

Returns:
the move parameter

getNodes

public NodeList getNodes()
Getter for nodes.

Returns:
the nodes.

getShift

public FixedDimen getShift()
Getter for the shift parameter. The shift parameter describes how far from its original position the box is shifted up or down. Positive values indicate a move upwards.

Returns:
the shift parameter

getWidth

public FixedDimen getWidth()
Getter for the width of this box.

Returns:
the width of this box or 0pt in case of a void box

isHbox

public boolean isHbox()
Checks whether the box is a horizontal box.

Returns:
true iff the box is a horizontal box.

isVbox

public boolean isVbox()
Checks whether the box is a vertical box.

Returns:
true iff the box is a vertical box.

isVoid

public boolean isVoid()
Checks whether the box is void.

Returns:
true iff the box is void.

setDepth

public void setDepth(Dimen depth)
Setter for the depth of the box. If the box is void then this method simply does nothing.

Parameters:
depth - the new width

setHeight

public void setHeight(FixedDimen height)
Setter for the height of the box. If the box is void then this method simply does nothing.

Parameters:
height - the new width

setMove

public void setMove(Dimen d)
Setter for the move parameter. The move parameter describes hpw far from its original position the box is moved leftwards or rightwards. Positive values indicate a move rightwards.

Parameters:
d - the new move parameter

setShift

public void setShift(Dimen d)
Setter for the shift parameter. The shift parameter describes hpw far from its original position the box is shifted up or down. Positive values indicate a move upwards.

Parameters:
d - the new shift parameter

setWidth

public void setWidth(FixedDimen width)
Setter for the width of the box. If the box is void then this method simply does nothing.

Parameters:
width - the new width

spreadHeight

public void spreadHeight(FixedDimen spread)
Adjust the height of the box if it is not void.

Parameters:
spread - the length to add to the height

toString

public java.lang.String toString()
See Also:
Object.toString()

spreadWidth

public void spreadWidth(FixedDimen spread)
Adjust the width of the box if it is not void.

Parameters:
spread - the length to add to the width

vsplit

public VerticalListNode vsplit(Dimen height,
                               java.util.logging.Logger logger)
                        throws javax.naming.OperationNotSupportedException
Split off material from a vlist of a certain height.

Parameters:
height - the height of the material to cut off
logger - the logger or null
Returns:
a new vertical node list with the material
Throws:
javax.naming.OperationNotSupportedException - in case that the Box is not a vlist
See Also:
"TTP [977]"