org.extex.typesetter.type.node
Class AbstractLeadersNode

java.lang.Object
  extended by org.extex.typesetter.type.node.AbstractNode
      extended by org.extex.typesetter.type.node.AbstractExpandableNode
          extended by org.extex.typesetter.type.node.AbstractLeadersNode
All Implemented Interfaces:
java.io.Serializable, Node, SkipNode, OrientedNode
Direct Known Subclasses:
AlignedLeadersNode, CenteredLeadersNode, ExpandedLeadersNode

public abstract class AbstractLeadersNode
extends AbstractExpandableNode
implements SkipNode

This node represents a leaders node as used by the primitives \leaders, \cleaders, and \xleaders.

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class org.extex.typesetter.type.node.AbstractNode
NO_CHARS
 
Constructor Summary
AbstractLeadersNode(OrientedNode node, FixedGlue glue)
          Creates a new object.
 
Method Summary
 Node atShipping(PageContext context, Typesetter typesetter, FixedDimen posX, FixedDimen posY)
          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.
protected abstract  Node fillHorizontally(long total, Node n, FixedDimen posX, FixedDimen posY)
          Compute the horizontal list with appropriately many instances of the repeat box.
protected abstract  Node fillVertically(long total, Node n, FixedDimen posX, FixedDimen posY)
          Compute the vertical list with appropriately many instances of the repeat box.
 Node getRepeat()
          Getter for the repeated construction.
 void toString(java.lang.StringBuffer sb, java.lang.String prefix, int breadth, int depth)
          This method puts the printable representation into the string buffer.
 
Methods inherited from class org.extex.typesetter.type.node.AbstractExpandableNode
addDepthTo, addHeightTo, addWidthTo, getSize, isHorizontal, setSize, spreadHeight, spreadWidth
 
Methods inherited from class org.extex.typesetter.type.node.AbstractNode
advanceNaturalDepth, advanceNaturalHeight, advanceNaturalWidth, clone, computeAdjustment, countChars, getChars, getDepth, getHeight, getLocalizer, getNaturalDepth, getNaturalHeight, getNaturalWidth, getVerticalSize, getWidth, maxDepth, maxHeight, maxWidth, setDepth, setHeight, setWidth, toString, toText, toText
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.extex.typesetter.type.Node
addDepthTo, addHeightTo, addWidthTo, countChars, getChars, getDepth, getHeight, getNaturalDepth, getNaturalHeight, getNaturalWidth, getVerticalSize, getWidth, setDepth, setHeight, setWidth, spreadHeight, spreadWidth, toText, visit
 

Field Detail

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

AbstractLeadersNode

public AbstractLeadersNode(OrientedNode node,
                           FixedGlue glue)
Creates a new object.

Parameters:
node - the node or node list to stretch or repeat; if the node is null then it is treated like an empty list
glue - the desired size
Method Detail

atShipping

public Node atShipping(PageContext context,
                       Typesetter typesetter,
                       FixedDimen posX,
                       FixedDimen posY)
                throws GeneralException
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 AbstractNode
Parameters:
context - the interpreter context encapsulated as page context
typesetter - the typesetter
posX - the horizontal position on the page
posY - the vertical position on the page
Returns:
the node to be used instead of the current one in the output list. If the value is null then the node is deleted. If the value is the node itself then it is preserved.
Throws:
GeneralException - in case of an error
See Also:
AbstractNode.atShipping( org.extex.typesetter.PageContext, org.extex.typesetter.Typesetter, org.extex.core.dimen.FixedDimen, org.extex.core.dimen.FixedDimen)

fillHorizontally

protected abstract Node fillHorizontally(long total,
                                         Node n,
                                         FixedDimen posX,
                                         FixedDimen posY)
Compute the horizontal list with appropriately many instances of the repeat box. If not enough space is left then the leaders node itself is returned as place holder. Otherwise a hlist is returned.

Parameters:
total - the width in scaled points
n - the repeated node
posX - the x coordinate of the absolute position of the element on the page
posY - the y coordinate of the absolute position of the element on the page
Returns:
the appropriate node

fillVertically

protected abstract Node fillVertically(long total,
                                       Node n,
                                       FixedDimen posX,
                                       FixedDimen posY)
Compute the vertical list with appropriately many instances of the repeat box. If not enough space is left then the leaders node itself is returned as place holder. Otherwise a vlist is returned.

Parameters:
total - the total height; i.e. height plus depth
n - the repeated node
posX - the x coordinate of the absolute position of the element on the page
posY - the y coordinate of the absolute position of the element on the page
Returns:
the appropriate node

getRepeat

public Node getRepeat()
Getter for the repeated construction.

Returns:
the repeated node

toString

public void toString(java.lang.StringBuffer sb,
                     java.lang.String prefix,
                     int breadth,
                     int depth)
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:
toString in interface Node
Overrides:
toString in class AbstractNode
Parameters:
sb - the output string buffer
prefix - the prefix string inserted at the beginning of each line
breadth - the breadth
depth - the depth
See Also:
"TeX – The Program [190]", Node.toString( java.lang.StringBuffer, java.lang.String, int, int)