|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.AbstractButton javax.swing.JMenuItem javax.swing.JMenu com.bbn.openmap.gui.AbstractOpenMapMenu com.bbn.openmap.gui.LayersMenu
public class LayersMenu
The LayersMenu is a JMenu which is a list of the layers of the map. This LayersMenu expects to work with a LayerHandler containing all the possible layers that may be added to the map. This list defaults to being checkbuttons which add and remove the named layer to/from the Map. You can also use an instance of this object to show/hide layer palettes.
This object is interested in contacting a LayerHandler to find out all the layers available, and optionally, a LayersPanel in order to provide a menu item that will call up the GUI for the LayersPanel. If this LayersMenu is a member of a BeanContext, it expects that only one of each of these objects will be added, but if more than one per type is added, the last one added to be BeanContext will be the one hooked up to this LayersMenu.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JMenu |
---|
javax.swing.JMenu.AccessibleJMenu, javax.swing.JMenu.WinListener |
Nested classes/interfaces inherited from class javax.swing.JMenuItem |
---|
javax.swing.JMenuItem.AccessibleJMenuItem |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.JMenuItem |
add
The menu item to add a layer to the map. |
protected java.lang.String |
addLayersButtonTitle
The default add button title. |
static java.lang.String |
defaultEditLayersButtonTitle
The default edit button title. |
protected javax.swing.JMenuItem |
edit
A button on the bottom of the menu to bring up the layersPanel. |
protected java.lang.String |
editLayersButtonTitle
The actual edit button title. |
protected LayerHandler |
layerHandler
The LayerHandler to listen to for layers available for the map. |
static int |
LAYERS_ON_OFF
Static value to set this menu to control layer visibility. |
protected LayersPanel |
layersPanel
Used by the BeanContext methods to insure that the component we disconnect the edit button from is the same one being removed from the BeanContext. |
protected int |
menuType
The flag setting the behavior of the menu, whether it controls the layers or the layers palettes. |
static int |
PALETTES_ON_OFF
Static value to set this menu to control layer palette visibility. |
Fields inherited from class com.bbn.openmap.gui.AbstractOpenMapMenu |
---|
beanContextChildSupport, i18n, items, itemsProperties, ItemsProperty, itemsPropertyContents, MnemonicProperty, PrettyNameProperty, propertyPrefix, SeparatorProperty |
Fields inherited from class javax.swing.JMenu |
---|
popupListener |
Fields inherited from class javax.swing.AbstractButton |
---|
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 |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
LayersMenu()
Construct LayersMenu. |
|
LayersMenu(LayerHandler lHandler)
Construct LayersMenu. |
|
LayersMenu(LayerHandler lHandler,
java.lang.String menuName,
int menuType)
Construct LayersMenu. |
Method Summary | |
---|---|
void |
findAndInit(java.lang.Object someObj)
Called when the BeanContext membership changes with object from the BeanContext. |
void |
findAndUndo(java.lang.Object someObj)
Called when objects are removed from the BeanContext. |
void |
fireVetoableChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a vetoable property update to any registered listeners. |
javax.swing.JMenuItem |
getEdit()
Get the edit menu item that triggers the LayersPanel action listener. |
java.lang.String |
getEditLayersButtonTitle()
Return the title of the menu option to call up LayersPanel. |
LayerHandler |
getLayerHandler()
Get the LayerHandler that the LayersPanel listens to. |
protected LayersPanel |
getLayersPanel()
Get the LayersPanel, privately held to keep track of what object is being used from the BeanContext. |
void |
removeAll()
Remove all the components from the menu. |
void |
setAdd(javax.swing.JMenuItem a)
Set the add menu item. |
void |
setEdit(javax.swing.JMenuItem e)
Set the edit menu item that triggers the LayersPanel action listener. |
void |
setEditLayersButtonTitle(java.lang.String buttonTitle)
Return the title of the menu option to call up LayersPanel. |
void |
setLayerHandler(LayerHandler lh)
Set the LayerHandler that the LayersPanel listens to. |
void |
setLayers(Layer[] inLayers)
Set the layers that are on the menu. |
void |
setLayers(LayerEvent evt)
LayerListener interface method. |
protected void |
setLayersFromEDT(Layer[] inLayers)
|
protected void |
setLayersPanel(LayersPanel lp)
Set the LayersPanel privately to keep track of what object is being used from the BeanContext. |
void |
setupEditLayersButton(LayersPanel lp)
Given a LayersPanel, set up a JButton to add to the end of the LayersMenu that will trigger the action listener of the LayersPanel. |
void |
setupLayerAddButton(LayerAddPanel menu)
Constructs the menu item that will bring up the LayerAddPanel. |
void |
updateLayerLabels()
Update the layer names. |
Methods inherited from class com.bbn.openmap.gui.AbstractOpenMapMenu |
---|
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndUndo, getBeanContext, getMapHandler, getProperties, getPropertyInfo, getPropertyPrefix, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setProperties, setProperties, setPropertyPrefix |
Methods inherited from class javax.swing.JMenu |
---|
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, removeMenuListener, setAccelerator, setComponentOrientation, setDelay, setMenuLocation, setModel, setPopupMenuVisible, setSelected, updateUI |
Methods inherited from class javax.swing.JMenuItem |
---|
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 |
Methods inherited from class javax.swing.AbstractButton |
---|
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 |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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 |
Methods inherited from class java.awt.Container |
---|
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, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.MenuElement |
---|
processKeyEvent, processMouseEvent |
Field Detail |
---|
public static final transient int LAYERS_ON_OFF
public static final transient int PALETTES_ON_OFF
protected int menuType
protected transient LayerHandler layerHandler
protected transient LayersPanel layersPanel
protected transient javax.swing.JMenuItem edit
public static final java.lang.String defaultEditLayersButtonTitle
protected transient java.lang.String editLayersButtonTitle
protected transient javax.swing.JMenuItem add
protected transient java.lang.String addLayersButtonTitle
Constructor Detail |
---|
public LayersMenu()
public LayersMenu(LayerHandler lHandler)
lHandler
- the handler for the layerpublic LayersMenu(LayerHandler lHandler, java.lang.String menuName, int menuType)
lHandler
- the handler for the layermenuName
- the name of the menumenuType
- either LAYERS_ON_OFF, or PALETTES_ON_OFFMethod Detail |
---|
public void setLayerHandler(LayerHandler lh)
If there is a LayerHandler that is already being listened to, then the LayersPanel will remove itself from current LayerHandler as a LayerListener, before adding itself to the new LayerHandler.
Lastly, if the LayerHandler passed in is null, the LayersPanel will disconnect itself from any LayerHandler currently held, and reset itself with no layers.
lh
- the LayerHandler containing the layers.public LayerHandler getLayerHandler()
protected void setLayersPanel(LayersPanel lp)
protected LayersPanel getLayersPanel()
public void setEditLayersButtonTitle(java.lang.String buttonTitle)
public java.lang.String getEditLayersButtonTitle()
public void setEdit(javax.swing.JMenuItem e)
public void setAdd(javax.swing.JMenuItem a)
public javax.swing.JMenuItem getEdit()
public void setLayers(LayerEvent evt)
setLayers
in interface LayerListener
evt
- a LayerEventpublic void setLayers(Layer[] inLayers)
inLayers
- the array of layers.protected void setLayersFromEDT(Layer[] inLayers)
public void removeAll()
removeAll
in class javax.swing.JMenu
public void updateLayerLabels()
public void setupEditLayersButton(LayersPanel lp)
lp
- the LayersPanel to ask for an ActionListener from.public void setupLayerAddButton(LayerAddPanel menu)
public void findAndInit(java.lang.Object someObj)
findAndInit
in interface LightMapHandlerChild
findAndInit
in class AbstractOpenMapMenu
someObj
- Object received in the BeanContext or
BeanContextMembershipEvent.public void findAndUndo(java.lang.Object someObj)
findAndUndo
in interface LightMapHandlerChild
findAndUndo
in class AbstractOpenMapMenu
someObj
- the object being removed from the BeanContextpublic void fireVetoableChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException
No event is fired if old and new are equal and non-null.
fireVetoableChange
in class javax.swing.JComponent
name
- The programmatic name of the property that is about to changeoldValue
- The old value of the propertynewValue
- - The new value of the property
java.beans.PropertyVetoException
- if the recipient wishes the property change
to be rolled back.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |