org.extex.typesetter.type.node
Class ExpandedLeadersNode

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
              extended by org.extex.typesetter.type.node.ExpandedLeadersNode
All Implemented Interfaces:
java.io.Serializable, Node, SkipNode, OrientedNode

public class ExpandedLeadersNode
extends AbstractLeadersNode

This node represents an expandable leaders node as used by the primitive \xleaders.

Version:
$Revision: 4739 $
Author:
Gerd Neugebauer
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
ExpandedLeadersNode(OrientedNode node, FixedGlue glue)
          Creates a new object.
 
Method Summary
protected  Node fillHorizontally(long total, Node node, FixedDimen posX, FixedDimen posY)
          The method determines how much horizontal space is left and distributes it if necessary.
protected  Node fillVertically(long total, Node node, FixedDimen posX, FixedDimen posY)
          The method determines how much vertical space is left and distributes it if necessary.
 java.lang.Object visit(NodeVisitor visitor, java.lang.Object value)
          This method provides an entry point for the visitor pattern.
 
Methods inherited from class org.extex.typesetter.type.node.AbstractLeadersNode
atShipping, getRepeat, toString
 
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
 

Field Detail

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

ExpandedLeadersNode

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

Parameters:
node - the node or node list to stretch or repeat
glue - the desired size
Method Detail

fillHorizontally

protected Node fillHorizontally(long total,
                                Node node,
                                FixedDimen posX,
                                FixedDimen posY)
The method determines how much horizontal space is left and distributes it if necessary.

If there is not enough space for at least one instance then the current instance is returned. In this case it acts as placeholder to contribute the dimensions for the update of the current position in the document writer.

Otherwise a hlist is created and filled with appropriately many references to the repeat material. Optionally each elemnt is preceded by a kern node to achieve the proper distribution.

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.

Specified by:
fillHorizontally in class AbstractLeadersNode
Parameters:
total - the width in scaled points
node - 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
See Also:
AbstractLeadersNode.fillHorizontally( long, org.extex.typesetter.type.Node, org.extex.core.dimen.FixedDimen, org.extex.core.dimen.FixedDimen)

fillVertically

protected Node fillVertically(long total,
                              Node node,
                              FixedDimen posX,
                              FixedDimen posY)
The method determines how much vertical space is left and distributes it if necessary.

If there is not enough space for at least one instance then the current instance is returned. In this case it acts as placeholder to contribute the dimensions for the update of the current position in the document writer.

Otherwise a vlist is created and filled with appropriately many references to the repeat material. Optionally each element is preceded by a kern node to achieve the proper distribution.

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.

Specified by:
fillVertically in class AbstractLeadersNode
Parameters:
total - the total height; i.e. height plus depth
node - 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
See Also:
AbstractLeadersNode.fillVertically( long, org.extex.typesetter.type.Node, org.extex.core.dimen.FixedDimen, org.extex.core.dimen.FixedDimen)

visit

public java.lang.Object visit(NodeVisitor visitor,
                              java.lang.Object value)
                       throws GeneralException
This method provides an entry point for the visitor pattern.

Parameters:
visitor - the visitor to apply
value - the argument for the visitor
Returns:
the result of the method invocation of the visitor
Throws:
GeneralException - in case of an error
See Also:
Node.visit( org.extex.typesetter.type.NodeVisitor, java.lang.Object)