Class ColorInfo
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.ColorInfo
-
public class ColorInfo extends java.lang.Object
Data class to hold information on a named color setting.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcategoryprivate java.awt.ColordefaultValueprivate java.lang.Stringnameprivate java.lang.Stringsourceprivate java.awt.Colorvalue
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColorInfofromPref(java.util.List<java.lang.String> lst, boolean isDefault)Constructs a newColorInfofrom raw preference value.java.lang.StringgetCategory()Get the category.java.awt.ColorgetDefaultValue()Get the default value for this color setting.java.lang.StringgetName()Get the name.java.lang.StringgetSource()Get the source.java.awt.ColorgetValue()Get the color value in the preferences (if set).voidsetCategory(java.lang.String category)Set the category.voidsetDefaultValue(java.awt.Color defaultValue)Set the default value.voidsetName(java.lang.String name)Set the name.voidsetSource(java.lang.String source)Set the source.voidsetValue(java.awt.Color value)Set the color value.java.lang.StringtoString()
-
-
-
Field Detail
-
category
private java.lang.String category
-
source
private java.lang.String source
-
name
private java.lang.String name
-
value
private java.awt.Color value
-
defaultValue
private java.awt.Color defaultValue
-
-
Constructor Detail
-
ColorInfo
public ColorInfo()
Constructs a newColorInfo.
-
ColorInfo
public ColorInfo(java.lang.String category, java.lang.String source, java.lang.String name, java.awt.Color value, java.awt.Color defaultValue)
Constructs a newColorInfo.- Parameters:
category- the category of the color settingsource- the source (related file), can be nullname- the color namevalue- the color value set in the preferences, null if not setdefaultValue- the default value for this color setting, can be null- See Also:
NamedColorProperty
-
-
Method Detail
-
getCategory
public java.lang.String getCategory()
Get the category.- Returns:
- the category
-
getSource
public java.lang.String getSource()
Get the source.- Returns:
- the source, can be null
-
getName
public java.lang.String getName()
Get the name.- Returns:
- the name
-
getValue
public java.awt.Color getValue()
Get the color value in the preferences (if set).- Returns:
- the color value, can be null
-
getDefaultValue
public java.awt.Color getDefaultValue()
Get the default value for this color setting.- Returns:
- the default value, can be null
-
setCategory
public void setCategory(java.lang.String category)
Set the category.- Parameters:
category- the category
-
setSource
public void setSource(java.lang.String source)
Set the source.- Parameters:
source- the source
-
setName
public void setName(java.lang.String name)
Set the name.- Parameters:
name- the name
-
setValue
public void setValue(java.awt.Color value)
Set the color value.- Parameters:
value- the value
-
setDefaultValue
public void setDefaultValue(java.awt.Color defaultValue)
Set the default value.- Parameters:
defaultValue- the default value
-
fromPref
public static ColorInfo fromPref(java.util.List<java.lang.String> lst, boolean isDefault)
Constructs a newColorInfofrom raw preference value.- Parameters:
lst- the listisDefault- if the list represents a default value or not- Returns:
- corresponding
ColorInfoobject or null in case of invalid input
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-