Package adams.gui.core.spreadsheettable
Class JFreeChart
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.core.spreadsheettable.JFreeChart
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,PlotColumn,PlotRow,PlotSelectedRows,SpreadSheetTablePopupMenuItem,TableRowRangeCheck,Serializable,Comparable<SpreadSheetTablePopupMenuItem>
public class JFreeChart extends AbstractOptionHandler implements PlotColumn, PlotRow, PlotSelectedRows
Allows to create a JFreeChart plot of a column or row.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_COLUMNSstatic StringKEY_PLOTstatic intMAX_POINTSthe maximum of data points to plot.-
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 JFreeChart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(SpreadSheetTablePopupMenuItem o)For sorting the menu items.protected voidcreatePlot(SpreadSheetTable table, boolean isColumn, SpreadSheet data, String title, int[] spRows)Plots the data.StringgetIconName()Returns the name of the icon.StringgetMenuItem()Returns the name for the menu item.StringglobalInfo()Returns a string describing the object.booleanhandlesRowRange(TableRowRange range)Checks whether the row range can be handled.intmaxNumRows()Returns the maximum number of rows that the plugin requires.intminNumRows()Returns the minimum number of rows that the plugin requires.protected voidplot(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isColumn, int index, int[] indices)Allows the user to generate a plot from either a row or a column.booleanplotColumn(SpreadSheetTablePopupMenuItemHelper.TableState state)Plots the specified column.booleanplotRow(SpreadSheetTablePopupMenuItemHelper.TableState state)Plots the specified row.booleanplotSelectedRows(SpreadSheetTablePopupMenuItemHelper.TableState state)Plots the specified row.protected PropertiespromptParameters(SpreadSheetTable table, boolean isColumn)Prompts the user to configure the parameters.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, 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
-
KEY_COLUMNS
public static final String KEY_COLUMNS
- See Also:
- Constant Field Values
-
KEY_PLOT
public static final String KEY_PLOT
- See Also:
- Constant Field Values
-
MAX_POINTS
public static final int MAX_POINTS
the maximum of data points to plot.- See Also:
- Constant Field Values
-
-
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
-
getMenuItem
public String getMenuItem()
Returns the name for the menu item.- Specified by:
getMenuItemin interfaceSpreadSheetTablePopupMenuItem- Returns:
- the name
-
getIconName
public String getIconName()
Returns the name of the icon.- Specified by:
getIconNamein interfaceSpreadSheetTablePopupMenuItem- Returns:
- the name, null if none available
-
compareTo
public int compareTo(SpreadSheetTablePopupMenuItem o)
For sorting the menu items.- Specified by:
compareToin interfaceComparable<SpreadSheetTablePopupMenuItem>- Parameters:
o- the other item- Returns:
- -1 if less than, 0 if equal, +1 if larger than this menu item name
-
handlesRowRange
public boolean handlesRowRange(TableRowRange range)
Checks whether the row range can be handled.- Specified by:
handlesRowRangein interfaceTableRowRangeCheck- Parameters:
range- the range to check- Returns:
- true if handled
-
promptParameters
protected Properties promptParameters(SpreadSheetTable table, boolean isColumn)
Prompts the user to configure the parameters.- Parameters:
table- the table to do this forisColumn- whether column or row(s)- Returns:
- the parameters, null if cancelled
-
createPlot
protected void createPlot(SpreadSheetTable table, boolean isColumn, SpreadSheet data, String title, int[] spRows)
Plots the data.- Parameters:
table- the table this is forisColumn- whether this is for a column or for row(s)data- the data to plottitle- the title of the plotspRows- the spreadsheet rows, can be null
-
plot
protected void plot(SpreadSheetTablePopupMenuItemHelper.TableState state, boolean isColumn, int index, int[] indices)
Allows the user to generate a plot from either a row or a column.- Parameters:
state- the table stateisColumn- whether the to use column or row
-
plotColumn
public boolean plotColumn(SpreadSheetTablePopupMenuItemHelper.TableState state)
Plots the specified column.- Specified by:
plotColumnin interfacePlotColumn- Parameters:
state- the source table- Returns:
- true if successful
-
plotRow
public boolean plotRow(SpreadSheetTablePopupMenuItemHelper.TableState state)
Plots the specified row.
-
minNumRows
public int minNumRows()
Returns the minimum number of rows that the plugin requires.- Specified by:
minNumRowsin interfacePlotSelectedRows- Returns:
- the minimum
-
maxNumRows
public int maxNumRows()
Returns the maximum number of rows that the plugin requires.- Specified by:
maxNumRowsin interfacePlotSelectedRows- Returns:
- the maximum, -1 for none
-
plotSelectedRows
public boolean plotSelectedRows(SpreadSheetTablePopupMenuItemHelper.TableState state)
Plots the specified row.- Specified by:
plotSelectedRowsin interfacePlotSelectedRows- Parameters:
state- the table state- Returns:
- true if successful
-
-