Class Histogram
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.spreadsheetviewer.chart.AbstractChartGenerator
-
- adams.gui.tools.spreadsheetviewer.chart.Histogram
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ColorProviderHandler
,Serializable
public class Histogram extends AbstractChartGenerator implements ColorProviderHandler
Generates histograms by plotting the X column against the Y column.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-width <int> (property: width) The width of the chart dialog. default: 800 minimum: -1
-height <int> (property: height) The height of the chart dialog. default: 600 minimum: -1
-row-finder <adams.data.spreadsheet.rowfinder.RowFinder> (property: rowFinder) The row finder to use for restricting the rows used for the chart. default: adams.data.spreadsheet.rowfinder.ByIndex
-selection <ROW|COLUMN> (property: selection) The type of data to use as basis for the histogram default: COLUMN
-rows <java.lang.String> (property: rows) The range of rows to use for the histogram, if the selection is ROW; A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders can be used as well: first, second, third, last_2, last_1, last default:
-columns <java.lang.String> (property: columns) The range of columns to use for the histogram, if selection is COLUMN; A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last default:
-histogram <adams.data.statistics.ArrayHistogram> (property: histogram) The histogram setup to use. default: adams.data.statistics.ArrayHistogram
-color-provider <adams.gui.visualization.core.ColorProvider> (property: colorProvider) The color provider to use. default: adams.gui.visualization.core.DefaultColorProvider
-bar-width <int> (property: barWidth) The width of the bar in pixel. default: 10 minimum: 1
-offset <int> (property: offset) The offset in pixel for multiple plots. default: 3 minimum: 0
- 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
Histogram.Selection
Determines how the data is selected for the histogram.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_BarWidth
the width of the bar.protected ColorProvider
m_ColorProvider
the color provider to use.protected SpreadSheetColumnRange
m_Columns
the range of columns to use.protected ArrayHistogram
m_Histogram
the histogram setup.protected int
m_Offset
the offset in case of multiple plots.protected Range
m_Rows
the range of rows to use.protected Histogram.Selection
m_Selection
what data to select.-
Fields inherited from class adams.gui.tools.spreadsheetviewer.chart.AbstractChartGenerator
m_Height, m_Width, STORAGE_NAME
-
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 Histogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addChartGeneration(Flow flow, String name, SpreadSheet sheet)
Adds the chart generation to the flow.String
barWidthTipText()
Returns the tip text for this property.String
colorProviderTipText()
Returns the tip text for this property.String
columnsTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.int
getBarWidth()
Returns the width of the bar.ColorProvider
getColorProvider()
Returns the color provider in use.String
getColumns()
Returns the current column range to use, ifHistogram.Selection.COLUMN
.ArrayHistogram
getHistogram()
Returns the histogram setup to use.int
getOffset()
Returns the offset for multiple plots.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
getRows()
Returns the range of rows to use, ifHistogram.Selection.ROW
.Histogram.Selection
getSelection()
Returns what data to use as basis for the histogram.String
globalInfo()
Returns a string describing the object.String
histogramTipText()
Returns the tip text for this property.protected void
initialize()
Initializes the members.String
offsetTipText()
Returns the tip text for this property.String
rowsTipText()
Returns the tip text for this property.String
selectionTipText()
Returns the tip text for this property.void
setBarWidth(int value)
Sets the width of the bar.void
setColorProvider(ColorProvider value)
Sets the color provider to use.void
setColumns(String value)
Sets the column range to use, ifHistogram.Selection.COLUMN
.void
setHistogram(ArrayHistogram value)
Sets the histogram setup to use.void
setOffset(int value)
Sets the offset for multiple plots.void
setRows(String value)
Sets the range of rows to use, ifHistogram.Selection.ROW
.void
setSelection(Histogram.Selection value)
Sets what data to use as basis for the histogram.-
Methods inherited from class adams.gui.tools.spreadsheetviewer.chart.AbstractChartGenerator
check, columnTypesToAxisType, columnTypesToTickGenerator, columnTypeToAxisType, columnTypeToTickGenerator, doGenerate, generate, getDefaultHeight, getDefaultWidth, getHeight, getWidth, heightTipText, setHeight, setWidth, widthTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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_Selection
protected Histogram.Selection m_Selection
what data to select.
-
m_Rows
protected Range m_Rows
the range of rows to use.
-
m_Columns
protected SpreadSheetColumnRange m_Columns
the range of columns to use.
-
m_Histogram
protected ArrayHistogram m_Histogram
the histogram setup.
-
m_ColorProvider
protected ColorProvider m_ColorProvider
the color provider to use.
-
m_BarWidth
protected int m_BarWidth
the width of the bar.
-
m_Offset
protected int m_Offset
the offset in case of multiple plots.
-
-
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 classAbstractChartGenerator
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractChartGenerator
- Returns:
- null if no info available, otherwise short string
-
setSelection
public void setSelection(Histogram.Selection value)
Sets what data to use as basis for the histogram.- Parameters:
value
- the selection
-
getSelection
public Histogram.Selection getSelection()
Returns what data to use as basis for the histogram.- Returns:
- the selection
-
selectionTipText
public String selectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRows
public void setRows(String value)
Sets the range of rows to use, ifHistogram.Selection.ROW
.- Parameters:
value
- the range
-
getRows
public String getRows()
Returns the range of rows to use, ifHistogram.Selection.ROW
.- Returns:
- the range
-
rowsTipText
public String rowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColumns
public void setColumns(String value)
Sets the column range to use, ifHistogram.Selection.COLUMN
.- Parameters:
value
- the column range
-
getColumns
public String getColumns()
Returns the current column range to use, ifHistogram.Selection.COLUMN
.- Returns:
- the column range
-
columnsTipText
public String columnsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHistogram
public void setHistogram(ArrayHistogram value)
Sets the histogram setup to use.- Parameters:
value
- the histogram
-
getHistogram
public ArrayHistogram getHistogram()
Returns the histogram setup to use.- Returns:
- the histogram
-
histogramTipText
public String histogramTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorProvider
public void setColorProvider(ColorProvider value)
Sets the color provider to use.- Specified by:
setColorProvider
in interfaceColorProviderHandler
- Parameters:
value
- the color provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider in use.- Specified by:
getColorProvider
in interfaceColorProviderHandler
- Returns:
- the color 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.
-
setBarWidth
public void setBarWidth(int value)
Sets the width of the bar.- Parameters:
value
- width in pixel
-
getBarWidth
public int getBarWidth()
Returns the width of the bar.- Returns:
- width in pixel
-
barWidthTipText
public String barWidthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffset
public void setOffset(int value)
Sets the offset for multiple plots.- Parameters:
value
- offset in pixel
-
getOffset
public int getOffset()
Returns the offset for multiple plots.- Returns:
- offset in pixel
-
offsetTipText
public String offsetTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
addChartGeneration
protected void addChartGeneration(Flow flow, String name, SpreadSheet sheet)
Adds the chart generation to the flow. The flow already contains forwarding of spreadsheet and selecting subset of rows.- Specified by:
addChartGeneration
in classAbstractChartGenerator
- Parameters:
flow
- the flow to extendname
- the name of the tab/sheetsheet
- the spreadsheet to generate the flow for
-
-