Package adams.gui.visualization.core
Class BiColorGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractColorGradientGenerator
-
- adams.gui.visualization.core.BiColorGenerator
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ColorGradientGenerator
,ColorGradientGeneratorWithFixedNumberOfColors
,Serializable
,Comparable
- Direct Known Subclasses:
ConfusionMatrixColorGenerator
public class BiColorGenerator extends AbstractColorGradientGenerator implements ColorGradientGeneratorWithFixedNumberOfColors
Generates gradient colors between two colors.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-num-colors <int> (property: numColors) The number of colors in the gradient to use. default: 255 minimum: 1
-first-color <java.awt.Color> (property: firstColor) The first color of the gradient. default: #000000
-second-color <java.awt.Color> (property: secondColor) The second color of the gradient. default: #ffffff
-alpha <int> (property: alpha) The alpha value to use (0=transparent, 255=opaque); ignored if 255. default: 255 minimum: 0 maximum: 255
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Alpha
the alpha value to use (ignored if 255).protected Color
m_FirstColor
the first color.protected int
m_NumColors
the number of gradient colors.protected Color
m_SecondColor
the second 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 BiColorGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
alphaTipText()
Returns the tip text for this property.protected void
check()
Hook method for performing checks on the setup.void
defineOptions()
Adds options to the internal list of options.protected Color[]
doGenerate()
Performs the actual generation.String
firstColorTipText()
Returns the tip text for this property.int
getAlpha()
Returns the alpha value to use (0=transparent, 255=opaque); ignored if 255.protected int
getDefaultAlpha()
Returns the default for the alpha value.protected Color
getDefaultFirstColor()
Returns the default for the first color.protected int
getDefaultNumColors()
Returns the default for the number of colors.protected Color
getDefaultSecondColor()
Returns the default for the second color.Color
getFirstColor()
Returns the first color of the gradient.int
getNumColors()
Returns the number of gradient colors to use.Color
getSecondColor()
Returns the second color of the gradient.String
globalInfo()
Returns a string describing the object.String
numColorsTipText()
Returns the tip text for this property.String
secondColorTipText()
Returns the tip text for this property.void
setAlpha(int value)
Sets the alpha value to use (0=transparent, 255=opaque); ignored if 255.void
setFirstColor(Color value)
Sets the first color of the gradient.void
setNumColors(int value)
Sets the number of gradient colors to use.void
setSecondColor(Color value)
Sets the second color of the gradient.-
Methods inherited from class adams.gui.visualization.core.AbstractColorGradientGenerator
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
-
-
-
-
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
-
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.
-
getDefaultFirstColor
protected Color getDefaultFirstColor()
Returns the default for the first color.- Returns:
- the default
-
setFirstColor
public void setFirstColor(Color value)
Sets the first color of the gradient.- Parameters:
value
- the first color
-
getFirstColor
public Color getFirstColor()
Returns the first color of the gradient.- Returns:
- the first color
-
firstColorTipText
public String firstColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultSecondColor
protected Color getDefaultSecondColor()
Returns the default for the second color.- Returns:
- the default
-
setSecondColor
public void setSecondColor(Color value)
Sets the second color of the gradient.- Parameters:
value
- the second color
-
getSecondColor
public Color getSecondColor()
Returns the second color of the gradient.- Returns:
- the second color
-
secondColorTipText
public String secondColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultAlpha
protected int getDefaultAlpha()
Returns the default for the alpha value.- Returns:
- the default
-
setAlpha
public void setAlpha(int value)
Sets the alpha value to use (0=transparent, 255=opaque); ignored if 255.- Parameters:
value
- the alpha value
-
getAlpha
public int getAlpha()
Returns the alpha value to use (0=transparent, 255=opaque); ignored if 255.- Returns:
- the alpha value
-
alphaTipText
public String alphaTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected void check()
Hook method for performing checks on the setup.- Overrides:
check
in classAbstractColorGradientGenerator
-
doGenerate
protected Color[] doGenerate()
Performs the actual generation.- Specified by:
doGenerate
in classAbstractColorGradientGenerator
- Returns:
- the generated colors
-
-