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
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_DefaultColorthe 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 StringdefaultColorTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.voidexclude(Color c)Ignored.Color[]generate(int numColors)Generates the specified number of colors.ColorgetDefaultColor()Returns the default color in use.StringglobalInfo()Returns a string describing the object.Colornext()Just returns the default color.Colornext(String name)Returns the next color for this name.voidrecycle(Color c)Ignored.voidresetColors()Ignored.voidsetDefaultColor(Color value)Sets the default color to use.ColorProvidershallowCopy()Returns a shallow copy of itself.ColorProvidershallowCopy(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
nextin interfaceColorProvider- Returns:
- the default color
-
resetColors
public void resetColors()
Ignored.- Specified by:
resetColorsin interfaceColorProvider
-
recycle
public void recycle(Color c)
Ignored.- Specified by:
recyclein interfaceColorProvider- Parameters:
c- the color to re-use
-
exclude
public void exclude(Color c)
Ignored.- Specified by:
excludein interfaceColorProvider- Parameters:
c- the color to exclude
-
next
public Color next(String name)
Returns the next color for this name.- Specified by:
nextin interfaceColorProviderWithNameSupport- Parameters:
name- the name to use- Returns:
- the next color
-
generate
public Color[] generate(int numColors)
Generates the specified number of colors.- Specified by:
generatein interfaceColorProvider- Parameters:
numColors- the number of colors- Returns:
- the colors
-
shallowCopy
public ColorProvider shallowCopy()
Returns a shallow copy of itself.- Specified by:
shallowCopyin interfaceShallowCopySupporter<ColorProvider>- Returns:
- the shallow copy
-
shallowCopy
public ColorProvider shallowCopy(boolean expand)
Returns a shallow copy of itself.- Specified by:
shallowCopyin interfaceShallowCopySupporter<ColorProvider>- Parameters:
expand- whether to expand variables to their current values- Returns:
- the shallow copy
-
-