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

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.HorizontalListNode
All Implemented Interfaces:
java.lang.Cloneable, Node, NodeList, java.io.Serializable

public class HorizontalListNode
extends GenericNodeList

This class provides a container for nodes which is interpreted as horizontal list.

Version:
$Revision: 1.21 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
"TeX – The Program [135]", 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
HorizontalListNode()
          Creates a new object.
HorizontalListNode(FixedDimen width)
          Creates a new object.
HorizontalListNode(Node node)
          Creates a new object.
HorizontalListNode(Node node1, Node node2)
          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.
 void hpack()
          Adjust the variable nodes to achieve a given target width.
 void hpack(FixedDimen width)
          Adjust the variable nodes to achieve a given target width.
 void spreadWidth(FixedDimen w, FixedGlueComponent sum)
          The TeX definition of a hlist states that a box is not variable neither in width nor in height.
 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.
 
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, spreadHeight, 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.Node
addDepthTo, addHeightTo, addWidthTo, getDepth, getHeight, getVerticalSize, getWidth, setDepth, setHeight, setWidth, spreadHeight
 

Field Detail

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

HorizontalListNode

public HorizontalListNode()
Creates a new object. The list is empty initially.

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

HorizontalListNode

public HorizontalListNode(FixedDimen width)
Creates a new object. The list is filled with the node given.

Parameters:
width - the width of the box

HorizontalListNode

public HorizontalListNode(Node node)
Creates a new object. The hlist is filled with the node given.

Parameters:
node - the initial node to add

HorizontalListNode

public HorizontalListNode(Node node1,
                          Node node2)
Creates a new object. The hlist is initially filled with two nodes.

Parameters:
node1 - the initial node
node2 - the node to add after node1
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( 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)

hpack

public void hpack()
Adjust the variable nodes to achieve a given target width.


hpack

public void hpack(FixedDimen width)
Adjust the variable nodes to achieve a given target width.

Parameters:
width - the new target width

spreadWidth

public void spreadWidth(FixedDimen w,
                        FixedGlueComponent sum)
The TeX definition of a hlist states that a box is not variable neither in width nor in height.

Specified by:
spreadWidth in interface Node
Overrides:
spreadWidth in class AbstractNode
Parameters:
w - the desired width
sum - the total sum of the glues
See Also:
AbstractNode.spreadWidth( 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)