Package jpicedt.ui.internal
Class PEMenuBar
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JMenuBar
-
- jpicedt.ui.internal.PEMenuBar
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.beans.PropertyChangeListener,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.MenuElement
public class PEMenuBar extends javax.swing.JMenuBar implements java.beans.PropertyChangeListenerThe main menu bar. SeveralupdateXXX()methods are provided, which make it easy to keep the GUI state synchronized with the current content of the desktop (in terms e.g. of saved/dirty boards, ...)This menubar can listen to property-change events triggered e.g. from an activated PEDrawingBoard.
- Since:
- PicEdt 1.0
- Version:
- $Id: PEMenuBar.java,v 1.15.2.1 2007/09/02 11:56:30 reynal Exp $
- Author:
- Sylvain Reynal
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JMenuBar
javax.swing.JMenuBar.AccessibleJMenuBar
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description PEMenuBar()Creates the application main menu bar
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JMenuItem[]getMenuItems()Return an array containing all the menu-items components attached to this menubarvoidpropertyChange(java.beans.PropertyChangeEvent e)Implementation of PropertyChangeListener interface Allows this menu-bar to get notified of change from the target EditorKit, e.g.voidupdateAccelerators()Update JMenuItem's accelerators from the key/value pairs stored in JPicEdt's preferencesvoidupdateFragmentsMenu()Updates the "fragments" menu itemsvoidupdateMenuBar()Update the content (i.e.voidupdateRecentFilesSubmenu()Updates the "recent files" sub-menu items after a frame was saved or opened.voidupdateScriptsMenu()Updates the "script" menu itemsvoidupdateUndoRedoMenus(java.lang.String undoName, java.lang.String redoName)update "undo" and "redo" textvoidupdateWindowMenu()Updates the Window menu as soon as an internal frame is opened or closed (this menu keeps tracks of every open internal frames so that the user can activate them quickly by use of a shortcut)-
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Method Detail
-
getMenuItems
public javax.swing.JMenuItem[] getMenuItems()
Return an array containing all the menu-items components attached to this menubar
-
updateAccelerators
public void updateAccelerators()
Update JMenuItem's accelerators from the key/value pairs stored in JPicEdt's preferences
-
updateMenuBar
public void updateMenuBar()
Update the content (i.e. PEMenu's) of the menu-bar depending on the current state of the MDIManager.
-
updateRecentFilesSubmenu
public void updateRecentFilesSubmenu()
Updates the "recent files" sub-menu items after a frame was saved or opened.- Since:
- PicEdt 1.1
-
updateScriptsMenu
public void updateScriptsMenu()
Updates the "script" menu items- Since:
- jpicedt 1.3.2
-
updateFragmentsMenu
public void updateFragmentsMenu()
Updates the "fragments" menu items- Since:
- jpicedt 1.3.2
-
updateUndoRedoMenus
public void updateUndoRedoMenus(java.lang.String undoName, java.lang.String redoName)update "undo" and "redo" text- Since:
- jpicedt 1.3.2
-
updateWindowMenu
public void updateWindowMenu() throws java.util.MissingResourceExceptionUpdates the Window menu as soon as an internal frame is opened or closed (this menu keeps tracks of every open internal frames so that the user can activate them quickly by use of a shortcut)- Throws:
java.util.MissingResourceException- Since:
- PicEdt 1.1
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Implementation of PropertyChangeListener interface Allows this menu-bar to get notified of change from the target EditorKit, e.g. when a right-click switches the current EditorKit's mousetool back to "select-tool", or when a new mousetool gets selected from the "Tools" palette or from a BSH script.This DockablePanel gets registered as a PropertyChangeListener (with events sourced from EditorKit's) from inside MDIManager whenever a new Board is added.
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Parameters:
e- the PropertyChangeEvent ; only the "getNewValue()" method is used here.
-
-