|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
com.tensegrity.gui.swing.document.MenuTool
The MenuTool is a Tool alike class to add a Window Menu and a View-Tools menu to your application. The Window menu part contains a list of Documents, while the active document is marked selected through the usage of JRadioButtonMenuItem's. NOTE: Documents are added at the beginning of the internal Menu container, A MenuTool instance should be used as Observer to ease the update process for the Window menu. The MenuTool also provides a ToolsMenu. Such a menu contains entries, which can be checked (JCheckBoxMenuItem). This menu will then set the visibility of the associated (Tool-)Document and show or hide these.
| Nested Class Summary | |
static class |
MenuTool.DocumentAction
The class DocumentAction is a simple Helperclass for Tool menu items wich need to show/hide a document. |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
MenuTool()
Constructs a new MenuTool instance. |
|
MenuTool(GraphApplication graphapplication)
Deprecated. Pass the MDIComponent instead of the application. |
|
MenuTool(MDIComponent mdiComponent)
Constructor creates a new MenuTool which initially has no menu and no map. |
|
| Method Summary | |
void |
add(Container container)
Adds a container to this instance. |
void |
add(Document document)
Method add(Document) adds a new CheckBoxMenuItem to the top
of the internal menu. |
javax.swing.JMenuItem |
add(ToolBar toolbar)
Adds a ToolBar to this MenuTool. |
ContainerAction |
getContainerAction(Container container)
This factory method returns a new ContainerAction instance
initialized with the passed Container parameter.
|
SwingMenu |
getDocumentMenu()
Returns the documentMenu. |
SwingMenu |
getToolBarsMenu()
Gets the toolsMenu. |
SwingMenu |
getToolsMenu()
Returns the toolsMenu. |
void |
remove(Document document)
Removes the specified document from the menuMap and the associated menuitem as well. |
void |
setDocumentMenu(SwingMenu documentMenu)
Sets the documentMenu. |
void |
setMDIComponent(MDIComponent component)
Sets the MDIComponent that this instance is associated with. |
void |
setMenuMap(java.util.Map menuMap)
Sets the menuMap. |
void |
setToolBarsMenu(SwingMenu toobarsMenu)
Sets the toolbarsMenu |
void |
setToolsMenu(SwingMenu toolsMenu)
Sets the toolsMenu. |
void |
update(Observable o,
java.lang.Object arg)
Invoked when active document changes. |
void |
updateContainerNames()
Updates the names of the containers. |
void |
updateDocuments()
Updates the Documents menu by retrieving each items action and changing the name property to the currently name of the associated document. |
void |
updateTools()
Updates the tools part of the menu |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MenuTool()
MenuTool instance.
public MenuTool(GraphApplication graphapplication)
graphapplication - the graphapplication we are associated with.public MenuTool(MDIComponent mdiComponent)
mdiComponent - the mdi-component to use.| Method Detail |
public void setMenuMap(java.util.Map menuMap)
menuMap - The menuMap to setpublic javax.swing.JMenuItem add(ToolBar toolbar)
toolbar - the ToolBar to add.
public void add(Container container)
Action set to the created JMenuItem
is retrieved from the factory method getContainerAction(Container).
container - the Container to add.public ContainerAction getContainerAction(Container container)
ContainerAction instance
initialized with the passed Container parameter.
Note that the returned ContainerAction instance extends
the default ContainerAction.actionPerformed() method
by doing a MDIComponent.postValidate().
container - the Container to look up.
ContainerAction instanceContainerAction,
Containerpublic void add(Document document)
add(Document) adds a new CheckBoxMenuItem to the top
of the internal menu. This methods adds a separator if the first document
is added, to separate user commands from document entries. This allows
users of this class to combine a document menu with a custom (general)
window menu.
document - the Document to add.public void updateContainerNames()
public void updateTools()
public void updateDocuments()
public void remove(Document document)
document - the Document to remove.
public void update(Observable o,
java.lang.Object arg)
update in interface Observero - the observable that triggered the call.arg - an object carrying additional information.public SwingMenu getDocumentMenu()
public SwingMenu getToolsMenu()
public SwingMenu getToolBarsMenu()
public void setDocumentMenu(SwingMenu documentMenu)
documentMenu - The documentMenu to setpublic void setToolsMenu(SwingMenu toolsMenu)
toolsMenu - The toolsMenu to setpublic void setToolBarsMenu(SwingMenu toobarsMenu)
toobarsMenu - the toolbarsMenu to set.public void setMDIComponent(MDIComponent component)
MDIComponent that this instance is associated with.
component - the MDIComponent that this instance is
associated with.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||