java.lang.Object
java.awt.event.MouseAdapter
javax.swing.event.MouseInputAdapter
javax.swing.plaf.basic.BasicSliderUI.TrackListener
- 封装类:
-
BasicSliderUI
跟踪鼠标移动。此类应被视为“protected”内部类。仅在
Foo
的子类中实例化。
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
当前鼠标 x 坐标。protected int
当前鼠标 y 坐标。protected int
偏移量 -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
将模型的值设置为拇指相对于轨道原点的左上角位置。void
当鼠标光标移动到组件上但未按下任何按钮时调用。void
如果鼠标在“拇指”组件上方按下,则将滚动条值减少一页(“向上翻页”),否则增加一页。void
当鼠标按钮在组件上释放时调用。boolean
shouldScroll
(int direction) 返回是否应发生滚动Methods declared in class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
-
Field Details
-
offset
protected transient int offset偏移量 -
currentMouseX
protected transient int currentMouseX当前鼠标 x 坐标。 -
currentMouseY
protected transient int currentMouseY当前鼠标 y 坐标。
-
-
Constructor Details
-
TrackListener
public TrackListener()构造一个TrackListener
。
-
-
Method Details
-
mouseReleased
当鼠标按钮在组件上释放时调用。- 参数:
-
e
- 要处理的事件
-
mousePressed
如果鼠标在“拇指”组件上方按下,则将滚动条值减少一页(“向上翻页”),否则增加一页。如果没有拇指,则在鼠标位于轨道上半部分时向上翻页。- 参数:
-
e
- 要处理的事件
-
shouldScroll
public boolean shouldScroll(int direction) 返回是否应发生滚动- 参数:
-
direction
- 方向 - 返回:
- 如果应发生滚动
-
mouseDragged
将模型的值设置为拇指相对于轨道原点的左上角位置。- 指定者:
-
mouseDragged
在接口MouseMotionListener
中 - 覆盖:
-
mouseDragged
在类MouseAdapter
中 - 参数:
-
e
- 要处理的事件
-
mouseMoved
当鼠标光标移动到组件上但未按下任何按钮时调用。- 指定者:
-
mouseMoved
在接口MouseMotionListener
中 - 覆盖:
-
mouseMoved
在类MouseAdapter
中 - 参数:
-
e
- 要处理的事件
-