Package com.teamten.typeset.element
Class Leader
java.lang.Object
com.teamten.typeset.element.Element
com.teamten.typeset.element.DiscardableElement
com.teamten.typeset.element.Glue
com.teamten.typeset.element.Leader
- All Implemented Interfaces:
Dimensions
,Flexible
Like glue, but draws a pattern over and over (e.g., for table of contents).
-
Field Summary
Fields inherited from class com.teamten.typeset.element.Element
DRAW_DEBUG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfixed
(long newSize) Fix the element to the specified size.long
layOutHorizontally
(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) Add the element to the contents as part of a horizontal sequence.void
println
(PrintStream stream, String indent) Pretty prints the element to the PrintWriter with the given indent.Return a text version of the element, ideally containing only the text of the element and its children.Methods inherited from class com.teamten.typeset.element.Glue
getDepth, getHeight, getShrink, getSize, getStretch, getWidth, horizontal, infinite, infiniteHorizontal, infiniteVertical, isHorizontal, layOutVertically, toString, vertical
Methods inherited from class com.teamten.typeset.element.Element
getVerticalSize, println, shouldSkipElementAtStart, toTextString, visit
-
Constructor Details
-
Leader
Creates a leader which can be used like any other horizontal glue.- Parameters:
pattern
- For table of contents you want something like " . "stretch
- how much (infinite) stretchability. 1pt is good for this.
-
-
Method Details
-
fixed
Description copied from interface:Flexible
Fix the element to the specified size. -
layOutHorizontally
public long layOutHorizontally(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException Description copied from class:Element
Add the element to the contents as part of a horizontal sequence.- Overrides:
layOutHorizontally
in classGlue
- Parameters:
x
- the left-most point of the element.y
- the baseline of the element.contents
- the stream to add the element to.- Returns:
- how much to move right afterward.
- Throws:
IOException
-
println
Description copied from class:Element
Pretty prints the element to the PrintWriter with the given indent. The method must print its own newline. -
toTextString
Description copied from class:Element
Return a text version of the element, ideally containing only the text of the element and its children.- Overrides:
toTextString
in classGlue
-