|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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
public class 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 | |
---|---|
static class |
TableauFrame.ExtensionFileFilter
File filter that filters out files that do not have one of a pre-specified list of extensions. |
(package private) class |
TableauFrame.ViewMenuListener
Listener for view menu commands. |
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private static java.awt.Image |
_defaultIconImage
|
private TableauFactory |
_factoryContainer
|
protected java.lang.String |
_initialSaveAsFileName
The initial filename to use in the SaveAs dialog. |
private boolean |
_packCalled
Set to true when the pack() method is called. |
private Placeable |
_placeable
Associated placeable. |
private Tableau |
_tableau
|
private TopPack |
_topPack
Set in pack() if an alternate topPack is used. |
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. |
|
TableauFrame(Tableau tableau,
StatusBar statusBar,
Placeable placeable)
Construct an empty top-level frame managed by the specified tableau with the specified status bar and associated Placeable object. |
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. |
private boolean |
_checkForDerivedObjects()
If the model has children, then issue a warning that those children will persist in modified form. |
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 boolean |
_saveAs(java.lang.String extension)
Query the user for a filename, save the model to that file, and open a new window to view the model. |
protected java.net.URL |
_saveAsHelper(java.lang.String extension)
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. |
TopPack |
getAlternateTopPack()
Get the alternative pack() interface for the ptolemy.gui.Top JFrame. |
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 |
pack()
Optionally invoke an alternative pack() method. |
void |
printPDF()
If a PDF printer is available print to it. |
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, _createFileMenuItems, _getCurrentDirectory, _open, _openURL, _print, _printCrossPlatform, _printNative, _printPDF, _queryForSave, _saveAsFileDialog, centerOnScreen, close, deferIfNecessary, getCentering, hideMenuBar, isMenuPopulated, report, report, report, setBackground, setCentering, setDirectory, 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, setIconImage, 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, 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, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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
private TableauFactory _factoryContainer
private Tableau _tableau
private static java.awt.Image _defaultIconImage
private Placeable _placeable
private boolean _packCalled
private TopPack _topPack
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.public TableauFrame(Tableau tableau, StatusBar statusBar, Placeable placeable)
tableau
- The managing tableau.statusBar
- The status bar, or null to not include one.placeable
- The associated Placeable.Method Detail |
---|
public TopPack getAlternateTopPack()
pack()
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()
setTableau(Tableau)
public boolean isModified()
isModified
in class Top
public void setModified(boolean modified)
setModified
in class Top
modified
- True if the data has been modified.public void setTableau(Tableau tableau)
tableau
- The tableau associated with this frame.getTableau()
public void pack()
TopPack.pack(Top, boolean)
is called.
If the _alternateTopPackClass attribute is not set or set
improperly, then Top.pack() is called from this method.
pack
in class Top
public void printPDF() throws java.awt.print.PrinterException
java.awt.print.PrinterException
- If a printer with the string "PDF"
cannot be found or if the job cannot be set to the PDF print
service or if there is another problem printing.protected void _about()
_about
in class Top
protected void _addMenus()
If the configuration has a _disableFileNew parameter that is set to true, then we do not populate the File->New menu.
_addMenus
in class Top
protected 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.MalformedURLException
- If the file cannot be converted
to a URL.protected void _exit()
_exit
in class Top
Tableau.close()
protected java.awt.Image _getDefaultIconImage()
protected java.lang.String _getName()
_getName
in class Top
protected void _help()
_help
in class Top
FileParameter
protected void _read(java.net.URL url) throws java.lang.Exception
_read
in class Top
url
- 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 Top
protected boolean _saveAs()
_saveAs
in class Top
protected boolean _saveAs(java.lang.String extension)
extension
- If non-null, then the extension that is
appended to the file name if there is no extension.
protected java.net.URL _saveAsHelper(java.lang.String extension)
extension
- If non-null, then the extension that is
appended to the file name if there is no extension.
protected void _writeFile(java.io.File file) throws java.io.IOException
_writeFile
in class Top
file
- The file to write to.
java.io.IOException
- If the write fails.private boolean _checkForDerivedObjects()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |