com.tensegrity.gui.printing
Class FormatItem

java.lang.Object
  extended bycom.tensegrity.gui.printing.FormatItem

public class FormatItem
extends java.lang.Object

While formatting the header or the footer of a Page, we need items to represent text with a certain font, placed either left, center or right. A PageFormat will contain 6 FormatItems: 3 for the header and 3 for the footer. Each of these items can have his own font and text. TODO Add font color

Version:
$Id: FormatItem.java,v 1.2 2006/03/02 11:40:58 BurkhardWick Exp $
Author:
GillesIachelini

Field Summary
static int CENTER
          Constant for center alignment.
static int DEFAULT_ALIGN
          default alignment is left
static int LEFT
          Constant for left alignment.
static int RIGHT
          Constant for right alignment.
 
Constructor Summary
FormatItem()
           
 
Method Summary
static FormatItem build(AttributeList list)
           
 FormatItem deepCopy()
           
 boolean equals(java.lang.Object obj)
           
 int getAlign()
          The method getAlign returns the alignment of this FormatItem.
 FontFormat getFont()
          The method getFont returns the font format to be used for this item.
 java.lang.String getText()
          The method getText returns the text of this item with the format identifiers.
 AttributeList serialize()
           
 void setAlign(int i)
          The method setAlign sets the alignment.
 void setFont(FontFormat font)
          The method setFont sets the Font for this item.
 void setText(java.lang.String string)
          The method setText sets the text for this item.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Constant for left alignment.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Constant for center alignment.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Constant for right alignment.

See Also:
Constant Field Values

DEFAULT_ALIGN

public static final int DEFAULT_ALIGN
default alignment is left

See Also:
Constant Field Values
Constructor Detail

FormatItem

public FormatItem()
Method Detail

getAlign

public int getAlign()
The method getAlign returns the alignment of this FormatItem. Returns one of the predefined constants.

Returns:
int the applied alignment of this item.
See Also:
LEFT, CENTER, RIGHT

getFont

public FontFormat getFont()
The method getFont returns the font format to be used for this item.

Returns:
FontFormat the font of this item.

deepCopy

public FormatItem deepCopy()

getText

public java.lang.String getText()
The method getText returns the text of this item with the format identifiers. Note: Using the text of this FormatItem requires that you use the PrintUtil.replaceIdentifier(String, int, int)method to replace all previously added format shortcuts,.

Returns:
String the text of this format item containing all previously added format identifier.

setAlign

public void setAlign(int i)
The method setAlign sets the alignment.

Parameters:
i - the new alignment.

setFont

public void setFont(FontFormat font)
The method setFont sets the Font for this item.

Parameters:
font - the new font for this item.

setText

public void setText(java.lang.String string)
The method setText sets the text for this item.

Parameters:
string - the new text.

build

public static FormatItem build(AttributeList list)

serialize

public AttributeList serialize()

equals

public boolean equals(java.lang.Object obj)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.