dk.vajhoej.model.graphic.config
Class GraphicConfig

java.lang.Object
  extended by dk.vajhoej.model.graphic.config.GraphicConfig
All Implemented Interfaces:
Persistable, java.lang.Cloneable

public class GraphicConfig
extends java.lang.Object
implements Persistable, java.lang.Cloneable

Class GraphicConfig contains a single graphical configuration.


Field Summary
static java.awt.Color PASTEL_BLUE
           
static java.awt.Color PASTEL_GREEN
           
static java.awt.Color PASTEL_LAVENDER
           
static java.awt.Color PASTEL_RED
           
static java.awt.Color PASTEL_YELLOW
           
static java.awt.Color WHITE_LIGHT_GRAY
           
 
Constructor Summary
GraphicConfig()
          Create instance of GraphicConfig.
GraphicConfig(int margin, int thickness, java.awt.Font font, java.awt.Color textColor, java.awt.Color lineColor, java.awt.Color fillColor)
          Create instance of GraphicConfig.
GraphicConfig(int margin, int thickness, java.awt.Font font, java.awt.Color textColor, java.awt.Color lineColor, java.awt.Color fillColor, boolean round)
          Create instance of GraphicConfig.
 
Method Summary
 java.lang.Object clone()
           
 NameValuePairList getAttributes()
          Get all single value fields.
 java.util.List<java.util.List<Persistable>> getChildren()
          Get all multi value fields.
 java.awt.Color getFillColor()
          Get fill color.
 java.awt.Font getFont()
          Get text font.
 java.lang.String getId()
          Get id identifying object.
 java.awt.Color getLineColor()
          Get line color.
 int getMargin()
          Get margin.
 java.awt.Color getTextColor()
          Get text color.
 int getThickness()
          Get line thickness.
 java.lang.String getType()
          Get type (XML element name / database table name not Java class name).
 GraphicConfig gray()
          Gray out.
 boolean isRound()
          Is round corners.
 void setAttributes(NameValuePairList attr)
          Set all single value fields.
 void setChildren(java.util.List<java.util.List<Persistable>> childs)
          Set all multi value fields.
 void setFillColor(java.awt.Color fillColor)
          Set fill color.
 void setFont(java.awt.Font font)
          Set text font.
 void setLineColor(java.awt.Color lineColor)
          Set line color.
 void setMargin(int margin)
          Set margin.
 void setRound(boolean round)
          Set round corners.
 void setTextColor(java.awt.Color textColor)
          Set text color.
 void setThickness(int thickness)
          Set line thickness.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PASTEL_YELLOW

public static final java.awt.Color PASTEL_YELLOW

PASTEL_GREEN

public static final java.awt.Color PASTEL_GREEN

PASTEL_BLUE

public static final java.awt.Color PASTEL_BLUE

PASTEL_LAVENDER

public static final java.awt.Color PASTEL_LAVENDER

PASTEL_RED

public static final java.awt.Color PASTEL_RED

WHITE_LIGHT_GRAY

public static final java.awt.Color WHITE_LIGHT_GRAY
Constructor Detail

GraphicConfig

public GraphicConfig()
Create instance of GraphicConfig.


GraphicConfig

public GraphicConfig(int margin,
                     int thickness,
                     java.awt.Font font,
                     java.awt.Color textColor,
                     java.awt.Color lineColor,
                     java.awt.Color fillColor)
Create instance of GraphicConfig.

Parameters:
margin - margin
thickness - line thickness
font - text font
textColor - text color
lineColor - line color
fillColor - fill color

GraphicConfig

public GraphicConfig(int margin,
                     int thickness,
                     java.awt.Font font,
                     java.awt.Color textColor,
                     java.awt.Color lineColor,
                     java.awt.Color fillColor,
                     boolean round)
Create instance of GraphicConfig.

Parameters:
margin - margin
thickness - line thickness
font - text font
textColor - text color
lineColor - line color
fillColor - fill color
round - round corners
Method Detail

getMargin

public int getMargin()
Get margin.

Returns:
margin

setMargin

public void setMargin(int margin)
Set margin.

Parameters:
margin - margin

getThickness

public int getThickness()
Get line thickness.

Returns:
line thickness

setThickness

public void setThickness(int thickness)
Set line thickness.

Parameters:
thickness - line thickness

getFont

public java.awt.Font getFont()
Get text font.

Returns:
text font

setFont

public void setFont(java.awt.Font font)
Set text font.

Parameters:
font - text font

getTextColor

public java.awt.Color getTextColor()
Get text color.

Returns:
text color

setTextColor

public void setTextColor(java.awt.Color textColor)
Set text color.

Parameters:
textColor - text color

getLineColor

public java.awt.Color getLineColor()
Get line color.

Returns:
line color

setLineColor

public void setLineColor(java.awt.Color lineColor)
Set line color.

Parameters:
lineColor - line color

getFillColor

public java.awt.Color getFillColor()
Get fill color.

Returns:
fill color

setFillColor

public void setFillColor(java.awt.Color fillColor)
Set fill color.

Parameters:
fillColor - fill color

isRound

public boolean isRound()
Is round corners.

Returns:
round corners

setRound

public void setRound(boolean round)
Set round corners.

Parameters:
round - round corners

gray

public GraphicConfig gray()
Gray out.

Returns:
new GraphicCnfig

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getId

public java.lang.String getId()
Description copied from interface: Persistable
Get id identifying object.

Specified by:
getId in interface Persistable
Returns:
id

getType

public java.lang.String getType()
Description copied from interface: Persistable
Get type (XML element name / database table name not Java class name).

Specified by:
getType in interface Persistable
Returns:
type

getAttributes

public NameValuePairList getAttributes()
Description copied from interface: Persistable
Get all single value fields.

Specified by:
getAttributes in interface Persistable
Returns:
name value pair list

getChildren

public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface: Persistable
Get all multi value fields.

Specified by:
getChildren in interface Persistable
Returns:
list of list of persistable objects

setAttributes

public void setAttributes(NameValuePairList attr)
                   throws ModelException
Description copied from interface: Persistable
Set all single value fields.

Specified by:
setAttributes in interface Persistable
Parameters:
attr - value pair list
Throws:
ModelException - if problems

setChildren

public void setChildren(java.util.List<java.util.List<Persistable>> childs)
                 throws ModelException
Description copied from interface: Persistable
Set all multi value fields.

Specified by:
setChildren in interface Persistable
Parameters:
childs - list of list of persistable objects
Throws:
ModelException - if problems

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object