|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
ptolemy.gui.Top
ptolemy.actor.gui.TableauFrame
This is a top-level window associated with a tableau that has a menubar and status bar. Derived classes should add components to the content pane using a line like:
getContentPane().add(component, BorderLayout.CENTER);The base class provides generic features for menubars and toolbars, and this class specializes the base class for Ptolemy II.
A help menu is provided with two entries, About and Help. In both cases, an HTML file is opened. The configuration can specify which HTML file to open by containing an instance of FileParameter with name "_about" or "_help". The value of this attribute is a file name (which may begin with the keywords $CLASSPATH or $PTII to specify that the file is located relative to the CLASSPATH or to the Ptolemy II installation directory).
| Yellow (celaine) |
| Green (eal) |
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
| Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
protected java.lang.String |
_initialSaveAsFileName
The initial filename to use in the SaveAs dialog |
protected javax.swing.JMenu |
_viewMenu
The view menu. |
java.lang.String |
aboutFile
The name of the default file to open when About is invoked. |
java.lang.String |
helpFile
The name of the default file to open when Help is invoked. |
| Fields inherited from class ptolemy.gui.Top |
_CANCELED, _directory, _DISCARDED, _FAILED, _fileFilter, _fileMenu, _fileMenuItems, _helpMenu, _helpMenuItems, _menubar, _SAVED, _statusBar |
| Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, 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 |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
TableauFrame()
Construct an empty top-level frame. |
|
TableauFrame(Tableau tableau)
Construct an empty top-level frame managed by the specified tableau and the default status bar. |
|
TableauFrame(Tableau tableau,
StatusBar statusBar)
Construct an empty top-level frame managed by the specified tableau with the specified status bar. |
|
| Method Summary | |
protected void |
_about()
Override the base class to open the intro.htm splash window, which is in the directory ptolemy/configs. |
protected void |
_addMenus()
Add a View menu and items to the File:New menu if a tableau was given in the constructor. |
protected boolean |
_close()
Close the window. |
protected boolean |
_confirmFile(Entity model,
java.io.File file)
Confirm that writing the specified model to the specified file is OK. |
protected void |
_exit()
Close all open tableaux, querying the user as necessary to save data, and then exit the application. |
protected java.awt.Image |
_getDefaultIconImage()
Return the default icon image, or null if there is none. |
protected java.lang.String |
_getName()
Get the name of this object, which in this class is the URI associated with the effigy, or the string "Unnamed" if none. |
protected void |
_help()
Display the help file given by the configuration, or if there is none, then the file specified by the public variable helpFile. |
protected void |
_read(java.net.URL url)
Read the specified URL. |
protected boolean |
_save()
Save the model to the current file, determined by the uri parameter of the associated effigy, or if that has not been set or is not a writable file, or if the effigy has been set non-modifiable, then invoke _saveAs(). |
protected boolean |
_saveAs()
Query the user for a filename, save the model to that file, and open a new window to view the model. |
protected void |
_writeFile(java.io.File file)
Write the model to the specified file. |
Configuration |
getConfiguration()
Get the configuration at the top level of the hierarchy. |
ModelDirectory |
getDirectory()
Get the model directory in the top level configuration. |
Effigy |
getEffigy()
Get the effigy for the model associated with this window. |
PtolemyEffigy |
getEffigy(NamedObj model)
Get the effigy for the specified Ptolemy model. |
Tableau |
getTableau()
Get the tableau associated with this frame. |
boolean |
isModified()
Return true if the data associated with this window has been modified since it was first read or last saved. |
void |
setModified(boolean modified)
Record whether the data associated with this window has been modified since it was first read or last saved. |
void |
setTableau(Tableau tableau)
Set the tableau associated with this frame. |
| Methods inherited from class ptolemy.gui.Top |
_clear, _open, _openURL, _print, _queryForSave, _saveAsFileDialog, centerOnScreen, close, deferIfNecessary, getCentering, pack, report, report, report, setBackground, setCentering, show |
| Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
public java.lang.String aboutFile
public java.lang.String helpFile
protected java.lang.String _initialSaveAsFileName
protected javax.swing.JMenu _viewMenu
| Constructor Detail |
public TableauFrame()
public TableauFrame(Tableau tableau)
tableau - The managing tableau.
public TableauFrame(Tableau tableau,
StatusBar statusBar)
tableau - The managing tableau.statusBar - The status bar, or null to not include one.| Method Detail |
public Configuration getConfiguration()
public ModelDirectory getDirectory()
public Effigy getEffigy()
public PtolemyEffigy getEffigy(NamedObj model)
model - The model for which an effigy is desired.
public Tableau getTableau()
public boolean isModified()
isModified in class Toppublic void setModified(boolean modified)
setModified in class Topmodified - True if the data has been modified.public void setTableau(Tableau tableau)
tableau - The tableau associated with this frame.protected void _about()
_about in class Topprotected void _addMenus()
_addMenus in class Topprotected boolean _close()
_close in class Top
protected boolean _confirmFile(Entity model,
java.io.File file)
throws java.net.MalformedURLException
model - The model to write to the file, or null specify
that this will be delegated to the effigy associated with this
tableau.file - The file to write to.
java.net.MalformedURLExceptionprotected void _exit()
_exit in class TopTableau.close()protected java.awt.Image _getDefaultIconImage()
protected java.lang.String _getName()
_getName in class Topprotected void _help()
_help in class TopFileParameter
protected void _read(java.net.URL url)
throws java.lang.Exception
_read in class Topurl - The URL to read.
java.lang.Exception - If the URL cannot be read, or if there is no
tableau.protected boolean _save()
_save in class Topprotected boolean _saveAs()
_saveAs in class Top
protected void _writeFile(java.io.File file)
throws java.io.IOException
_writeFile in class Topfile - The file to write to.
java.io.IOException - If the write fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||