| 
||||||||||
| 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 String | 
CLICKED_KEY
Key for client property mapped from mouse-triggered action.  | 
protected  Point | 
rollover
Current mouse location in client coordinates.  | 
static String | 
ROLLOVER_KEY
Key for client property mapped from rollover events  | 
| Constructor Summary | |
|---|---|
RolloverProducer()
 | 
|
| Method Summary | |
|---|---|
 void | 
mouseClicked(MouseEvent e)
Implemented to do nothing.  | 
 void | 
mouseDragged(MouseEvent e)
Implemented to do nothing.  | 
 void | 
mouseEntered(MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed.  | 
 void | 
mouseExited(MouseEvent e)
Implemented to remove client properties rollover and clicked.  | 
 void | 
mouseMoved(MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed.  | 
 void | 
mousePressed(MouseEvent e)
Implemented to do nothing.  | 
 void | 
mouseReleased(MouseEvent e)
Implemented to map to client property clicked and fire always.  | 
protected  void | 
updateClientProperty(JComponent component,
                     String property,
                     boolean fireAlways)
Sets the given client property to the value of current mouse location in client coordinates.  | 
protected  void | 
updateRollover(MouseEvent e,
               String property,
               boolean fireAlways)
Controls the mapping of the given mouse event to a client property.  | 
protected abstract  void | 
updateRolloverPoint(JComponent component,
                    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 String CLICKED_KEY
public static final String ROLLOVER_KEY
protected Point rollover
| Constructor Detail | 
|---|
public RolloverProducer()
| Method Detail | 
|---|
public void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListener
protected void updateRollover(MouseEvent e,
                              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(JComponent component,
                                    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(JComponent component,
                                            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 | |||||||||