Class DensityScatterPlotChart
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.xchart.chart.AbstractChartGenerator<C,D>
-
- adams.gui.visualization.xchart.chart.AbstractChartGeneratorWithAxisLabels<org.knowm.xchart.XYChart,XYDataset>
-
- adams.gui.visualization.xchart.chart.DensityScatterPlotChart
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,Serializable
public class DensityScatterPlotChart extends AbstractChartGeneratorWithAxisLabels<org.knowm.xchart.XYChart,XYDataset>
Generates an density-based XY scatter plot.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_BackgroundColorthe background color.protected doublem_Bandwidththe bandwidth.protected Colorm_DiagonalColorthe color for the diagonal plot.protected ColorGradientGeneratorm_Generatorthe generator to use.protected intm_MarkerSizethe marker size.protected KernelDensityEstimation.Modem_Modehow to calculate the density.protected intm_NumBinsthe number of bins to generate on X and Y.protected KernelDensityEstimation.RenderStatem_RenderStatethe generated render state.protected Colorm_ZoomSelectionColorthe zoom selection color.-
Fields inherited from class adams.gui.visualization.xchart.chart.AbstractChartGeneratorWithAxisLabels
m_LabelX, m_LabelY
-
Fields inherited from class adams.gui.visualization.xchart.chart.AbstractChartGenerator
m_Legend, m_LegendPosition, m_Title
-
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 DensityScatterPlotChart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddData(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Adds the data to the chart.StringbackgroundColorTipText()Returns the tip text for this property.StringbandwidthTipText()Returns the tip text for this property.protected org.knowm.xchart.XYChartbuildChart()Builds the chart.voiddefineOptions()Adds options to the internal list of options.StringdiagonalColorTipText()Returns the tip text for this property.StringgeneratorTipText()Returns the tip text for this property.ColorgetBackgroundColor()Returns the background color for the plot.doublegetBandwidth()Returns the bandwidth for kernel density estimates.ColorgetDiagonalColor()Returns the color for the diagonal (ie second data series if present) of XY charts.ColorGradientGeneratorgetGenerator()Returns the color generator.intgetMarkerSize()Returns the marker size.KernelDensityEstimation.ModegetMode()Returns the mode to use.intgetNumBins()Returns the number of bins to generate on X and Y axis.ColorgetZoomSelectionColor()Returns the color for the zoom selection.StringglobalInfo()Returns a string describing the object.StringmarkerSizeTipText()Returns the tip text for this property.StringmodeTipText()Returns the tip text for this property.StringnumBinsTipText()Returns the tip text for this property.protected voidpostGenerate(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Hook method for after the chart has been generated.voidsetBackgroundColor(Color value)Sets the background color for the plot.voidsetBandwidth(double value)Sets the bandwidth for kernel density estimates.voidsetDiagonalColor(Color value)Sets the color for the diagonal (ie second data series if present) of XY charts.voidsetGenerator(ColorGradientGenerator value)Sets the color generator.voidsetMarkerSize(int value)Sets the marker size.voidsetMode(KernelDensityEstimation.Mode value)Sets the mode to use.voidsetNumBins(int value)Sets the number of bins to generate on X and Y axis.voidsetZoomSelectionColor(Color value)Sets the color for the zoom selection.protected voidstyleChart(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Applies styling to the chart.StringzoomSelectionColorTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.xchart.chart.AbstractChartGeneratorWithAxisLabels
getLabelX, getLabelY, getQuickInfo, labelXTipText, labelYTipText, setLabelX, setLabelY
-
Methods inherited from class adams.gui.visualization.xchart.chart.AbstractChartGenerator
check, doGenerate, generate, getLegend, getLegendPosition, getTitle, legendPositionTipText, legendTipText, setLegend, setLegendPosition, setTitle, titleTipText
-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_MarkerSize
protected int m_MarkerSize
the marker size.
-
m_BackgroundColor
protected Color m_BackgroundColor
the background color.
-
m_DiagonalColor
protected Color m_DiagonalColor
the color for the diagonal plot.
-
m_ZoomSelectionColor
protected Color m_ZoomSelectionColor
the zoom selection color.
-
m_Mode
protected KernelDensityEstimation.Mode m_Mode
how to calculate the density.
-
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_RenderState
protected transient KernelDensityEstimation.RenderState m_RenderState
the generated render state.
-
-
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 classAbstractChartGeneratorWithAxisLabels<org.knowm.xchart.XYChart,XYDataset>
-
setMarkerSize
public void setMarkerSize(int value)
Sets the marker size.- Parameters:
value- the size
-
getMarkerSize
public int getMarkerSize()
Returns the marker size.- Returns:
- the size
-
markerSizeTipText
public String markerSizeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setBackgroundColor
public void setBackgroundColor(Color value)
Sets the background color for the plot.- Parameters:
value- the color
-
getBackgroundColor
public Color getBackgroundColor()
Returns the background color for the plot.- Returns:
- the color
-
backgroundColorTipText
public String backgroundColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDiagonalColor
public void setDiagonalColor(Color value)
Sets the color for the diagonal (ie second data series if present) of XY charts.- Parameters:
value- the color
-
getDiagonalColor
public Color getDiagonalColor()
Returns the color for the diagonal (ie second data series if present) of XY charts.- Returns:
- the color
-
diagonalColorTipText
public String diagonalColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setZoomSelectionColor
public void setZoomSelectionColor(Color value)
Sets the color for the zoom selection.- Parameters:
value- the color
-
getZoomSelectionColor
public Color getZoomSelectionColor()
Returns the color for the zoom selection.- Returns:
- the color
-
zoomSelectionColorTipText
public String zoomSelectionColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMode
public void setMode(KernelDensityEstimation.Mode value)
Sets the mode to use.- Parameters:
value- the mode
-
getMode
public KernelDensityEstimation.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.
-
buildChart
protected org.knowm.xchart.XYChart buildChart()
Builds the chart.- Specified by:
buildChartin classAbstractChartGenerator<org.knowm.xchart.XYChart,XYDataset>- Returns:
- the chart
-
styleChart
protected void styleChart(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Applies styling to the chart.- Specified by:
styleChartin classAbstractChartGenerator<org.knowm.xchart.XYChart,XYDataset>- Parameters:
data- the data to will be addedchart- the chart to style
-
addData
protected void addData(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Adds the data to the chart.- Specified by:
addDatain classAbstractChartGenerator<org.knowm.xchart.XYChart,XYDataset>- Parameters:
chart- the chart to add the data todata- the data to add
-
postGenerate
protected void postGenerate(org.knowm.xchart.XYChart chart, Datasets<XYDataset> data)Hook method for after the chart has been generated.- Overrides:
postGeneratein classAbstractChartGenerator<org.knowm.xchart.XYChart,XYDataset>- Parameters:
chart- the chart to add the data todata- the data to add
-
-