diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java index 2fb16f12e63..3811eebdfd6 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java @@ -371,6 +371,7 @@ public class BasicSliderUI extends SliderUI */ public void mouseDragged(MouseEvent e) { + dragging = true; if (slider.isEnabled()) { currentMouseX = e.getX(); @@ -450,6 +451,7 @@ public class BasicSliderUI extends SliderUI */ public void mouseReleased(MouseEvent e) { + dragging = false; if (slider.isEnabled()) { currentMouseX = e.getX(); @@ -593,6 +595,9 @@ public class BasicSliderUI extends SliderUI /** True if the slider has focus. */ private transient boolean hasFocus; + + /** True if the user is dragging the slider. */ + boolean dragging; /** * Creates a new Basic look and feel Slider UI. @@ -605,6 +610,18 @@ public class BasicSliderUI extends SliderUI } /** + * Returns true if the user is dragging the slider. + * + * @return true if the slider is being dragged. + * + * @since 1.5 + */ + protected boolean isDragging() + { + return dragging; + } + + /** * Gets the shadow color to be used for this slider. The shadow color is the * color used for drawing the top and left edges of the track. * |