at.knowcenter.wag.egov.egiz.table
Class Style

java.lang.Object
  extended by at.knowcenter.wag.egov.egiz.table.Style
All Implemented Interfaces:
Serializable

public class Style
extends Object
implements Serializable

This class implements an abstract style definiton used in tables or table entrys. Predefined values exists for valign and halign. Color definitions uses the native awt color declarations.
The predefined keys are used in the setting definition file to style tables and table entries.
It provides an static method to inherit style informations from a given style object. doInherit(at.knowcenter.wag.egov.egiz.table.Style, at.knowcenter.wag.egov.egiz.table.Style)

Author:
wlackner
See Also:
Color, Serialized Form

Field Summary
static String BGCOLOR
          bgcolor key
static String BOLD
          Font type BOLD
static String BOLDITALIC
          Font type BOLDITALIC
static String BORDER
          border key, default border = 1;
The border value is one value for all border lines of an entry or table!
static String BOTTOM
          valign statement key bottom
static String CENTER
          halign statement key center
static String COURIER
          Font name COURIER
static String FONT
          Font key
static String HALIGN
          halign key
static String HELVETICA
          Font name HELVETICA
static String ITALIC
          Font type ITALIC
static String LEFT
          halign statement key left
static String MIDDLE
          valign statement key middle
static String NORMAL
          Font type NORMAL
static String PADDING
          padding key, default padding = 1
static String RIGHT
          halign statement key right
static String STRIKETHRU
          Font type STRIKETHRU
static String TIMES_ROMAN
          Font name TIMES_ROMAN
static String TOP
          valign statement key top
static String UNDERLINE
          Font type UNDERLINE
static String VALIGN
          valign key
static String VALUEFONT
          The value font key.
 
Constructor Summary
Style()
          The empty constructor.
 
Method Summary
static Style doInherit(Style baseStyle, Style inhertStyle)
          This method inherits all style attributes (values) from a given style object.
 Color getBgColor()
           
 float getBorder()
           
 String getFont()
           
 String getHAlign()
           
 float getPadding()
           
 String getVAlign()
           
 String getValueFont()
          Returns the value font.
 void setBgColor(Color bgColor)
           
 void setBorder(float border)
           
 void setFont(String font)
           
 void setHAlign(String align)
           
 void setPadding(float padding)
           
 void setStyle(String id, String value)
          Set a style attribute.
 void setVAlign(String align)
           
 void setValueFont(String valuefont)
          Sets the value font.
 String toString()
          The toString method, used for tests or debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP

public static final String TOP
valign statement key top

See Also:
Constant Field Values

MIDDLE

public static final String MIDDLE
valign statement key middle

See Also:
Constant Field Values

BOTTOM

public static final String BOTTOM
valign statement key bottom

See Also:
Constant Field Values

LEFT

public static final String LEFT
halign statement key left

See Also:
Constant Field Values

CENTER

public static final String CENTER
halign statement key center

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
halign statement key right

See Also:
Constant Field Values

BGCOLOR

public static final String BGCOLOR
bgcolor key

See Also:
Constant Field Values

HALIGN

public static final String HALIGN
halign key

See Also:
Constant Field Values

VALIGN

public static final String VALIGN
valign key

See Also:
Constant Field Values

PADDING

public static final String PADDING
padding key, default padding = 1

See Also:
Constant Field Values

BORDER

public static final String BORDER
border key, default border = 1;
The border value is one value for all border lines of an entry or table!
No separte definitions for top, right, bottom or left are possible.

See Also:
Constant Field Values

FONT

public static final String FONT
Font key

See Also:
Constant Field Values

VALUEFONT

public static final String VALUEFONT
The value font key.

See Also:
Constant Field Values

HELVETICA

public static final String HELVETICA
Font name HELVETICA

See Also:
Constant Field Values

TIMES_ROMAN

public static final String TIMES_ROMAN
Font name TIMES_ROMAN

See Also:
Constant Field Values

COURIER

public static final String COURIER
Font name COURIER

See Also:
Constant Field Values

NORMAL

public static final String NORMAL
Font type NORMAL

See Also:
Constant Field Values

BOLD

public static final String BOLD
Font type BOLD

See Also:
Constant Field Values

ITALIC

public static final String ITALIC
Font type ITALIC

See Also:
Constant Field Values

BOLDITALIC

public static final String BOLDITALIC
Font type BOLDITALIC

See Also:
Constant Field Values

UNDERLINE

public static final String UNDERLINE
Font type UNDERLINE

See Also:
Constant Field Values

STRIKETHRU

public static final String STRIKETHRU
Font type STRIKETHRU

See Also:
Constant Field Values
Constructor Detail

Style

public Style()
The empty constructor.

Method Detail

setStyle

public void setStyle(String id,
                     String value)
Set a style attribute. The style attribute must be one of the public definitions

Parameters:
id - the style attribute to set
value - the style value to set for the given attribute

getBgColor

public Color getBgColor()
Returns:
Returns the bgColor.

setBgColor

public void setBgColor(Color bgColor)
Parameters:
bgColor - The bgColor to set.

getHAlign

public String getHAlign()
Returns:
Returns the hAlign.

setHAlign

public void setHAlign(String align)
Parameters:
align - The hAlign to set.

getPadding

public float getPadding()
Returns:
Returns the padding.

setPadding

public void setPadding(float padding)
Parameters:
padding - The padding to set.

getVAlign

public String getVAlign()
Returns:
Returns the vAlign.

setVAlign

public void setVAlign(String align)
Parameters:
align - The vAlign to set.

getBorder

public float getBorder()
Returns:
Returns the border.

setBorder

public void setBorder(float border)
Parameters:
border - The border to set.

getFont

public String getFont()
Returns:
Returns the font.

setFont

public void setFont(String font)
Parameters:
font - The font to set.

getValueFont

public String getValueFont()
Returns the value font.

Returns:
Returns the value font.

setValueFont

public void setValueFont(String valuefont)
Sets the value font.

Parameters:
valuefont - The value font to be set.

toString

public String toString()
The toString method, used for tests or debugging.

Overrides:
toString in class Object

doInherit

public static Style doInherit(Style baseStyle,
                              Style inhertStyle)
This method inherits all style attributes (values) from a given style object. A new style object is created if the base style object is null. If a value is not defined in the baseStyle object it would be inhert from the inheritStyle object.

Parameters:
baseStyle - the base style object that should be enhanced
inhertStyle - the style values that could inherit from
Returns:
an inherit style object


Copyright © 2006-2007 EGIZ - E-Government Innovationszentrum. All Rights Reserved.