Class semper.tinguin.Document
All Packages Class Hierarchy This Package Previous Next Index
Class semper.tinguin.Document
java.lang.Object
|
+----semper.tinguin.Document
- public class Document
- extends Object
Defines the class Document that holds layouted text. A document may
contain flowing text or literal text. The text itself may be indented
or formatted in several fonts. Fonts and margins are handled with a
stack machine. For most purposes it might be more appropriate to use
the derived class StructDoc. The document class is only a containter class
that stores all possible layout items. Those items are formatted by the
(non public) class Formatter.
- Version:
- 0.4
- Author:
- Tobias Himstedt
- See Also:
- DocumentDisplay, StructDoc, Formatter
-
_items
- The items contained in the document
-
Document()
- Create a Document
-
Document(DocumentDisplay)
- Create a Document
-
addFlowingData(String)
- Add flowing data.
-
addHRule()
- Write a horizontal ruler, like the hruler in HTML, e.g., <hr> in HTML.
-
addImage(String)
- Output an image.
-
addImage(URL)
- Output an image.
-
addLabelData(String, int)
- Add a label or a counter, such as 1,2,3 or i, ii, iii or just *
-
addLineBreak()
- Add a newline.
-
addLiteralData(String)
- Add literal data, e.g., keep line breaks.
-
clear()
- Clear the document, ie., remove all elements.
-
endPara(int)
- Close a paragraph and print blanklines.
-
popFont()
- Pops a font from the font stack.
-
popMargin()
- Pops a margin from the margin stack.
-
pushFont(SimpleFont)
- Pushes a font on the font stack.
-
pushMargin(int)
- Push a new margin on the stack.
_items
protected Vector _items
- The items contained in the document
- See Also:
- LayoutItem
Document
protected Document(DocumentDisplay w)
- Create a Document
- Parameters:
- w - The DocumentDisplay where to show the document
Document
public Document()
- Create a Document
endPara
public final void endPara(int blankline)
- Close a paragraph and print blanklines. Could be considered a as number
of <p> tags in HTML
- Parameters:
- blankline - The number of blanklines to print
addLineBreak
public final void addLineBreak()
- Add a newline. Equivalent to <p> in HTML.
addLabelData
public final void addLabelData(String format,
int counter)
- Add a label or a counter, such as 1,2,3 or i, ii, iii or just *
- Parameters:
- counter - The number to print if the label is in an ordered list
- format - Specify the format in which the label is shown. A "1"
prints the counter in numbercal format, a "a" or "A" prints the counter in
alphanumerical format, a "i" or "I" print counter in roman format. Any
other character, such as "*" or "-" prints that characater as the label
This is used for unordered lists.
Example: addLabel("i", 4) would print "iv"
Example: addLabel("A", 4) would print "D"
Example: addLabel("1", 4) would print "4"
Example: addLabel("*", 4) would print "*"
addFlowingData
public final void addFlowingData(String data)
- Add flowing data. Flowing data is textual data wihtout
- Parameters:
- data - The text to print as flowing data
addLiteralData
public final void addLiteralData(String data)
- Add literal data, e.g., keep line breaks.
- Parameters:
- data - The text to print as literal data
pushFont
public final void pushFont(SimpleFont font)
- Pushes a font on the font stack. Fonts are stored on a font stack. After
pushing a new font on the stack this is valid until it is popped again.
- Parameters:
- font - The font to be pushed,
- See Also:
- SimpleFont, popFont
popFont
public final void popFont()
- Pops a font from the font stack. The top most and actual font on
the font stack will will be popped from the stack. Afterwards the
the font which is then on top will be active.
- See Also:
- pushFont
pushMargin
public final void pushMargin(int len)
- Push a new margin on the stack. Margins are stored on a stack. After
pushing a new margin on the stack this margin will be active until it is
popped from the stack
- Parameters:
- len - the length of the new margin. It is measured from the
old one.
- See Also:
- popMargin
popMargin
public final void popMargin()
- Pops a margin from the margin stack. The top most and actual margin
is popped and not valid anymore.
- See Also:
- pushMargin
addHRule
public final void addHRule()
- Write a horizontal ruler, like the hruler in HTML, e.g., <hr> in HTML.
Before and after the ruler there are newlines inserted.
addImage
public final void addImage(URL adress)
- Output an image. The image can be either in JPEG or in GIF format.
The image itself may retrieved via network. If the should be taken from
the local host it is important to specify the full path of the image.
- Parameters:
- adress - The URL of the image,
addImage
public final void addImage(String filename)
- Output an image. The image can be either in JPEG or in GIF format.
This is the version for local files.I t is more convinient to use
it since a relativ path may be used.
- Parameters:
- filename - The filename of the image,
clear
public void clear()
- Clear the document, ie., remove all elements. This has nothing to do
with the display.
All Packages Class Hierarchy This Package Previous Next Index