All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ptolemy.plot.PlotApplication

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----ptolemy.plot.PlotFrame
                                           |
                                           +----ptolemy.plot.PlotApplication

public class PlotApplication
extends PlotFrame
PlotApplication is a versatile two-dimensional data plotter application. It can read files compatible with the Ptolemy plot file format (currently only ASCII). For a description of the file format, see the Plot and PlotBox classes. Command-line options include:
-help
Display the usage, including all command-line options that exist for backward compatibility.
-test
Display the plot, then exit after 2 seconds.
-version
Display the program version.

For compatibility with historical applications, this application has a limited ability to read pxgraph files. The command line arguments must be used, and the options that are understood are exactly those of the pxgraph application, plus some more to allow for cross-platform reading. It is not possible to read pxgraph files using the "Open" menu command (because of the cross-platform problems). The additional command-line arguments are:

-bigendian
Data files are in big-endian, or network binary format. If you are on a little-endian machine, such as a machine with an Intel x86 chip, and you would like to read a binary format file created on a big-endian machine, such as a Sun SPARC, use the -bigendian flag.
-littleendian
Data files are in little-endian, or x86 binary format. If you are on a big-endian machine, such as a Sun Sparc, and you would like to read a binary format file created on a little-endian machine, such as Intel x86 machine, then use the -littleendian flag.

To compile and run this application, do the following (in Unix):

setenv CLASSPATH ../..
javac PlotApplication.java
java ptolemy.plot.PlotApplication
or in a bash shell in Windows NT:
CLASSPATH=../..
export CLASSPATH
javac PlotApplication.java
java ptolemy.plot.PlotApplication
This assumes a particular directory structure. If this is not what you have, then alter the above accordingly.

Version:
$Id: PlotApplication.java,v 1.6 1998/11/20 01:12:09 cxh Exp $
Author:
Christopher Hylands and Edward A. Lee
See Also:
Plot, PlotBox

Constructor Index

 o PlotApplication()
Construct a plot with no command-line arguments.
 o PlotApplication(String[])
Construct a plot with the specified command-line arguments.

Method Index

 o _about()
Display basic information about the application.
 o _close()
Exit the application.
 o _help()
Display more detailed information than given by _about().
 o _parseArgs(String[])
Parse the command-line arguments and make calls to the Plot class accordingly.
 o _usage()
Return a string summarizing the command-line arguments.
 o main(String[])
Create a new plot window and map it to the screen.

Constructors

 o PlotApplication
 public PlotApplication()
Construct a plot with no command-line arguments. It initially displays a sample plot.

 o PlotApplication
 public PlotApplication(String args[])
Construct a plot with the specified command-line arguments.

Parameters:
args - The command-line arguments.

Methods

 o main
 public static void main(String args[])
Create a new plot window and map it to the screen.

 o _about
 protected void _about()
Display basic information about the application.

Overrides:
_about in class PlotFrame
 o _close
 protected void _close()
Exit the application.

Overrides:
_close in class PlotFrame
 o _help
 protected void _help()
Display more detailed information than given by _about().

Overrides:
_help in class PlotFrame
 o _parseArgs
 protected int _parseArgs(String args[]) throws CmdLineArgException, FileNotFoundException, IOException
Parse the command-line arguments and make calls to the Plot class accordingly.

Returns:
The number of arguments read.
Throws: CmdLineArgException
If a command line argument cannot be parsed.
Throws: FileNotFoundException
If an input file cannot be found.
Throws: IOException
If there is a problem reading an input.
 o _usage
 protected String _usage()
Return a string summarizing the command-line arguments.

Returns:
A usage string.

All Packages  Class Hierarchy  This Package  Previous  Next  Index