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.String
category
private java.awt.Color
defaultValue
private java.lang.String
name
private java.lang.String
source
private java.awt.Color
value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColorInfo
fromPref(java.util.List<java.lang.String> lst, boolean isDefault)
Constructs a newColorInfo
from raw preference value.java.lang.String
getCategory()
Get the category.java.awt.Color
getDefaultValue()
Get the default value for this color setting.java.lang.String
getName()
Get the name.java.lang.String
getSource()
Get the source.java.awt.Color
getValue()
Get the color value in the preferences (if set).void
setCategory(java.lang.String category)
Set the category.void
setDefaultValue(java.awt.Color defaultValue)
Set the default value.void
setName(java.lang.String name)
Set the name.void
setSource(java.lang.String source)
Set the source.void
setValue(java.awt.Color value)
Set the color value.java.lang.String
toString()
-
-
-
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 newColorInfo
from raw preference value.- Parameters:
lst
- the listisDefault
- if the list represents a default value or not- Returns:
- corresponding
ColorInfo
object or null in case of invalid input
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-