jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java
changeset 38985 2c576be3968c
parent 37698 4d798c873df0
equal deleted inserted replaced
38984:bbded3eab454 38985:2c576be3968c
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   199         }
   199         }
   200         return SynthContext.getContext(c, region, style, state);
   200         return SynthContext.getContext(c, region, style, state);
   201     }
   201     }
   202 
   202 
   203     private int getComponentState(JComponent c, Region region) {
   203     private int getComponentState(JComponent c, Region region) {
   204         if (region == Region.SCROLL_BAR_THUMB && isThumbRollover() &&
   204         if (region == Region.SCROLL_BAR_THUMB && c.isEnabled()) {
   205                                                  c.isEnabled()) {
   205             if (isDragging) {
   206             return MOUSE_OVER;
   206                 return PRESSED;
       
   207             } else if (isThumbRollover()) {
       
   208                 return MOUSE_OVER;
       
   209             }
   207         }
   210         }
   208         return SynthLookAndFeel.getComponentState(c);
   211         return SynthLookAndFeel.getComponentState(c);
   209     }
   212     }
   210 
   213 
   211     /**
   214     /**