home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JScrollPane$ScrollBar.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.5 KB  |  56 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Rectangle;
  4. import javax.swing.plaf.UIResource;
  5.  
  6. public class JScrollPane$ScrollBar extends JScrollBar implements UIResource {
  7.    private boolean unitIncrementSet;
  8.    private boolean blockIncrementSet;
  9.    // $FF: synthetic field
  10.    final JScrollPane this$0;
  11.  
  12.    public JScrollPane$ScrollBar(JScrollPane var1, int var2) {
  13.       super(var2);
  14.       this.this$0 = var1;
  15.       this.putClientProperty("JScrollBar.fastWheelScrolling", Boolean.TRUE);
  16.    }
  17.  
  18.    public void setUnitIncrement(int var1) {
  19.       this.unitIncrementSet = true;
  20.       this.putClientProperty("JScrollBar.fastWheelScrolling", (Object)null);
  21.       super.setUnitIncrement(var1);
  22.    }
  23.  
  24.    public int getUnitIncrement(int var1) {
  25.       JViewport var2 = this.this$0.getViewport();
  26.       if (!this.unitIncrementSet && var2 != null && var2.getView() instanceof Scrollable) {
  27.          Scrollable var3 = (Scrollable)var2.getView();
  28.          Rectangle var4 = var2.getViewRect();
  29.          return var3.getScrollableUnitIncrement(var4, this.getOrientation(), var1);
  30.       } else {
  31.          return super.getUnitIncrement(var1);
  32.       }
  33.    }
  34.  
  35.    public void setBlockIncrement(int var1) {
  36.       this.blockIncrementSet = true;
  37.       this.putClientProperty("JScrollBar.fastWheelScrolling", (Object)null);
  38.       super.setBlockIncrement(var1);
  39.    }
  40.  
  41.    public int getBlockIncrement(int var1) {
  42.       JViewport var2 = this.this$0.getViewport();
  43.       if (!this.blockIncrementSet && var2 != null) {
  44.          if (var2.getView() instanceof Scrollable) {
  45.             Scrollable var3 = (Scrollable)var2.getView();
  46.             Rectangle var4 = var2.getViewRect();
  47.             return var3.getScrollableBlockIncrement(var4, this.getOrientation(), var1);
  48.          } else {
  49.             return this.getOrientation() == 1 ? var2.getExtentSize().height : var2.getExtentSize().width;
  50.          }
  51.       } else {
  52.          return super.getBlockIncrement(var1);
  53.       }
  54.    }
  55. }
  56.