|
|||||||||
| 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 MouseMotionListenermouseDragged in class MouseInputAdaptere - A MouseEventpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenermouseMoved in class MouseInputAdaptere - A MouseEventpublic 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 MouseListenermousePressed in class MouseInputAdaptere - A MouseEventpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenermouseReleased in class MouseInputAdaptere - A MouseEventpublic 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 | ||||||||