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.ColorPASTEL_BLUEstatic java.awt.ColorPASTEL_GREENstatic java.awt.ColorPASTEL_LAVENDERstatic java.awt.ColorPASTEL_REDstatic java.awt.ColorPASTEL_YELLOWstatic java.awt.ColorWHITE_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.Objectclone()NameValuePairListgetAttributes()Get all single value fields.java.util.List<java.util.List<Persistable>>getChildren()Get all multi value fields.java.awt.ColorgetFillColor()Get fill color.java.awt.FontgetFont()Get text font.java.lang.StringgetId()Get id identifying object.java.awt.ColorgetLineColor()Get line color.intgetMargin()Get margin.java.awt.ColorgetTextColor()Get text color.intgetThickness()Get line thickness.java.lang.StringgetType()Get type (XML element name / database table name not Java class name).GraphicConfiggray()Gray out.booleanisRound()Is round corners.voidsetAttributes(NameValuePairList attr)Set all single value fields.voidsetChildren(java.util.List<java.util.List<Persistable>> childs)Set all multi value fields.voidsetFillColor(java.awt.Color fillColor)Set fill color.voidsetFont(java.awt.Font font)Set text font.voidsetLineColor(java.awt.Color lineColor)Set line color.voidsetMargin(int margin)Set margin.voidsetRound(boolean round)Set round corners.voidsetTextColor(java.awt.Color textColor)Set text color.voidsetThickness(int thickness)Set line thickness.java.lang.StringtoString()
-
-
-
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:
clonein classjava.lang.Object
-
getId
public java.lang.String getId()
Description copied from interface:PersistableGet id identifying object.- Specified by:
getIdin interfacePersistable- Returns:
- id
-
getType
public java.lang.String getType()
Description copied from interface:PersistableGet type (XML element name / database table name not Java class name).- Specified by:
getTypein interfacePersistable- Returns:
- type
-
getAttributes
public NameValuePairList getAttributes()
Description copied from interface:PersistableGet all single value fields.- Specified by:
getAttributesin interfacePersistable- Returns:
- name value pair list
-
getChildren
public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface:PersistableGet all multi value fields.- Specified by:
getChildrenin interfacePersistable- Returns:
- list of list of persistable objects
-
setAttributes
public void setAttributes(NameValuePairList attr) throws ModelException
Description copied from interface:PersistableSet all single value fields.- Specified by:
setAttributesin 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:PersistableSet all multi value fields.- Specified by:
setChildrenin interfacePersistable- Parameters:
childs- list of list of persistable objects- Throws:
ModelException- if problems
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-