ch.randelshofer.quaqua
Class QuaquaSliderUI.QuaquaTrackListener
java.lang.Object
javax.swing.event.MouseInputAdapter
javax.swing.plaf.basic.BasicSliderUI.TrackListener
ch.randelshofer.quaqua.QuaquaSliderUI.QuaquaTrackListener
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener
- Enclosing class:
- QuaquaSliderUI
public class QuaquaSliderUI.QuaquaTrackListener
- extends javax.swing.plaf.basic.BasicSliderUI.TrackListener
Track mouse movements.
This class should be treated as a "protected" inner class.
Instantiate it only within subclasses of .
Fields inherited from class javax.swing.plaf.basic.BasicSliderUI.TrackListener |
currentMouseX, currentMouseY, offset |
Method Summary |
void |
mouseDragged(java.awt.event.MouseEvent e)
Set the models value to the position of the top/left
of the thumb relative to the origin of the track. |
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
If the mouse is pressed above the "thumb" component
then reduce the scrollbars value by one page ("page up"),
otherwise increase it by one page. |
void |
mouseReleased(java.awt.event.MouseEvent e)
|
boolean |
shouldScroll(int direction)
|
Methods inherited from class javax.swing.event.MouseInputAdapter |
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QuaquaSliderUI.QuaquaTrackListener
public QuaquaSliderUI.QuaquaTrackListener()
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class javax.swing.plaf.basic.BasicSliderUI.TrackListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- If the mouse is pressed above the "thumb" component
then reduce the scrollbars value by one page ("page up"),
otherwise increase it by one page. If there is no
thumb then page up if the mouse is in the upper half
of the track.
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
- Overrides:
mousePressed
in class javax.swing.plaf.basic.BasicSliderUI.TrackListener
shouldScroll
public boolean shouldScroll(int direction)
- Overrides:
shouldScroll
in class javax.swing.plaf.basic.BasicSliderUI.TrackListener
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Set the models value to the position of the top/left
of the thumb relative to the origin of the track.
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in class javax.swing.plaf.basic.BasicSliderUI.TrackListener
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMoved
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in class javax.swing.plaf.basic.BasicSliderUI.TrackListener