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

Variable Index

 o _items
The items contained in the document

Constructor Index

 o Document()
Create a Document
 o Document(DocumentDisplay)
Create a Document

Method Index

 o addFlowingData(String)
Add flowing data.
 o addHRule()
Write a horizontal ruler, like the hruler in HTML, e.g., <hr> in HTML.
 o addImage(String)
Output an image.
 o addImage(URL)
Output an image.
 o addLabelData(String, int)
Add a label or a counter, such as 1,2,3 or i, ii, iii or just *
 o addLineBreak()
Add a newline.
 o addLiteralData(String)
Add literal data, e.g., keep line breaks.
 o clear()
Clear the document, ie., remove all elements.
 o endPara(int)
Close a paragraph and print blanklines.
 o popFont()
Pops a font from the font stack.
 o popMargin()
Pops a margin from the margin stack.
 o pushFont(SimpleFont)
Pushes a font on the font stack.
 o pushMargin(int)
Push a new margin on the stack.

Variables

 o _items
  protected Vector _items
The items contained in the document
See Also:
LayoutItem

Constructors

 o Document
  protected Document(DocumentDisplay w)
Create a Document
Parameters:
w - The DocumentDisplay where to show the document
 o Document
  public Document()
Create a Document

Methods

 o 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
 o addLineBreak
  public final void addLineBreak()
Add a newline. Equivalent to <p> in HTML.
 o 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 "*"
 o 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
 o addLiteralData
  public final void addLiteralData(String data)
Add literal data, e.g., keep line breaks.
Parameters:
data - The text to print as literal data
 o 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
 o 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
 o 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
 o 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
 o 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.
 o 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,
 o 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,
 o 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