diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java index b29026342e0..78e5168fc80 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -302,8 +302,10 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, */ public void mouseMoved(MouseEvent e) { - // Not interested in where the mouse - // is unless it is being dragged. + if (thumbRect.contains(e.getPoint())) + thumbRollover = true; + else + thumbRollover = false; } /** @@ -486,6 +488,9 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, /** The scrollbar this UI is acting for. */ protected JScrollBar scrollbar; + + /** True if the mouse is over the thumb. */ + boolean thumbRollover; /** * This method adds a component to the layout. @@ -1401,4 +1406,45 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, value = min; return value; } + + /** + * Returns true if the mouse is over the thumb. + * + * @return true if the mouse is over the thumb. + * + * @since 1.5 + */ + public boolean isThumbRollover() + { + return thumbRollover; + } + + /** + * Set thumbRollover to active. This indicates + * whether or not the mouse is over the thumb. + * + * @param active - true if the mouse is over the thumb. + * + * @since 1.5 + */ + protected void setThumbRollover(boolean active) + { + thumbRollover = active; + } + + /** + * Indicates whether the user can position the thumb with + * a mouse click (i.e. middle button). + * + * @return true if the user can position the thumb with a mouse + * click. + * + * @since 1.5 + */ + public boolean getSupportsAbsolutePositioning() + { + // The positioning feature has not been implemented. + // So, false is always returned. + return false; + } } |