Package adams.gui.visualization.core
Class RgbInNameColorProvider
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.RgbInNameColorProvider
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<ColorProvider>
,SizeOfHandler
,ColorProvider
,ColorProviderWithNameSupport
,Serializable
public class RgbInNameColorProvider extends AbstractOptionHandler implements ColorProviderWithNameSupport
Looks for an RGB color definition in the name, eg #ff0000. If none found or no name provided to search, the default color is returned.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-default-color <java.awt.Color> (property: defaultColor) The default color to use if no color located or no name provided to match against. default: #000000
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
m_DefaultColor
the default color.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RgbInNameColorProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
defaultColorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.void
exclude(Color c)
Ignored.Color
getDefaultColor()
Returns the default color in use.String
globalInfo()
Returns a string describing the object.Color
next()
Just returns the default color.Color
next(String name)
Returns the next color for this name.void
recycle(Color c)
Ignored.void
resetColors()
Ignored.void
setDefaultColor(Color value)
Sets the default color to use.ColorProvider
shallowCopy()
Returns a shallow copy of itself.ColorProvider
shallowCopy(boolean expand)
Returns a shallow copy of itself.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_DefaultColor
protected Color m_DefaultColor
the default color.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setDefaultColor
public void setDefaultColor(Color value)
Sets the default color to use.- Parameters:
value
- the default color to use
-
getDefaultColor
public Color getDefaultColor()
Returns the default color in use.- Returns:
- the default color in use
-
defaultColorTipText
public String defaultColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
next
public Color next()
Just returns the default color.- Specified by:
next
in interfaceColorProvider
- Returns:
- the default color
-
resetColors
public void resetColors()
Ignored.- Specified by:
resetColors
in interfaceColorProvider
-
recycle
public void recycle(Color c)
Ignored.- Specified by:
recycle
in interfaceColorProvider
- Parameters:
c
- the color to re-use
-
exclude
public void exclude(Color c)
Ignored.- Specified by:
exclude
in interfaceColorProvider
- Parameters:
c
- the color to exclude
-
next
public Color next(String name)
Returns the next color for this name.- Specified by:
next
in interfaceColorProviderWithNameSupport
- Parameters:
name
- the name to use- Returns:
- the next color
-
shallowCopy
public ColorProvider shallowCopy()
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<ColorProvider>
- Returns:
- the shallow copy
-
shallowCopy
public ColorProvider shallowCopy(boolean expand)
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<ColorProvider>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-