|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.event.MouseInputAdapter
javax.swing.plaf.basic.BasicSliderUI.TrackListener
public class BasicSliderUI.TrackListener
Helper class that listens for mouse events.
Field Summary | |
---|---|
protected int |
currentMouseX
The current X position of the mouse. |
protected int |
currentMouseY
The current Y position of the mouse. |
protected int |
offset
The offset between the current slider value and the cursor's position. |
Constructor Summary | |
---|---|
BasicSliderUI.TrackListener()
|
Method Summary | |
---|---|
void |
mouseDragged(MouseEvent e)
Called when the mouse has been dragged. |
void |
mouseMoved(MouseEvent e)
Called when the mouse has moved over a component but no buttons have been pressed yet. |
void |
mousePressed(MouseEvent e)
Called when the mouse is pressed. |
void |
mouseReleased(MouseEvent e)
Called when the mouse is released. |
boolean |
shouldScroll(int direction)
Indicates whether the thumb should scroll in the given 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 |
Field Detail |
---|
protected int currentMouseX
protected int currentMouseY
protected int offset
Constructor Detail |
---|
public BasicSliderUI.TrackListener()
Method Detail |
---|
public void mouseDragged(MouseEvent e)
JSlider
accordingly.
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MouseInputAdapter
e
- A MouseEvent
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class MouseInputAdapter
e
- A MouseEvent
public void mousePressed(MouseEvent e)
JSlider
should have its value set to where the
mouse was pressed. If the press occurs on the track, then the thumb
should move one block towards the direction of the mouse.
mousePressed
in interface MouseListener
mousePressed
in class MouseInputAdapter
e
- A MouseEvent
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseInputAdapter
e
- A MouseEvent
public boolean shouldScroll(int direction)
direction
- The direction to check.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |