Package adams.gui.visualization.core
Class ColorProviderBasedColorGradientGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractColorGradientGenerator
-
- adams.gui.visualization.core.ColorProviderBasedColorGradientGenerator
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ColorGradientGenerator
,ColorGradientGeneratorWithFixedNumberOfColors
,ColorProviderHandler
,Serializable
,Comparable
public class ColorProviderBasedColorGradientGenerator extends AbstractColorGradientGenerator implements ColorProviderHandler, ColorGradientGeneratorWithFixedNumberOfColors
Uses the specified color provider to generate the colors.
Mainly used for having control over colors when generating images.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-color-provider <adams.gui.visualization.core.ColorProvider> (property: colorProvider) The color provider to use. default: adams.gui.visualization.core.DefaultColorProvider
-num-colors <int> (property: numColors) The number of colors in the gradient to use. default: 255 minimum: 1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorProvider
m_ColorProvider
the color provider to use.protected int
m_NumColors
the number of gradient colors.-
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 ColorProviderBasedColorGradientGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
colorProviderTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected Color[]
doGenerate()
Performs the actual generation.ColorProvider
getColorProvider()
Returns the color provider to use.protected int
getDefaultNumColors()
Returns the default for the number of colors.int
getNumColors()
Returns the number of gradient colors to use.String
globalInfo()
Returns a string describing the object.String
numColorsTipText()
Returns the tip text for this property.void
setColorProvider(ColorProvider value)
Sets the color provider to use.void
setNumColors(int value)
Sets the number of gradient colors to use.-
Methods inherited from class adams.gui.visualization.core.AbstractColorGradientGenerator
check, compareTo, equals, forCommandLine, forName, generate, getGenerators, shallowCopy, shallowCopy
-
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.gui.visualization.core.ColorGradientGenerator
compareTo, equals, generate, shallowCopy, shallowCopy
-
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_ColorProvider
protected ColorProvider m_ColorProvider
the color provider to use.
-
m_NumColors
protected int m_NumColors
the number of gradient colors.
-
-
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
-
setColorProvider
public void setColorProvider(ColorProvider value)
Sets the color provider to use.- Specified by:
setColorProvider
in interfaceColorProviderHandler
- Parameters:
value
- the provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider to use.- Specified by:
getColorProvider
in interfaceColorProviderHandler
- Returns:
- the provider
-
colorProviderTipText
public String colorProviderTipText()
Returns the tip text for this property.- Specified by:
colorProviderTipText
in interfaceColorProviderHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultNumColors
protected int getDefaultNumColors()
Returns the default for the number of colors.- Returns:
- the default
-
setNumColors
public void setNumColors(int value)
Sets the number of gradient colors to use.- Specified by:
setNumColors
in interfaceColorGradientGeneratorWithFixedNumberOfColors
- Parameters:
value
- the number of colors
-
getNumColors
public int getNumColors()
Returns the number of gradient colors to use.- Specified by:
getNumColors
in interfaceColorGradientGeneratorWithFixedNumberOfColors
- Returns:
- the number of colors
-
numColorsTipText
public String numColorsTipText()
Returns the tip text for this property.- Specified by:
numColorsTipText
in interfaceColorGradientGeneratorWithFixedNumberOfColors
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doGenerate
protected Color[] doGenerate()
Performs the actual generation.- Specified by:
doGenerate
in classAbstractColorGradientGenerator
- Returns:
- the generated colors
-
-