final void setBounds(Rectangle bounds) { Rectangle oldBounds = this.bounds.getBounds(); this.bounds.setBounds(bounds); if (!oldBounds.equals(bounds)) { doRepaint(); } }
void setValue(int type, int val) { int oldVal = value; value = Math.max(Math.min(val, maximum - visibleAmount), minimum); if (oldVal != value) { Rectangle oldRect = new Rectangle(state.getSliderRect()); comp.toolkit.theme.layoutScrollbar(state); // TODO: FIXME Rectangle paintRect = oldRect.union(state.getSliderRect()); paintRect.grow(0, 1); postAdjustmentEvent(type); doRepaint(paintRect); } }
/** Set parameters which cannot be set by public api methods */ void setSizes(int vis, int min, int max) { boolean repaint = false; if (vis != visibleAmount) { visibleAmount = vis; repaint = true; } if (min != minimum) { minimum = min; repaint = true; } if (max != maximum) { maximum = max; repaint = true; } if (repaint) { doRepaint(); } }
void doRepaint() { doRepaint(new Rectangle(new Point(), bounds.getSize())); }