adams.core.gnuplot
Class Initialize

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.Initialize
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable

public class Initialize
extends AbstractScriptlet

Initializes the plotting.

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: .
 
-terminal <java.lang.String> (property: terminal)
    The terminal to use: e.g., 'x11', 'gif', 'png', 'svg'; for any terminal
    type apart from 'x11', an output file needs to be supplied.
    default: x11
 
-output <adams.core.io.PlaceholderFile> (property: outputFile)
    The output file to use if terminal other than 'x11' is used.
    default: .
 
-title <java.lang.String> (property: title)
    The title to use for the plot.
    default:
 
-x-label <java.lang.String> (property: XLabel)
    The title for the X axis; gets ignored if empty.
    default:
 
-y-label <java.lang.String> (property: YLabel)
    The title for the Y axis; gets ignored if empty.
    default:
 
-z-label <java.lang.String> (property: ZLabel)
    The title for the Z axis; gets ignored if empty.
    default:
 

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

Field Summary
protected  PlaceholderFile m_OutputFile
          the output file if not 'x11' as terminal.
protected  String m_Terminal
          the terminal to use.
protected  String m_Title
          the plot title.
protected  String m_XLabel
          the title of the X axis.
protected  String m_YLabel
          the title of the Y axis.
protected  String m_ZLabel
          the title of the Z axis.
static String TERMINAL_X11
          the 'x11' terminal.
 
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
Initialize()
           
 
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.
 PlaceholderFile getOutputFile()
          Returns the output file in use (if not x11 as terminal).
 String getTerminal()
          Returns the terminal to use.
 String getTitle()
          Returns the title to use.
 String getXLabel()
          Returns the title for the X axis.
 String getYLabel()
          Returns the title for the Y axis.
 String getZLabel()
          Returns the title for the Z axis.
 String globalInfo()
          Returns a string describing the object.
 String outputFileTipText()
          Returns the tip text for this property.
 void setOutputFile(PlaceholderFile value)
          Sets the output file to use (if not x11 as terminal).
 void setTerminal(String value)
          Sets the terminal to use.
 void setTitle(String value)
          Sets the title to use.
 void setXLabel(String value)
          Sets the title for the X axis.
 void setYLabel(String value)
          Sets the title for the Y axis.
 void setZLabel(String value)
          Sets the title for the Z axis.
 String terminalTipText()
          Returns the tip text for this property.
 String titleTipText()
          Returns the tip text for this property.
 String XLabelTipText()
          Returns the tip text for this property.
 String YLabelTipText()
          Returns the tip text for this property.
 String ZLabelTipText()
          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

TERMINAL_X11

public static final String TERMINAL_X11
the 'x11' terminal.

See Also:
Constant Field Values

m_Terminal

protected String m_Terminal
the terminal to use.


m_OutputFile

protected PlaceholderFile m_OutputFile
the output file if not 'x11' as terminal.


m_Title

protected String m_Title
the plot title.


m_XLabel

protected String m_XLabel
the title of the X axis.


m_YLabel

protected String m_YLabel
the title of the Y axis.


m_ZLabel

protected String m_ZLabel
the title of the Z axis.

Constructor Detail

Initialize

public Initialize()
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

setTerminal

public void setTerminal(String value)
Sets the terminal to use.

Parameters:
value - the terminal type

getTerminal

public String getTerminal()
Returns the terminal to use.

Returns:
the terminal type

terminalTipText

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

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

setOutputFile

public void setOutputFile(PlaceholderFile value)
Sets the output file to use (if not x11 as terminal).

Parameters:
value - the output file

getOutputFile

public PlaceholderFile getOutputFile()
Returns the output file in use (if not x11 as terminal).

Returns:
the output file

outputFileTipText

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

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

setTitle

public void setTitle(String value)
Sets the title to use.

Parameters:
value - the title type

getTitle

public String getTitle()
Returns the title to use.

Returns:
the title type

titleTipText

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

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

setXLabel

public void setXLabel(String value)
Sets the title for the X axis.

Parameters:
value - the title

getXLabel

public String getXLabel()
Returns the title for the X axis.

Returns:
the title

XLabelTipText

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

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

setYLabel

public void setYLabel(String value)
Sets the title for the Y axis.

Parameters:
value - the title

getYLabel

public String getYLabel()
Returns the title for the Y axis.

Returns:
the title

YLabelTipText

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

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

setZLabel

public void setZLabel(String value)
Sets the title for the Z axis.

Parameters:
value - the title

getZLabel

public String getZLabel()
Returns the title for the Z axis.

Returns:
the title

ZLabelTipText

public String ZLabelTipText()
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.

Makes sure that the output file (if terminal is not x11) is not a directory.

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.