|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.rollover.RolloverProducer
public abstract class RolloverProducer
Mouse/Motion/Listener which maps mouse coordinates to client coordinates and stores these as client properties in the target JComponent. The exact mapping process is left to subclasses. Typically, they will map to "cell" coordinates.
Note: this class assumes that the target component is of type JComponent.
Note: this implementation is stateful, it can't be shared across different instances of a target component.
| Field Summary | |
|---|---|
static java.lang.String |
CLICKED_KEY
Key for client property mapped from mouse-triggered action. |
protected java.awt.Point |
rollover
Current mouse location in client coordinates. |
static java.lang.String |
ROLLOVER_KEY
Key for client property mapped from rollover events |
| Constructor Summary | |
|---|---|
RolloverProducer()
|
|
| Method Summary | |
|---|---|
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
void |
install(javax.swing.JComponent component)
Installs all listeners, as required. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Implemented to do nothing. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Implemented to do nothing. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed. |
void |
mouseExited(java.awt.event.MouseEvent e)
Implemented to remove client properties rollover and clicked. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed. |
void |
mousePressed(java.awt.event.MouseEvent e)
Implemented to do nothing. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Implemented to map to client property clicked and fire always. |
void |
release(javax.swing.JComponent component)
Removes all listeners. |
protected void |
updateClientProperty(javax.swing.JComponent component,
java.lang.String property,
boolean fireAlways)
Sets the given client property to the value of current mouse location in client coordinates. |
protected void |
updateRollover(java.awt.event.MouseEvent e,
java.lang.String property,
boolean fireAlways)
Controls the mapping of the given mouse event to a client property. |
protected abstract void |
updateRolloverPoint(javax.swing.JComponent component,
java.awt.Point mousePoint)
Subclasses must implement to map the given mouse coordinates into appropriate client coordinates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CLICKED_KEY
public static final java.lang.String ROLLOVER_KEY
protected java.awt.Point rollover
| Constructor Detail |
|---|
public RolloverProducer()
| Method Detail |
|---|
public void install(javax.swing.JComponent component)
component - target to install required listeners on, must
not be null.public void release(javax.swing.JComponent component)
component - target component to uninstall required listeners from,
must not be nullpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListener
protected void updateRollover(java.awt.event.MouseEvent e,
java.lang.String property,
boolean fireAlways)
e - the MouseEvent to map to client coordinatesproperty - the client property to map tofireAlways - a flag indicating whether a client event should be fired if unchanged.updateRolloverPoint(JComponent, Point),
updateClientProperty(JComponent, String, boolean)
protected void updateClientProperty(javax.swing.JComponent component,
java.lang.String property,
boolean fireAlways)
component - the target componentproperty - the client property to setfireAlways - a flag indicating whether a client property
should be forced to fire an event.
protected abstract void updateRolloverPoint(javax.swing.JComponent component,
java.awt.Point mousePoint)
component - the target component which received a mouse eventmousePoint - the mouse position of the event, coordinates are
component pixels
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||