Class Density
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.sequence.metadatacolor.AbstractMetaDataColor<XYSequencePoint>
-
- adams.gui.visualization.sequence.metadatacolor.Density
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class Density extends AbstractMetaDataColor<XYSequencePoint>
Generates colors based on the point density in the grid of numBins x numBins bins.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Density.Mode
The mode for calculating the density.static class
Density.RenderState
The rendering state.
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Bandwidth
the bandwidth.protected Map<DataContainer,Density.RenderState>
m_Cache
the cached states.protected ColorGradientGenerator
m_Generator
the generator to use.protected Density.Mode
m_Mode
the mode to use.protected int
m_NumBins
the number of bins to generate on X and Y.-
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 Density()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
bandwidthTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
generatorTipText()
Returns the tip text for this property.double
getBandwidth()
Returns the bandwidth for kernel density estimates.Color
getColor(XYSequencePoint point, Color defColor)
Extracts the color from the meta-data.ColorGradientGenerator
getGenerator()
Returns the color generator.Density.Mode
getMode()
Returns the mode to use.int
getNumBins()
Returns the number of bins to generate on X and Y axis.String
globalInfo()
Returns a string describing the object.void
initialize(List<XYSequencePoint> points)
Initializes the meta-data color scheme.String
modeTipText()
Returns the tip text for this property.String
numBinsTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setBandwidth(double value)
Sets the bandwidth for kernel density estimates.void
setGenerator(ColorGradientGenerator value)
Sets the color generator.void
setMode(Density.Mode value)
Sets the mode to use.void
setNumBins(int value)
Sets the number of bins to generate on X and Y axis.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Mode
protected Density.Mode m_Mode
the mode to use.
-
m_NumBins
protected int m_NumBins
the number of bins to generate on X and Y.
-
m_Bandwidth
protected double m_Bandwidth
the bandwidth.
-
m_Generator
protected ColorGradientGenerator m_Generator
the generator to use.
-
m_Cache
protected transient Map<DataContainer,Density.RenderState> m_Cache
the cached states.
-
-
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
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setMode
public void setMode(Density.Mode value)
Sets the mode to use.- Parameters:
value
- the mode
-
getMode
public Density.Mode getMode()
Returns the mode to use.- Returns:
- the mode
-
modeTipText
public String modeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumBins
public void setNumBins(int value)
Sets the number of bins to generate on X and Y axis.- Parameters:
value
- the number of bins
-
getNumBins
public int getNumBins()
Returns the number of bins to generate on X and Y axis.- Returns:
- the number of bins
-
numBinsTipText
public String numBinsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setBandwidth
public void setBandwidth(double value)
Sets the bandwidth for kernel density estimates.- Parameters:
value
- the bandwidth
-
getBandwidth
public double getBandwidth()
Returns the bandwidth for kernel density estimates.- Returns:
- the bandwidth
-
bandwidthTipText
public String bandwidthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setGenerator
public void setGenerator(ColorGradientGenerator value)
Sets the color generator.- Parameters:
value
- the generator
-
getGenerator
public ColorGradientGenerator getGenerator()
Returns the color generator.- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initialize
public void initialize(List<XYSequencePoint> points)
Initializes the meta-data color scheme.- Specified by:
initialize
in classAbstractMetaDataColor<XYSequencePoint>
- Parameters:
points
- the points to initialize with
-
getColor
public Color getColor(XYSequencePoint point, Color defColor)
Extracts the color from the meta-data.- Specified by:
getColor
in classAbstractMetaDataColor<XYSequencePoint>
- Parameters:
point
- the point to get the color fromdefColor
- the default color to use- Returns:
- the color
-
-