public class MenuSelectionManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ChangeEvent |
changeEvent
Only one ChangeEvent is needed per button model instance since the event's only state is the source property.
|
protected EventListenerList |
listenerList
|
| Constructor and Description |
|---|
MenuSelectionManager()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener
Adds a ChangeListener to the button.
|
void |
clearSelectedPath()
Tell the menu selection to close and unselect all the menu components.
|
Component |
componentForPoint(Component
Returns the component in the currently selected path which contains sourcePoint.
|
static MenuSelectionManager |
defaultManager()
Returns the default menu selection manager.
|
protected void |
fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type.
|
ChangeListener |
getChangeListeners()
Returns an array of all the
ChangeListeners added to this MenuSelectionManager with addChangeListener().
|
MenuElement |
getSelectedPath()
Returns the path to the currently selected menu item
|
boolean |
isComponentPartOfCurrentMenu(Component
Return true if c is part of the currently used menu
|
void |
processKeyEvent(KeyEvent
When a MenuElement receives an event from a KeyListener, it should never process the event directly.
|
void |
processMouseEvent(MouseEvent
When a MenuElement receives an event from a MouseListener, it should never process the event directly.
|
void |
removeChangeListener(ChangeListener
Removes a ChangeListener from the button.
|
void |
setSelectedPath(MenuElement
Changes the selection in the menu hierarchy.
|
protected transient ChangeEventchangeEvent
protected EventListenerListlistenerList
public static MenuSelectionManagerdefaultManager()
public void setSelectedPath(MenuElement[] path)
Note that this method is public but is used by the look and feel engine and should not be called by client applications.
path - an array of
MenuElement objects specifying the selected path
public MenuElement[] getSelectedPath()
public void clearSelectedPath()
public void addChangeListener(ChangeListenerl)
l - the listener to add
public void removeChangeListener(ChangeListenerl)
l - the listener to remove
public ChangeListener[] getChangeListeners()
ChangeListeners added to this MenuSelectionManager with addChangeListener().
ChangeListeners added or an empty array if no listeners have been added
protected void fireStateChanged()
EventListenerList
public void processMouseEvent(MouseEventevent)
event - a MouseEvent object
public ComponentcomponentForPoint(Component source, Point sourcePoint)
source - The component in whose coordinate space sourcePoint is given
sourcePoint - The point which is being tested
public void processKeyEvent(KeyEvente)
e - a KeyEvent object
public boolean isComponentPartOfCurrentMenu(Componentc)