|
swingx Version 2005-08-19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.event.MouseAdapter
org.jdesktop.swingx.MouseMessagingHandler
public class MouseMessagingHandler
Mouse handler which listens to mouse entered events on action based components and send the value of the LONG_DESCRIPTION as a transient message to the MessageListener and the listeners registered to the MessageSource.
Components can be registered using the register methods. For example, to register all the components of a toolbar and all menu items in a menu bar to send mouse over messages to a status bar:
handler = new MouseMessagingHandler(this, statusBar);
if (toolBar != null) {
handler.registerListeners(toolBar.getComponents());
}
if (menuBar != null) {
handler.registerListeners(menuBar.getSubElements());
}
| Constructor Summary | |
|---|---|
MouseMessagingHandler(Object source,
MessageListener messageListener)
|
|
MouseMessagingHandler(Object source,
MessageSource messageSource)
|
|
| Method Summary | |
|---|---|
void |
mouseEntered(MouseEvent evt)
Takes the LONG_DESCRIPTION of the Action based components and sends them to the Status bar |
void |
mouseExited(MouseEvent evt)
|
void |
registerListeners(Component[] components)
Helper method to register all components with this message handler |
void |
registerListeners(MenuElement[] elements)
Helper method to recursively register all MenuElements with this messaging handler. |
void |
setMessageListener(MessageListener listener)
|
void |
setMessageSource(MessageSource source)
|
void |
setSource(Object source)
Set the source object of the MessageEvents. |
void |
unregisterListeners(Component[] components)
|
void |
unregisterListeners(MenuElement[] elements)
|
| Methods inherited from class java.awt.event.MouseAdapter |
|---|
mouseClicked, mousePressed, mouseReleased |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MouseMessagingHandler(Object source,
MessageSource messageSource)
source - the source of the MesageEventsmessageSource - messages will be sent to these listeners
public MouseMessagingHandler(Object source,
MessageListener messageListener)
source - the source of the MesageEventsmessageListener - messages will be sent to this listener| Method Detail |
|---|
public void setSource(Object source)
public void setMessageSource(MessageSource source)
public void setMessageListener(MessageListener listener)
public void mouseExited(MouseEvent evt)
mouseExited in interface MouseListenermouseExited in class MouseAdapterpublic void mouseEntered(MouseEvent evt)
mouseEntered in interface MouseListenermouseEntered in class MouseAdapterpublic void registerListeners(MenuElement[] elements)
public void unregisterListeners(MenuElement[] elements)
public void registerListeners(Component[] components)
public void unregisterListeners(Component[] components)
|
swingx Version 2005-08-19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||