de.dante.extex.typesetter.type.node
Class VerticalListNode

java.lang.Object
  extended byde.dante.extex.typesetter.type.node.AbstractNode
      extended byde.dante.extex.typesetter.type.node.GenericNodeList
          extended byde.dante.extex.typesetter.type.node.VerticalListNode
All Implemented Interfaces:
java.lang.Cloneable, Node, NodeList, java.io.Serializable

public class VerticalListNode
extends GenericNodeList
implements NodeList

This class provides an implementation for a vertical list.

Version:
$Revision: 1.20 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
"TeX – The Program [137]", Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class de.dante.extex.typesetter.type.node.AbstractNode
NO_CHARS
 
Constructor Summary
VerticalListNode()
          Creates a new object.
 
Method Summary
 void add(int index, Node node)
          Add a node to the node list at a given position.
 void add(Node node)
          Add a node to the node list.
 void addSkip(FixedGlue glue)
          Add some glue to the node list.
 Node atShipping(Context context, Typesetter typesetter, NodeVisitor visitor, boolean inHMode)
          This method performs any action which are required to executed at the time of shipping the node to the DocumentWriter.
 boolean isTop()
          Getter for top.
 void setTop(boolean top)
          Setter for top.
 VerticalListNode split(FixedDimen height, java.util.logging.Logger logger, java.util.logging.Logger traceLogger)
          Split-off material from a vertical list of a desired height.
 long spread(FixedDimen height)
          Spread the list vertically to a desired size by distributing the differences to the glues contained.
 void spreadHeight(FixedDimen w, FixedGlueComponent sum)
          Adjust the height of a flexible node.
 void toString(java.lang.StringBuffer sb, java.lang.String prefix, int breadth, int depth)
          Print the node possibly truncated in breadth and depth.
 void toText(java.lang.StringBuffer sb, java.lang.String prefix)
          This method puts the printable representation into the string buffer.
 java.lang.Object visit(NodeVisitor visitor, java.lang.Object value)
          This method provides an entry point for the visitor pattern.
 long vpack(FixedDimen targetHeight)
          Adjust the variable nodes to achieve a given target height.
 
Methods inherited from class de.dante.extex.typesetter.type.node.GenericNodeList
clear, copy, countChars, empty, get, getChars, getMove, getShift, getTargetDepth, getTargetHeight, getTargetWidth, iterator, remove, setMove, setShift, setTargetDepth, setTargetHeight, setTargetWidth, size, toString, toText
 
Methods inherited from class de.dante.extex.typesetter.type.node.AbstractNode
addDepthTo, addHeightTo, addWidthTo, advanceDepth, advanceHeight, advanceWidth, computeAdjustment, getDepth, getHeight, getLocalizer, getVerticalSize, getWidth, maxDepth, maxHeight, maxWidth, setDepth, setHeight, setWidth, spreadWidth, toText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.dante.extex.typesetter.type.NodeList
clear, copy, get, getMove, getShift, iterator, remove, setMove, setShift, size
 
Methods inherited from interface de.dante.extex.typesetter.type.Node
addDepthTo, addHeightTo, addWidthTo, countChars, getChars, getDepth, getHeight, getVerticalSize, getWidth, setDepth, setHeight, setWidth, spreadWidth
 

Field Detail

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

VerticalListNode

public VerticalListNode()
Creates a new object.

See Also:
"TeX – The Program [136]"
Method Detail

add

public void add(int index,
                Node node)
Description copied from interface: NodeList
Add a node to the node list at a given position.

Specified by:
add in interface NodeList
Overrides:
add in class GenericNodeList
See Also:
de.dante.extex.typesetter.type.node.AbstractNodeList#add( int, de.dante.extex.typesetter.type.Node)

add

public void add(Node node)
Description copied from interface: NodeList
Add a node to the node list. The other attributes (width, height, depth) are not modified.

Specified by:
add in interface NodeList
Overrides:
add in class GenericNodeList
See Also:
de.dante.extex.typesetter.type.node.AbstractNodeList#add( de.dante.extex.typesetter.type.Node)

addSkip

public void addSkip(FixedGlue glue)
Description copied from interface: NodeList
Add some glue to the node list. The other attributes (width, height, depth) are not modified.

Specified by:
addSkip in interface NodeList
Overrides:
addSkip in class GenericNodeList
See Also:
NodeList.addSkip( de.dante.extex.interpreter.type.glue.FixedGlue)

atShipping

public Node atShipping(Context context,
                       Typesetter typesetter,
                       NodeVisitor visitor,
                       boolean inHMode)
                throws GeneralException
Description copied from interface: Node
This method performs any action which are required to executed at the time of shipping the node to the DocumentWriter. It is a NOOP in the abstract base class and should be overwritten by sub-classes if required.

Specified by:
atShipping in interface Node
Overrides:
atShipping in class GenericNodeList
Throws:
GeneralException
See Also:
de.dante.extex.typesetter.type.node.AbstractNodeList#atShipping( de.dante.extex.interpreter.context.Context, de.dante.extex.typesetter.Typesetter, de.dante.extex.typesetter.type.NodeVisitor, boolean)

isTop

public boolean isTop()
Getter for top.

Returns:
the top

setTop

public void setTop(boolean top)
Setter for top.

Parameters:
top - the top to set

split

public VerticalListNode split(FixedDimen height,
                              java.util.logging.Logger logger,
                              java.util.logging.Logger traceLogger)
Split-off material from a vertical list of a desired height. The splitting is performed at a position with minimal penalty. The list is stretched to the desired height.

Parameters:
height - the target height
logger - the logger for normal logging output
traceLogger - the logger for tracing
Returns:
the split off material

spread

public long spread(FixedDimen height)
Spread the list vertically to a desired size by distributing the differences to the glues contained.

Parameters:
height - the target size
Returns:
the badness of the spread

spreadHeight

public void spreadHeight(FixedDimen w,
                         FixedGlueComponent sum)
Description copied from interface: Node
Adjust the height of a flexible node. This method is a noop for any but the flexible nodes.

Specified by:
spreadHeight in interface Node
Overrides:
spreadHeight in class AbstractNode
Parameters:
w - the desired height
sum - the total sum of the glues
See Also:
Node.spreadHeight( de.dante.extex.interpreter.type.dimen.FixedDimen, de.dante.extex.interpreter.type.glue.FixedGlueComponent)

toString

public void toString(java.lang.StringBuffer sb,
                     java.lang.String prefix,
                     int breadth,
                     int depth)
Description copied from interface: NodeList
Print the node possibly truncated in breadth and depth.

Specified by:
toString in interface NodeList
Overrides:
toString in class GenericNodeList
See Also:
Node.toString( java.lang.StringBuffer, java.lang.String, int, int)

toText

public void toText(java.lang.StringBuffer sb,
                   java.lang.String prefix)
Description copied from interface: Node
This method puts the printable representation into the string buffer. This is meant to produce a short form only as it is used in error messages to the user.

Specified by:
toText in interface Node
Overrides:
toText in class GenericNodeList
See Also:
Node.toText(java.lang.StringBuffer, java.lang.String)

visit

public java.lang.Object visit(NodeVisitor visitor,
                              java.lang.Object value)
                       throws GeneralException
Description copied from interface: Node
This method provides an entry point for the visitor pattern.

Specified by:
visit in interface Node
Overrides:
visit in class GenericNodeList
Throws:
GeneralException
See Also:
Node.visit( de.dante.extex.typesetter.type.NodeVisitor, java.lang.Object)

vpack

public long vpack(FixedDimen targetHeight)
Adjust the variable nodes to achieve a given target height.

Parameters:
targetHeight - the target height
Returns:
the badness