Package dk.vajhoej.model.graphic.config
Class GraphicConfig
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description 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
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
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
- marginthickness
- line thicknessfont
- text fonttextColor
- text colorlineColor
- line colorfillColor
- 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
- marginthickness
- line thicknessfont
- text fonttextColor
- text colorlineColor
- line colorfillColor
- fill colorround
- 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 classjava.lang.Object
-
getId
public java.lang.String getId()
Description copied from interface:Persistable
Get id identifying object.- Specified by:
getId
in interfacePersistable
- 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 interfacePersistable
- Returns:
- type
-
getAttributes
public NameValuePairList getAttributes()
Description copied from interface:Persistable
Get all single value fields.- Specified by:
getAttributes
in interfacePersistable
- 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 interfacePersistable
- 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 interfacePersistable
- 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 interfacePersistable
- Parameters:
childs
- list of list of persistable objects- Throws:
ModelException
- if problems
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-