public abstract class AbstractOpenMapMenu extends javax.swing.JMenu implements java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, PropertyConsumer, MenuBarMenu, LightMapHandlerChild
If you have a component that needs to be added to the menu that should in the MapHandler, you should *NOT* make it a LightMapHandlerChild, but implement the same methods as the MapHandlerChild and add it to the MapHandler before adding it to this menu. If the component is a LightMapHandlerChild, added to this menu, and also added to the MapHandler, it will receive double membership notifications which may be confusing.
AbstractOpenMapMenus can be configure via properties. You can set, with 'menu' as a property prefix:
# Title used in the Menu Bar. menu.prettyName=Menu Title # The letter to use as Mnemonic menu.mnemonic=M # A marker name list of items to use in the menu. 'sep' inserts a # separator, property classname definition not needed. menu.items=first second sep third first.class=Classname of first menu item # You can add properties for Menu Item, if it is a PropertyConsumer. #first.property1=prop1 second.class=classname third.class=classnameIf no properties are set, the name, mnemonic and any items added in the constructor will be in the menu. Any items in the properties will be added to items created and added in the constructor - this really applies to any subclasses to this class.
javax.swing.JMenu.AccessibleJMenu, javax.swing.JMenu.WinListener
javax.swing.JMenuItem.AccessibleJMenuItem
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.beans.beancontext.BeanContextChildSupport |
beanContextChildSupport |
protected I18n |
i18n
All AbstractOpenMapMenus have access to an I18n object, which is provided
by the Environment.
|
protected java.util.Hashtable |
items
A hashtable to keep track of item prefixes and their components, for
restructuring properties later.
|
protected java.util.Hashtable |
itemsProperties |
static java.lang.String |
ItemsProperty |
protected java.lang.String |
itemsPropertyContents |
static java.lang.String |
MnemonicProperty |
static java.lang.String |
PrettyNameProperty |
protected java.lang.String |
propertyPrefix
Token uniquely identifying this component in the application properties.
|
static java.lang.String |
SeparatorProperty |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
AbstractOpenMapMenu() |
AbstractOpenMapMenu(java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener in_pcl)
Method for BeanContextChild interface.
|
void |
addVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener in_vcl)
Method for BeanContextChild interface.
|
void |
childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
Method for BeanContextMembership interface.
|
void |
childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
Method for BeanContextMembership interface.
|
void |
findAndInit(java.util.Iterator it)
Subclasses should no longer implement this method.
|
void |
findAndInit(java.lang.Object someObj)
Method called when an object is added from the MapHandler.
|
void |
findAndUndo(java.util.Iterator it)
Subclasses should no longer implement this method.
|
void |
findAndUndo(java.lang.Object someObj)
Method called when an object is removed from the MapHandler.
|
java.beans.beancontext.BeanContext |
getBeanContext()
Method for BeanContextChild interface.
|
MapHandler |
getMapHandler()
Return the MapHandler, if it's been set.
|
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the
current values of the OMComponent.
|
java.util.Properties |
getPropertyInfo(java.util.Properties list)
Method to fill in a Properties object with values reflecting the
properties able to be set on this PropertyConsumer.
|
java.lang.String |
getPropertyPrefix()
Get the property key prefix that is being used to prepend to the property
keys for Properties lookups.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener in_pcl)
Method for BeanContextChild interface.
|
void |
removeVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener in_vcl)
Method for BeanContextChild interface.
|
void |
setBeanContext(java.beans.beancontext.BeanContext in_bc)
Method for BeanContextChild interface.
|
void |
setProperties(java.util.Properties props)
Sets the properties for the OMComponent.
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent.
|
void |
setPropertyPrefix(java.lang.String prefix)
Set the property key prefix that should be used by the PropertyConsumer.
|
add, add, add, add, add, addMenuListener, addSeparator, applyComponentOrientation, createActionChangeListener, createActionComponent, createWinListener, doClick, fireMenuCanceled, fireMenuDeselected, fireMenuSelected, getAccessibleContext, getComponent, getDelay, getItem, getItemCount, getMenuComponent, getMenuComponentCount, getMenuComponents, getMenuListeners, getPopupMenu, getPopupMenuOrigin, getSubElements, getUIClassID, insert, insert, insert, insertSeparator, isMenuComponent, isPopupMenuVisible, isSelected, isTearOff, isTopLevelMenu, menuSelectionChanged, paramString, processKeyEvent, remove, remove, remove, removeAll, removeMenuListener, setAccelerator, setComponentOrientation, setDelay, setMenuLocation, setModel, setPopupMenuVisible, setSelected, updateUI
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getMenuDragMouseListeners, getMenuKeyListeners, init, isArmed, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setArmed, setEnabled, setUI
addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
addAncestorListener, addNotify, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, addContainerListener, addPropertyChangeListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected I18n i18n
protected java.beans.beancontext.BeanContextChildSupport beanContextChildSupport
protected java.lang.String propertyPrefix
protected java.util.Hashtable items
public static final java.lang.String ItemsProperty
public static final java.lang.String SeparatorProperty
public static final java.lang.String PrettyNameProperty
public static final java.lang.String MnemonicProperty
protected java.lang.String itemsPropertyContents
protected java.util.Hashtable itemsProperties
public AbstractOpenMapMenu()
public AbstractOpenMapMenu(java.lang.String title)
public java.beans.beancontext.BeanContext getBeanContext()
getBeanContext
in interface java.beans.beancontext.BeanContextChild
public void setBeanContext(java.beans.beancontext.BeanContext in_bc) throws java.beans.PropertyVetoException
setBeanContext
in interface java.beans.beancontext.BeanContextChild
java.beans.PropertyVetoException
public void childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
childrenAdded
in interface java.beans.beancontext.BeanContextMembershipListener
public void childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
childrenRemoved
in interface java.beans.beancontext.BeanContextMembershipListener
public void findAndUndo(java.util.Iterator it)
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in interface LightMapHandlerChild
public void findAndInit(java.util.Iterator it)
public void findAndInit(java.lang.Object someObj)
findAndInit
in interface LightMapHandlerChild
public void addVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener in_vcl)
addVetoableChangeListener
in interface java.beans.beancontext.BeanContextChild
public void removeVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener in_vcl)
removeVetoableChangeListener
in interface java.beans.beancontext.BeanContextChild
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener in_pcl)
addPropertyChangeListener
in interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener
in class java.awt.Container
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener in_pcl)
removePropertyChangeListener
in interface java.beans.beancontext.BeanContextChild
removePropertyChangeListener
in class java.awt.Component
public MapHandler getMapHandler()
public void setProperties(java.util.Properties props)
setProperties
in interface PropertyConsumer
props
- the Properties
object.public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
getProperties
in interface PropertyConsumer
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
list
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.public void setPropertyPrefix(java.lang.String prefix)
setPropertyPrefix
in interface PropertyConsumer
prefix
- the prefix String.public java.lang.String getPropertyPrefix()
getPropertyPrefix
in interface PropertyConsumer
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details