|
|||||||||
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
ptolemy.actor.gui.HTMLViewer
ptolemy.vergil.actor.DocViewer
public class DocViewer
This class defines a specialized window for displaying Ptolemy II actor documentation. The three versions of the constructor offer mechanisms to display documentation for a particular actor instance or a specified actor class name, or to display a specified documentation file. The documentation file is expected to be an XML file using the DocML schema, as defined in the DocManager class.
DocManager
,
Serialized Form
Red (cxh) |
Yellow (eal) |
Nested Class Summary | |
---|---|
private class |
DocViewer.BuildMenuListener
Listener for build menu commands. |
Nested classes/interfaces inherited from class ptolemy.actor.gui.TableauFrame |
---|
TableauFrame.ExtensionFileFilter |
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 java.lang.String |
_applicationName
The name of the application, usually from the _applicationName StringAttribute in configuration.xml. |
private static int |
_AUTHOR_WINDOW_WIDTH
Author window width. |
private static int |
_BOTTOM_HEIGHT
Bottom window height. |
private Configuration |
_configuration
The configuration specified in the constructor. |
private static int |
_DESCRIPTION_WIDTH
Width of the description pane. |
private java.awt.Font |
_font
The font to use for No icon available message. |
private GraphPane |
_graphPane
The graph pane. |
private static java.lang.String |
_HTML_HEADER
HTML Header information. |
private static java.lang.String |
_HTML_TAIL
|
private static int |
_ICON_WINDOW_HEIGHT
Icon window width. |
private static int |
_ICON_WINDOW_WIDTH
Icon window width. |
private CompositeEntity |
_iconContainer
The composite entity containing the icon. |
private JGraph |
_jgraph
The jgraph. |
private static int |
_MAIN_WINDOW_HEIGHT
Main window height. |
private static int |
_MAIN_WINDOW_WIDTH
Main window width. |
private static int |
_PADDING
Padding in icon window. |
private static int |
_SEE_ALSO_WIDTH
Width of the see also pane. |
private static int |
_SPACING
Spacing between subwindows. |
private static java.lang.String |
_tableClosing
|
private static java.lang.String |
_tableOpening
|
private NamedObj |
_target
The target given in the constructor, if any. |
private static java.lang.String |
_td
|
private static java.lang.String |
_td20
|
private static java.lang.String |
_tdColSpan
|
private static java.lang.String |
_tde
|
private static java.lang.String |
_tr
|
private static java.lang.String |
_tre
|
Fields inherited from class ptolemy.actor.gui.HTMLViewer |
---|
_scroller, pane |
Fields inherited from class ptolemy.actor.gui.TableauFrame |
---|
_initialSaveAsFileName, _viewMenu, aboutFile, helpFile |
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 java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
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 | |
---|---|
DocViewer(NamedObj target,
Configuration configuration)
Construct a documentation viewer for the specified target. |
|
DocViewer(java.lang.String className,
Configuration configuration)
Construct a documentation viewer for the specified class name. |
|
DocViewer(java.net.URL url,
Configuration configuration)
Construct a documentation viewer for the specified documentation file. |
Method Summary | |
---|---|
protected void |
_addMainPane()
Override the base class to do nothing. |
protected void |
_addMenus()
Add a Build menu item. |
private void |
_adjustIconDisplay(NamedObj sample,
CompositeEntity container,
GraphPane graphPane,
JGraph jgraph)
Adjust the icon display for the specified target. |
private java.lang.String |
_colorizeRating(java.lang.String rating)
Return HTML that colorizes the rating text. |
private java.lang.String |
_getParameterEntries(NamedObj target,
DocManager manager)
Return a string with parameter table entries. |
private java.lang.String |
_getPortEntries(NamedObj target,
DocManager manager)
Return a string with port table entries. |
private java.lang.String |
_getPortParameterEntries(NamedObj target,
DocManager manager)
Return a string with port-parameter table entries. |
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. |
private void |
_includeClassDefinitions(NamedObj target,
java.lang.StringBuffer buffer)
Append to the specified buffer any locally defined base classes that are needed to define the specified target. |
private void |
_init(NamedObj target,
Configuration configuration,
java.lang.String className,
java.net.URL url)
Construct a documentation viewer for the specified target, class name, or URL. |
private void |
_populatePortsAndParametersTable(NamedObj target,
DocManager manager)
Populate the window displaying ports and parameters. |
protected void |
_setScrollerSize(int width,
int height)
Override the base class to do nothing. |
Configuration |
getConfiguration()
Get the configuration specified in the constructor. |
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent event)
Override the base class to react to links of the form #parentClass. |
Methods inherited from class ptolemy.actor.gui.HTMLViewer |
---|
_writeFile, getPage, print, setBase, setPage, setSize, setText |
Methods inherited from class ptolemy.actor.gui.TableauFrame |
---|
_about, _close, _confirmFile, _exit, _getDefaultIconImage, _getName, _read, _save, _saveAs, _saveAs, _saveAsHelper, getAlternateTopPack, getDirectory, getEffigy, getEffigy, getTableau, isModified, pack, printPDF, setModified, setTableau |
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, 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 |
---|
private java.lang.String _applicationName
private static int _AUTHOR_WINDOW_WIDTH
private Configuration _configuration
private static int _BOTTOM_HEIGHT
private static int _DESCRIPTION_WIDTH
private java.awt.Font _font
private GraphPane _graphPane
private static java.lang.String _HTML_HEADER
private static java.lang.String _HTML_TAIL
private CompositeEntity _iconContainer
private static int _ICON_WINDOW_HEIGHT
private static int _ICON_WINDOW_WIDTH
private JGraph _jgraph
private static int _MAIN_WINDOW_HEIGHT
private static int _MAIN_WINDOW_WIDTH
private static int _PADDING
private static int _SEE_ALSO_WIDTH
private static int _SPACING
private NamedObj _target
private static java.lang.String _tr
private static java.lang.String _tre
private static java.lang.String _td
private static java.lang.String _td20
private static java.lang.String _tdColSpan
private static java.lang.String _tde
private static java.lang.String _tableOpening
private static java.lang.String _tableClosing
Constructor Detail |
---|
public DocViewer(NamedObj target, Configuration configuration)
target
- The object to get documentation for.configuration
- The configuration in charge of this viewer.public DocViewer(java.lang.String className, Configuration configuration) throws java.lang.ClassNotFoundException
className
- The class name to get documentation for.configuration
- The configuration in charge of this viewer.
java.lang.ClassNotFoundException
- If the class cannot be found.public DocViewer(java.net.URL url, Configuration configuration)
url
- The URL at which to find the documentation.configuration
- The configuration in charge of this viewer.Method Detail |
---|
public Configuration getConfiguration()
getConfiguration
in class TableauFrame
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent event)
hyperlinkUpdate
in interface javax.swing.event.HyperlinkListener
hyperlinkUpdate
in class HTMLViewer
event
- The hyperlink event.protected void _addMainPane()
_addMainPane
in class HTMLViewer
protected void _help()
_help
in class TableauFrame
FileParameter
protected void _setScrollerSize(int width, int height)
_setScrollerSize
in class HTMLViewer
width
- The width.height
- The width.private void _adjustIconDisplay(NamedObj sample, CompositeEntity container, GraphPane graphPane, JGraph jgraph) throws IllegalActionException, NameDuplicationException
sample
- The instance whose icon is displayed.container
- The container of the sample instance.graphPane
- The graph pane in which it is displayed.jgraph
- The jgraph.
IllegalActionException
NameDuplicationException
private java.lang.String _colorizeRating(java.lang.String rating)
rating
- The rating text, such as "Red (mrptolemy)"
private java.lang.String _getParameterEntries(NamedObj target, DocManager manager)
target
- The target.manager
- The manager.
private java.lang.String _getPortEntries(NamedObj target, DocManager manager)
target
- The target.manager
- The manager.
private java.lang.String _getPortParameterEntries(NamedObj target, DocManager manager)
target
- The target.manager
- The manager.
private void _includeClassDefinitions(NamedObj target, java.lang.StringBuffer buffer)
target
- The target whose parent may need to be included.buffer
- The buffer to append the definition to.private void _init(NamedObj target, Configuration configuration, java.lang.String className, java.net.URL url) throws java.lang.ClassNotFoundException
target
- The object to get documentation for, or null
to base this on the specified class name.configuration
- The configuration in charge of this viewer.className
- The class name of the target, or null if a target
is given.url
- The URL from which to read the doc file, or null to
infer it from the target or className.
java.lang.ClassNotFoundException
protected void _addMenus()
_addMenus
in class TableauFrame
private void _populatePortsAndParametersTable(NamedObj target, DocManager manager)
target
- The target object whose ports and parameters
will be described.manager
- The doc manager.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |