adams.gui.tools.spreadsheetviewer
Class AbstractViewPlugin

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.gui.tools.spreadsheetviewer.AbstractViewPlugin
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, ShallowCopySupporter<AbstractViewPlugin>, SizeOfHandler, Serializable
Direct Known Subclasses:
Statistics

public abstract class AbstractViewPlugin
extends AbstractOptionHandler
implements ShallowCopySupporter<AbstractViewPlugin>

Ancestor for "information" plugins in the spreadsheet viewer.

Version:
$Revision: 6187 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractViewPlugin()
           
 
Method Summary
protected  String check(SpreadSheet sheet)
          Checks the spreadsheet.
protected abstract  BasePanel doGenerate(SpreadSheet sheet)
          Performs the actual generation of the information.
 BasePanel generate(SpreadSheet sheet)
          Processes the spreadsheet.
abstract  String getMenuIcon()
          Returns the file name of the icon.
abstract  String getMenuText()
          Returns the text of the menu item.
static String[] getPlugins()
          Returns a list with classnames of plugins.
 AbstractViewPlugin shallowCopy()
          Returns a shallow copy of itself, i.e., based on the commandline options.
 AbstractViewPlugin shallowCopy(boolean expand)
          Returns a shallow copy of itself, i.e., based on the commandline options.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractViewPlugin

public AbstractViewPlugin()
Method Detail

getMenuText

public abstract String getMenuText()
Returns the text of the menu item.

Returns:
the text

getMenuIcon

public abstract String getMenuIcon()
Returns the file name of the icon.

Returns:
the filename or null if no icon available

check

protected String check(SpreadSheet sheet)
Checks the spreadsheet.

Default implementation only checks whether data was provided.

Parameters:
sheet - the spreadsheet to check
Returns:
null if check passed, otherwise error message

doGenerate

protected abstract BasePanel doGenerate(SpreadSheet sheet)
Performs the actual generation of the information.

Parameters:
sheet - the sheet to process
Returns:
the generated information panel

generate

public BasePanel generate(SpreadSheet sheet)
Processes the spreadsheet.

Parameters:
sheet - the sheet to process
Returns:
the generated information panel
Throws:
IllegalArgumentException - if the check failed
See Also:
check(SpreadSheet)

shallowCopy

public AbstractViewPlugin shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.

Specified by:
shallowCopy in interface ShallowCopySupporter<AbstractViewPlugin>
Returns:
the shallow copy

shallowCopy

public AbstractViewPlugin shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.

Specified by:
shallowCopy in interface ShallowCopySupporter<AbstractViewPlugin>
Parameters:
expand - whether to expand variables to their current values
Returns:
the shallow copy

getPlugins

public static String[] getPlugins()
Returns a list with classnames of plugins.

Returns:
the plugin classnames


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.