| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
Based on 13 examples
public class MenuSelectionManager extends Object
A MenuSelectionManager owns the selection in menu hierarchy.
Field Summary | |
---|---|
protected transient 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 Summary | |
---|---|
|
Method Summary | |
---|---|
void |
Adds a ChangeListener to the button. |
void |
Tell the menu selection to close and unselect all the menu components. |
Component |
componentForPoint(Component source, Point sourcePoint) Returns the component in the currently selected path which contains sourcePoint. |
static MenuSelectionManager |
Returns the default menu selection manager. |
protected void |
Notifies all listeners that have registered interest for notification on this event type. |
ChangeListener[] |
Returns an array of all the ChangeListener s added
to this MenuSelectionManager with addChangeListener().
|
MenuElement[] |
Returns the path to the currently selected menu item |
boolean |
Return true if c is part of the currently used menu |
void |
When a MenuElement receives an event from a KeyListener, it should never process the event directly. |
void |
processMouseEvent(MouseEvent event) When a MenuElement receives an event from a MouseListener, it should never process the event directly. |
void |
Removes a ChangeListener from the button. |
void |
setSelectedPath(MenuElement[] path) Changes the selection in the menu hierarchy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient ChangeEvent changeEvent
protected EventListenerList listenerList
Constructor Detail |
---|
public MenuSelectionManager()
Method Detail |
---|
public void addChangeListener(ChangeListener l)
l
- the listener to addpublic void clearSelectedPath()
public Component componentForPoint(Component source, Point sourcePoint)
source
- The component in whose coordinate space sourcePoint
is givensourcePoint
- The point which is being testedpublic static MenuSelectionManager defaultManager()
protected void fireStateChanged()
public ChangeListener[] getChangeListeners()
ChangeListener
s added
to this MenuSelectionManager with addChangeListener().
ChangeListener
s added or an empty
array if no listeners have been addedpublic MenuElement[] getSelectedPath()
public boolean isComponentPartOfCurrentMenu(Component c)
c
public void processKeyEvent(KeyEvent e)
e
- a KeyEvent objectpublic void processMouseEvent(MouseEvent event)
event
- a MouseEvent objectpublic void removeChangeListener(ChangeListener l)
l
- the listener to removepublic 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
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |