/** * Sets the ThumbBounds attribute of the XTraScrollBarUI object * * @param x The new ThumbBounds value * @param y The new ThumbBounds value * @param w The new ThumbBounds value * @param h The new ThumbBounds value */ public void setThumbBounds(int x, int y, int w, int h) { super.setThumbBounds(x, y, w, h); }
@Override protected void setThumbBounds(int x, int y, int width, int height) { super.setThumbBounds(x, y, width, height); scrollbar.repaint(); } });
@Override protected void setThumbBounds(int x, int y, int width, int height) { super.setThumbBounds(x, y, width, height); scrollbar.repaint(); } }
/** * This is overridden only to increase the invalid area. * This ensures that whole track will be repainted in case of installed callback */ @Override protected void setThumbBounds(int x, int y, int width, int height) { // A logic to override Swing's "ScrollBar.alwaysShowThumb" property (set by GTK+ L&F). // When the property is set, the thumb fits entire width/height of a scroll bar (see BasicScrollBarUI.layoutVScrollbar()). // The fix detects such situations and resets thumb size, thus hiding the thumb when not needed. if (width > 0 && height > 0 && UIManager.getBoolean("ScrollBar.alwaysShowThumb") && !alwaysShowTrack()) { int w = trackRect.width, h = trackRect.height; if (w > h && w == width || w < h && h == height) { x = y = width = height = 0; } } if (myRepaintCallback != null) { // We want to repaint whole scrollbar even if thumb wasn't moved (on small scroll of a big panel) // Even if scrollbar wasn't changed itself, myRepaintCallback could need repaint scrollbar.repaint(trackRect); } super.setThumbBounds(x, y, width, height); }