public class TableauFrame extends Top
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) |
Modifier and Type | Class and Description |
---|---|
protected static class |
TableauFrame.ExtensionFileFilter
Deprecated.
Use diva.gui.ExtensionFileFilter or javax.swing.filechooser.FileNameExtensionFilter
|
protected static class |
TableauFrame.MenuItemListener
A Listener for menu items.
|
(package private) class |
TableauFrame.ViewMenuListener
Listener for view menu commands.
|
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_initialSaveAsFileName
The initial filename to use in the SaveAs dialog.
|
protected 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.
|
_CANCELED, _debugClosing, _directory, _DISCARDED, _exitResult, _EXPORT_MENU_INDEX, _FAILED, _fileFilter, _fileMenu, _fileMenuItems, _filenameFilter, _helpMenu, _helpMenuItems, _IMPORT_MENU_INDEX, _menubar, _NEW_MENU_INDEX, _SAVED, _statusBar
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
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.
|
TableauFrame(Tableau tableau,
StatusBar statusBar,
PortablePlaceable portablePlaceable)
Construct an empty top-level frame managed by the specified
tableau with the specified status bar and associated PortablePlaceable
object.
|
Modifier and Type | Method and Description |
---|---|
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 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.
|
void |
dispose()
Dispose of this frame.
|
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.
|
_clear, _createFileMenuItems, _getCurrentDirectory, _open, _openURL, _populateHistory, _print, _printCrossPlatform, _printNative, _printPDF, _queryForSave, _saveAsFileDialog, _saveAsFileDialogComponent, _saveAsJFileChooserComponent, _updateHistory, about, centerOnScreen, close, deferIfNecessary, exit, getCentering, getContentSize, hideMenuBar, isDisposed, isMenuPopulated, report, report, report, setBackground, setCentering, setDirectory, show
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public java.lang.String aboutFile
public java.lang.String helpFile
protected java.lang.String _initialSaveAsFileName
protected javax.swing.JMenu _viewMenu
protected TopPack _topPack
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.public TableauFrame(Tableau tableau, StatusBar statusBar, PortablePlaceable portablePlaceable)
tableau
- The managing tableau.statusBar
- The status bar, or null to not include one.portablePlaceable
- The associated PortablePlaceable.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.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()
protected void _addMenus()
If the configuration has a _disableFileNew parameter that is set to true, then we do not populate the File->New menu.
protected boolean _close()
public void dispose()
Override this dispose() method to unattach any listeners that may keep
this model from getting garbage collected. This method invokes the
dispose() method of the superclass,
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()
protected void _help()
_help
in class Top
FileParameter
protected void _read(java.net.URL url) throws java.lang.Exception
protected boolean _save()
protected boolean _saveAs()
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.