ptolemy.plot.plotml
Class PlotMLFrame

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

public class PlotMLFrame
extends PlotFrame

PlotMLFrame is a versatile two-dimensional data plotter that runs as part of an application, but in its own window. It can read files in the PlotML format and, for backward compatibility, the old Ptolemy plot file format. An application can also interact directly with the contained Plot object, which is visible as a public member, by invoking its methods.

An application that uses this class should set up the handling of window-closing events. Presumably, the application will exit when all windows have been closed. This is done with code something like:

plotFrameInstance.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
// Handle the event
}
});

PlotMLFrame contains an instance of PlotBox. PlotBox is the base class for classes with drawing capability, e.g. Plot, LogicAnalyzer. If not specified in the constructor, the default is to contain a Plot object. This field is set once in the constructor and immutable afterwards.

Version:
$Id: PlotMLFrame.java,v 1.4 1999/08/12 23:43:42 cxh Exp $
Author:
Christopher Hylands and Edward A. Lee
See Also:
Plot, PlotBox, Serialized Form

Fields inherited from class ptolemy.plot.PlotFrame
_directory, _editMenu, _fileMenu, _filename, _menubar, _specialMenu, plot
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
PlotMLFrame()
          Construct a plot with no command-line arguments.
PlotMLFrame(java.lang.String title)
          Construct a plot frame with the specified title and by default contains an instance of Plot.
PlotMLFrame(java.lang.String title, PlotBox plotArg)
          Construct a plot frame with the specified title and the specified instance of PlotBox.
 
Method Summary
protected  void _about()
          Display basic information about the application.
protected  void _read(java.net.URL base, java.io.InputStream in)
          Read the specified stream.
 
Methods inherited from class ptolemy.plot.PlotFrame
_close, _editFormat, _export, _help, _open, _print, _save, _saveAs, samplePlot
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, paramString, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlotMLFrame

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

PlotMLFrame

public PlotMLFrame(java.lang.String title)
Construct a plot frame with the specified title and by default contains an instance of Plot.

PlotMLFrame

public PlotMLFrame(java.lang.String title,
                   PlotBox plotArg)
Construct a plot frame with the specified title and the specified instance of PlotBox.
Method Detail

_about

protected void _about()
Display basic information about the application.
Overrides:
_about in class PlotFrame

_read

protected void _read(java.net.URL base,
                     java.io.InputStream in)
              throws java.io.IOException
Read the specified stream. This method checks to see whether the data is PlotML data, and if so, creates a parser to read it. If not, it defers to the parent class to read it. The current working directory (or the directory of the last opened or saved file) is the base for relative references.
Overrides:
_read in class PlotFrame
Parameters:
base - The base for relative file references, or null if there are not relative file references.
in - The input stream.
Throws:
java.io.IOException - If the stream cannot be read.