org.jdesktop.swingx.rollover
Class RolloverProducer
- java.lang.Object
-
- org.jdesktop.swingx.rollover.RolloverProducer
-
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
- Direct Known Subclasses:
- ListRolloverProducer, TableRolloverProducer, TreeRolloverProducer
public abstract class RolloverProducer extends java.lang.Object implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ComponentListenerMouse/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
Fields Modifier and Type Field and Description static java.lang.StringCLICKED_KEYKey for client property mapped from mouse-triggered action.static java.lang.StringROLLOVER_KEYKey for client property mapped from rollover events
-
Constructor Summary
Constructors Constructor and Description RolloverProducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomponentHidden(java.awt.event.ComponentEvent e)voidcomponentMoved(java.awt.event.ComponentEvent e)voidcomponentResized(java.awt.event.ComponentEvent e)voidcomponentShown(java.awt.event.ComponentEvent e)voidinstall(javax.swing.JComponent component)Installs all listeners, as required.voidmouseClicked(java.awt.event.MouseEvent e)Implemented to do nothing.voidmouseDragged(java.awt.event.MouseEvent e)Implemented to set a dragging flag to true.voidmouseEntered(java.awt.event.MouseEvent e)Implemented to map to client property rollover and fire only if client coordinate changed.voidmouseExited(java.awt.event.MouseEvent e)Implemented to remove client properties rollover and clicked.voidmouseMoved(java.awt.event.MouseEvent e)Implemented to map to client property rollover and fire only if client coordinate changed.voidmousePressed(java.awt.event.MouseEvent e)Implemented to do nothing.voidmouseReleased(java.awt.event.MouseEvent e)Implemented to map to Rollover properties as needed.voidrelease(javax.swing.JComponent component)Removes all listeners.
-
-
-
Field Detail
-
CLICKED_KEY
public static final java.lang.String CLICKED_KEY
Key for client property mapped from mouse-triggered action. Note that the actual mouse-event which results in setting the property depends on the implementation of the concrete RolloverProducer.- See Also:
- Constant Field Values
-
ROLLOVER_KEY
public static final java.lang.String ROLLOVER_KEY
Key for client property mapped from rollover events- See Also:
- Constant Field Values
-
-
Method Detail
-
install
public void install(javax.swing.JComponent component)
Installs all listeners, as required.- Parameters:
component- target to install required listeners on, must not be null.
-
release
public void release(javax.swing.JComponent component)
Removes all listeners.- Parameters:
component- target component to uninstall required listeners from, must not be null
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Implemented to map to Rollover properties as needed. This implemenation calls updateRollover with both ROLLOVER_KEY and CLICKED_KEY properties.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Implemented to remove client properties rollover and clicked. if the source is a JComponent. Does nothing otherwise.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
Implemented to do nothing.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Implemented to do nothing.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
Implemented to set a dragging flag to true.- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Implemented to map to client property rollover and fire only if client coordinate changed.- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
componentShown
public void componentShown(java.awt.event.ComponentEvent e)
- Specified by:
componentShownin interfacejava.awt.event.ComponentListener
-
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)
- Specified by:
componentMovedin interfacejava.awt.event.ComponentListener
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent e)
- Specified by:
componentHiddenin interfacejava.awt.event.ComponentListener
-
-
DataMelt 3.0 © DataMelt by jWork.ORG