adams.core.gnuplot
Class MultiScriptlet

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.core.gnuplot.AbstractScriptlet
              extended by adams.core.gnuplot.MultiScriptlet
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable

public class MultiScriptlet
extends AbstractScriptlet

Allows the user to chain multiple scriplets together.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to
    the console (0 = off).
    default: 0
    minimum: 0
 
-data-file <adams.core.io.PlaceholderFile> (property: dataFile)
    The data file to use as basis for the plot.
    default: .
 
-scriptlet <adams.core.gnuplot.AbstractScriptlet> [-scriptlet ...] (property: scriptlets)
    The scriplets to use for producing a single script.
    default:
 
-use-single-data-file (property: useSingleDataFile)
    If enabled, all sub-scriptlets get automatically updated to use this scriptlets
    data file.
 

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

Field Summary
protected  AbstractScriptlet[] m_Scriptlets
          the custom script code.
protected  boolean m_UseSingleDataFile
          whether to enforce all scriptlets to use the same data file.
 
Fields inherited from class adams.core.gnuplot.AbstractScriptlet
COMMENT, m_DataFile, m_LastError
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
MultiScriptlet()
           
 
Method Summary
 String check()
          Hook method for performing checks.
 void defineOptions()
          Adds options to the internal list of options.
protected  String doGenerate()
          Generates the actual script code.
 AbstractScriptlet[] getScriptlets()
          Returns the scriptlets in use.
 boolean getUseSingleDataFile()
          Returns whether to use a single data file only.
 String globalInfo()
          Returns a string describing the object.
 String scriptletsTipText()
          Returns the tip text for this property.
 void setScriptlets(AbstractScriptlet[] value)
          Sets the scriptlets to use.
 void setUseSingleDataFile(boolean value)
          Sets whether to use a single data file only.
 String useSingleDataFileTipText()
          Returns the tip text for this property.
 
Methods inherited from class adams.core.gnuplot.AbstractScriptlet
dataFileTipText, generate, getDataFile, getLastError, hasLastError, reset, setDataFile
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, 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
 

Field Detail

m_Scriptlets

protected AbstractScriptlet[] m_Scriptlets
the custom script code.


m_UseSingleDataFile

protected boolean m_UseSingleDataFile
whether to enforce all scriptlets to use the same data file.

Constructor Detail

MultiScriptlet

public MultiScriptlet()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
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 interface OptionHandler
Overrides:
defineOptions in class AbstractScriptlet

setScriptlets

public void setScriptlets(AbstractScriptlet[] value)
Sets the scriptlets to use.

Parameters:
value - the scriptlets

getScriptlets

public AbstractScriptlet[] getScriptlets()
Returns the scriptlets in use.

Returns:
the scriptlets

scriptletsTipText

public String scriptletsTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setUseSingleDataFile

public void setUseSingleDataFile(boolean value)
Sets whether to use a single data file only.

Parameters:
value - if true only a single data file is used

getUseSingleDataFile

public boolean getUseSingleDataFile()
Returns whether to use a single data file only.

Returns:
true if only a single data file is used

useSingleDataFileTipText

public String useSingleDataFileTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

check

public String check()
Hook method for performing checks.

Calls the check() methods of all scriptlets.

Overrides:
check in class AbstractScriptlet
Returns:
null if all checks passed, otherwise error message

doGenerate

protected String doGenerate()
Generates the actual script code.

Specified by:
doGenerate in class AbstractScriptlet
Returns:
the script code, null in case of an error


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