Quaqua 5.4.1 2009-07-14

ch.randelshofer.quaqua
Class QuaquaSliderUI.QuaquaTrackListener

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by javax.swing.plaf.basic.BasicSliderUI.TrackListener
          extended by 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 .


Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicSliderUI.TrackListener
currentMouseX, currentMouseY, offset
 
Constructor Summary
QuaquaSliderUI.QuaquaTrackListener()
           
 
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
 

Constructor Detail

QuaquaSliderUI.QuaquaTrackListener

public QuaquaSliderUI.QuaquaTrackListener()
Method Detail

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

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.