Class AbstractPlotGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.plotgenerator.AbstractPlotGenerator
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AndrewsCurvesGenerator
,NamedPlotGenerator
,RowWisePlotGenerator
,SimplePlotGenerator
,XYPlotGenerator
,XYWithErrorsPlotGenerator
public abstract class AbstractPlotGenerator extends AbstractOptionHandler implements QuickInfoSupporter
Ancestor for generators that use data from a spreadsheet to create plot containers for theSequencePlotter
sink.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_DefaultCellValue
the default value for missing or non-numeric cells.protected SpreadSheetColumnRange
m_PlotNameRange
the columns that make up the plot name.protected String
m_PlotNameSeparator
the separator for the plot names.static String
MISSING_CELL_VALUE
the default string value for cells that are missing.-
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 AbstractPlotGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check(SpreadSheet sheet)
Checks the spreadsheet.String
defaultCellValueTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected abstract List<SequencePlotterContainer>
doGenerate(SpreadSheet sheet)
Performs the actual generation of containers.List<SequencePlotterContainer>
generate(SpreadSheet sheet)
Generates plot containers from the provided spreadsheet.protected String
getActualPlotName(Row row, String defValue)
Returns the plot name to use.protected Object
getCellObject(Row row, int index, Object defaultValue)
Returns the cell value for the specified column index.protected String
getCellString(Row row, int index)
Returns the string value for the specified cell.protected Comparable
getCellValue(Row row, int index)
Returns the cell value for the specified column index.protected Comparable
getCellValue(Row row, int index, Comparable defaultValue)
Returns the cell value for the specified column index.double
getDefaultCellValue()
Returns the default value for missing or non-numeric cells.String
getPlotNameRange()
Returns the current column range to use generating the plot name.String
getPlotNameSeparator()
Returns the separator to use when constructing the plot name from cell values.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.protected void
initialize()
Initializes the members.String
plotNameRangeTipText()
Returns the tip text for this property.String
plotNameSeparatorTipText()
Returns the tip text for this property.void
setDefaultCellValue(double value)
Sets the default value for missing or non-numeric cells.void
setPlotNameRange(String value)
Sets the column range to use generating the plot name.void
setPlotNameSeparator(String value)
Sets the separator to use when constructing the plot name from cell values.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
MISSING_CELL_VALUE
public static final String MISSING_CELL_VALUE
the default string value for cells that are missing.- See Also:
- Constant Field Values
-
m_DefaultCellValue
protected double m_DefaultCellValue
the default value for missing or non-numeric cells.
-
m_PlotNameRange
protected SpreadSheetColumnRange m_PlotNameRange
the columns that make up the plot name.
-
m_PlotNameSeparator
protected String m_PlotNameSeparator
the separator for the plot names.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
setDefaultCellValue
public void setDefaultCellValue(double value)
Sets the default value for missing or non-numeric cells.- Parameters:
value
- the default value
-
getDefaultCellValue
public double getDefaultCellValue()
Returns the default value for missing or non-numeric cells.- Returns:
- the default value
-
defaultCellValueTipText
public String defaultCellValueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPlotNameRange
public void setPlotNameRange(String value)
Sets the column range to use generating the plot name.- Parameters:
value
- the column range
-
getPlotNameRange
public String getPlotNameRange()
Returns the current column range to use generating the plot name.- Returns:
- the column range
-
plotNameRangeTipText
public String plotNameRangeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPlotNameSeparator
public void setPlotNameSeparator(String value)
Sets the separator to use when constructing the plot name from cell values.- Parameters:
value
- the separator
-
getPlotNameSeparator
public String getPlotNameSeparator()
Returns the separator to use when constructing the plot name from cell values.- Returns:
- the separator
-
plotNameSeparatorTipText
public String plotNameSeparatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
check
protected void check(SpreadSheet sheet)
Checks the spreadsheet.
Default implementation only checks whether any data was provided.- Parameters:
sheet
- the sheet to check
-
getCellString
protected String getCellString(Row row, int index)
Returns the string value for the specified cell.- Parameters:
row
- the row to get the cell fromindex
- the column index- Returns:
- the string value
-
getCellValue
protected Comparable getCellValue(Row row, int index, Comparable defaultValue)
Returns the cell value for the specified column index. Uses the default value if the cell is missing.- Parameters:
row
- the row to get the cell fromindex
- the column index- Returns:
- the cell value
- See Also:
m_DefaultCellValue
-
getCellObject
protected Object getCellObject(Row row, int index, Object defaultValue)
Returns the cell value for the specified column index. Uses the default value if the cell is missing.- Parameters:
row
- the row to get the cell fromindex
- the column index- Returns:
- the cell value
- See Also:
m_DefaultCellValue
-
getCellValue
protected Comparable getCellValue(Row row, int index)
Returns the cell value for the specified column index. Uses the default value if the cell is missing.- Parameters:
row
- the row to get the cell fromindex
- the column index- Returns:
- the cell value
- See Also:
m_DefaultCellValue
-
getActualPlotName
protected String getActualPlotName(Row row, String defValue)
Returns the plot name to use.- Parameters:
row
- the row to construct the name from, if necessarydefValue
- the default plot name- Returns:
- the plot name
-
doGenerate
protected abstract List<SequencePlotterContainer> doGenerate(SpreadSheet sheet)
Performs the actual generation of containers.- Parameters:
sheet
- the basis for the containers- Returns:
- the generated containers
-
generate
public List<SequencePlotterContainer> generate(SpreadSheet sheet)
Generates plot containers from the provided spreadsheet.- Parameters:
sheet
- the data to use- Returns:
- the generated containers
-
-