|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.typesetter.type.node.AbstractNode
org.extex.typesetter.type.node.GenericNodeList
org.extex.typesetter.type.node.HorizontalListNode
public class HorizontalListNode
This class provides a container for nodes which is interpreted as horizontal list.
The horizontal list maintains its natural dimensions (width height and depth) as well as the target dimensions. Whenever a node is added or removed the natural width is adjusted accordingly. If a target width is set then this width is the width reported as the width of the list. Otherwise the natural width is reported.
The
| 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 | |
|---|---|
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. |
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. |
boolean |
isHorizontal()
Check whether this node is in horizontal mode. |
Node |
remove(int index)
Remove an element at a given position. |
void |
toString(java.lang.StringBuffer sb,
java.lang.String prefix,
int breadth,
int depth)
This method puts the printable representation into the string buffer. |
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 org.extex.typesetter.type.node.GenericNodeList |
|---|
clear, clone, copy, countChars, get, getChars, getDepth, getHeight, getMove, getNaturalDepth, getNaturalHeight, getShift, getTargetDepth, getTargetHeight, getTargetWidth, getWidth, isEmpty, iterator, setDepth, setHeight, setMove, setNaturalDepth, setNaturalHeight, setNaturalWidth, setShift, setTargetDepth, setTargetHeight, setTargetWidth, setWidth, size, toString, toText |
| Methods inherited from class org.extex.typesetter.type.node.AbstractNode |
|---|
addDepthTo, addHeightTo, addWidthTo, advanceNaturalDepth, advanceNaturalHeight, advanceNaturalWidth, atShipping, computeAdjustment, getLocalizer, getNaturalWidth, getVerticalSize, maxDepth, maxHeight, maxWidth, spreadHeight, spreadWidth, 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.NodeList |
|---|
clear, copy, get, getMove, getShift, isEmpty, iterator, setMove, setShift, size, toText |
| Methods inherited from interface org.extex.typesetter.type.Node |
|---|
addDepthTo, addHeightTo, addWidthTo, atShipping, countChars, getChars, getDepth, getHeight, getNaturalDepth, getNaturalHeight, getNaturalWidth, getVerticalSize, getWidth, setDepth, setHeight, setWidth, spreadHeight, spreadWidth |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public HorizontalListNode()
public HorizontalListNode(FixedDimen width)
width - the width of the boxpublic HorizontalListNode(Node node)
node - the initial node to add
public HorizontalListNode(Node node1,
Node node2)
node1 - the initial nodenode2 - the node to add after node1| Method Detail |
|---|
public void add(int index,
Node node)
throws java.lang.IndexOutOfBoundsException
If the node is null then it is silently ignored. This
means that a horizontal list will never contain null
values.
add in interface NodeListadd in class GenericNodeListindex - the position of insertionnode - the node to add
java.lang.IndexOutOfBoundsException - in case that the index is negative or
greater than the length of the listGenericNodeList.add( int,
org.extex.typesetter.type.Node)public void add(Node node)
If the node is null then it is silently ignored. This
means that a horizontal list will never contain null
values.
add in interface NodeListadd in class GenericNodeListnode - the node to addGenericNodeList.add(
org.extex.typesetter.type.Node)public void addSkip(FixedGlue glue)
addSkip in interface NodeListaddSkip in class GenericNodeListglue - the glue to addNodeList.addSkip( FixedGlue)public void hpack()
public void hpack(FixedDimen width)
width - the new target widthpublic boolean isHorizontal()
isHorizontal in interface OrientedNodeOrientedNode.isHorizontal()public Node remove(int index)
remove in interface NodeListremove in class GenericNodeListindex - the position
GenericNodeList.remove(int)
public void toString(java.lang.StringBuffer sb,
java.lang.String prefix,
int breadth,
int depth)
toString in interface NodetoString in interface NodeListtoString in class GenericNodeListsb - the output string bufferprefix - the prefix string inserted at the beginning of each linebreadth - the breadth of the nodes to displaydepth - the depth of the nodes to displayNode.toString( java.lang.StringBuffer,
java.lang.String, int, int)
public void toText(java.lang.StringBuffer sb,
java.lang.String prefix)
toText in interface NodetoText in class GenericNodeListsb - the output string bufferprefix - the prefix string inserted at the beginning of each lineNode.toText( java.lang.StringBuffer,
java.lang.String)
public java.lang.Object visit(NodeVisitor visitor,
java.lang.Object value)
throws GeneralException
visit in interface Nodevisit in class GenericNodeListvisitor - the visitor to applyvalue - the argument for the visitor
GeneralException - in case of an errorNode.visit(
org.extex.typesetter.type.NodeVisitor, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||