|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.typesetter.type.node.AbstractNode
This abstract class provides some methods common to all Nodes.
Field Summary | |
protected static CharNode[] |
NO_CHARS
The constant NO_CHAR contains the empty array of CharNode. |
Constructor Summary | |
AbstractNode()
Creates a new object. |
|
AbstractNode(FixedDimen aWidth)
Creates a new object. |
|
AbstractNode(FixedDimen aWidth,
FixedDimen aHeight,
FixedDimen aDepth)
Creates a new object. |
Method Summary | |
void |
addDepthTo(WideGlue glue)
Add the flexible depth of the current node to the given glue. |
void |
addHeightTo(WideGlue glue)
Add the flexible height of the current node to the given glue. |
void |
addWidthTo(WideGlue glue)
Add the flexible width of the current node to the given glue. |
void |
advanceDepth(FixedDimen x)
Advance the depth by some length. |
void |
advanceHeight(FixedDimen x)
Advance the height by some length. |
void |
advanceWidth(FixedDimen x)
Advance the width by some length. |
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. |
protected long |
computeAdjustment(long size,
FixedGlue glue,
FixedGlueComponent sum)
Compute the amount of adjustment needed to achieve a certain size. |
int |
countChars()
This method determines the number of characters contained in a node. |
CharNode[] |
getChars()
Getter for the array of characters enclosed in this node. |
FixedDimen |
getDepth()
Getter for the depth of the node. |
FixedDimen |
getHeight()
Getter for the height of the node. |
protected Localizer |
getLocalizer()
Getter for localizer. |
FixedDimen |
getVerticalSize()
Compute the vertical size of a node. |
FixedDimen |
getWidth()
Getter for the width of the node. |
void |
maxDepth(FixedDimen x)
Assign the maximum of the current value and a comparison value to the depth. |
void |
maxHeight(FixedDimen x)
Assign the maximum of the current value and a comparison value to the height. |
void |
maxWidth(FixedDimen x)
Assign the maximum of the current value and a comparison value to the width. |
void |
setDepth(FixedDimen glue)
Setter for the depth of the node. |
void |
setHeight(FixedDimen glue)
Setter for the height of the node. |
void |
setWidth(FixedDimen glue)
Setter for the width of the node. |
void |
spreadHeight(FixedDimen h,
FixedGlueComponent sum)
Adjust the height of a flexible node. |
void |
spreadWidth(FixedDimen w,
FixedGlueComponent sum)
Adjust the width of a flexible node. |
java.lang.String |
toString()
This method returns the printable representation. |
void |
toString(java.lang.StringBuffer sb,
java.lang.String prefix,
int b,
int d)
This method puts the printable representation into the string buffer. |
protected java.lang.String |
toText(java.lang.String prefix)
Compute a text representation of this object. |
void |
toText(java.lang.StringBuffer sb,
java.lang.String prefix)
Puts a text representation of the object into a string buffer. |
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 |
visit |
Field Detail |
protected static final CharNode[] NO_CHARS
Constructor Detail |
public AbstractNode()
public AbstractNode(FixedDimen aWidth)
aWidth
- the width of the nodepublic AbstractNode(FixedDimen aWidth, FixedDimen aHeight, FixedDimen aDepth)
aWidth
- the width of the nodeaHeight
- the height of the nodeaDepth
- the depth of the nodeMethod Detail |
public void addDepthTo(WideGlue glue)
Node
addDepthTo
in interface Node
glue
- the glue to add to.Node.addDepthTo(
de.dante.extex.interpreter.type.glue.WideGlue)
public void addHeightTo(WideGlue glue)
Node
addHeightTo
in interface Node
glue
- the glue to add to.Node.addHeightTo(
de.dante.extex.interpreter.type.glue.WideGlue)
public void addWidthTo(WideGlue glue)
Node
addWidthTo
in interface Node
glue
- the glue to add to.Node.addWidthTo(
de.dante.extex.interpreter.type.glue.WideGlue)
public void advanceDepth(FixedDimen x)
x
- the length to addpublic void advanceHeight(FixedDimen x)
x
- the length to addpublic void advanceWidth(FixedDimen x)
x
- the length to addpublic Node atShipping(Context context, Typesetter typesetter, NodeVisitor visitor, boolean inHMode) throws GeneralException
atShipping
in interface Node
context
- the interpreter contexttypesetter
- the typesettervisitor
- the node visitor to be invoked when the node is hit. Note
that each node in the output page is visited this way. Thus there is no
need to implement a node traversal for the NodeList typesinHMode
- true
iff the container is a horizontal list.
Otherwise the container is a vertical list
null
then the node is deleted. If
the value is the node itself then it is preserved.
GeneralException
- in case of an errorNode.atShipping(
de.dante.extex.interpreter.context.Context,
de.dante.extex.typesetter.Typesetter,
de.dante.extex.typesetter.type.NodeVisitor,
boolean)
protected long computeAdjustment(long size, FixedGlue glue, FixedGlueComponent sum)
size
- the current size in scaled pointsglue
- the gluesum
- the total stretchability or shrinkability
public int countChars()
Node
countChars
in interface Node
Node.countChars()
public CharNode[] getChars()
Node
getChars
in interface Node
Node.getChars()
public FixedDimen getDepth()
Node
getDepth
in interface Node
Node.getDepth()
public FixedDimen getHeight()
Node
getHeight
in interface Node
Node.getHeight()
protected Localizer getLocalizer()
public FixedDimen getVerticalSize()
Node
getVerticalSize
in interface Node
Node.getVerticalSize()
public FixedDimen getWidth()
Node
getWidth
in interface Node
Node.getWidth()
public void maxDepth(FixedDimen x)
x
- the length to compare topublic void maxHeight(FixedDimen x)
x
- the length to compare topublic void maxWidth(FixedDimen x)
x
- the length to compare topublic void setDepth(FixedDimen glue)
Node
setDepth
in interface Node
glue
- the node depthNode.setDepth(
de.dante.extex.interpreter.type.dimen.FixedDimen)
public void setHeight(FixedDimen glue)
Node
setHeight
in interface Node
glue
- the new heightNode.setHeight(
de.dante.extex.interpreter.type.dimen.FixedDimen)
public void setWidth(FixedDimen glue)
Node
setWidth
in interface Node
glue
- the new widthNode.setWidth(
de.dante.extex.interpreter.type.dimen.FixedDimen)
public void spreadHeight(FixedDimen h, FixedGlueComponent sum)
spreadHeight
in interface Node
h
- the desired heightsum
- the total sum of the gluesNode.spreadHeight(
de.dante.extex.interpreter.type.dimen.FixedDimen,
de.dante.extex.interpreter.type.glue.FixedGlueComponent)
public void spreadWidth(FixedDimen w, FixedGlueComponent sum)
spreadWidth
in interface Node
w
- the desired widthsum
- the total sum of the gluesNode.spreadWidth(
de.dante.extex.interpreter.type.dimen.FixedDimen,
de.dante.extex.interpreter.type.glue.FixedGlueComponent)
public java.lang.String toString()
public void toString(java.lang.StringBuffer sb, java.lang.String prefix, int b, int d)
Node
toString
in interface Node
sb
- the output string bufferprefix
- the prefix string inserted at the beginning of each lineb
- the breadth of the nodes to displayd
- the depth of the nodes to displayNode.toString(
java.lang.StringBuffer,
java.lang.String,
int,
int)
protected java.lang.String toText(java.lang.String prefix)
prefix
- the string prepended to each line of the resulting text
public void toText(java.lang.StringBuffer sb, java.lang.String prefix)
toText
in interface Node
sb
- the output string bufferprefix
- the string prepended to each line of the resulting textNode.toText(java.lang.StringBuffer,
java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |