home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / JScrollPane$ScrollBar.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  53 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.    private final JScrollPane this$0;
  11.  
  12.    public JScrollPane$ScrollBar(JScrollPane var1, int var2) {
  13.       super(var2);
  14.       this.this$0 = var1;
  15.    }
  16.  
  17.    public void setUnitIncrement(int var1) {
  18.       this.unitIncrementSet = true;
  19.       super.setUnitIncrement(var1);
  20.    }
  21.  
  22.    public int getUnitIncrement(int var1) {
  23.       JViewport var2 = this.this$0.getViewport();
  24.       if (!this.unitIncrementSet && var2 != null && var2.getView() instanceof Scrollable) {
  25.          Scrollable var3 = (Scrollable)var2.getView();
  26.          Rectangle var4 = var2.getViewRect();
  27.          return var3.getScrollableUnitIncrement(var4, ((JScrollBar)this).getOrientation(), var1);
  28.       } else {
  29.          return super.getUnitIncrement(var1);
  30.       }
  31.    }
  32.  
  33.    public void setBlockIncrement(int var1) {
  34.       this.blockIncrementSet = true;
  35.       super.setBlockIncrement(var1);
  36.    }
  37.  
  38.    public int getBlockIncrement(int var1) {
  39.       JViewport var2 = this.this$0.getViewport();
  40.       if (!this.blockIncrementSet && var2 != null) {
  41.          if (var2.getView() instanceof Scrollable) {
  42.             Scrollable var3 = (Scrollable)var2.getView();
  43.             Rectangle var4 = var2.getViewRect();
  44.             return var3.getScrollableBlockIncrement(var4, ((JScrollBar)this).getOrientation(), var1);
  45.          } else {
  46.             return ((JScrollBar)this).getOrientation() == 1 ? var2.getExtentSize().height : var2.getExtentSize().width;
  47.          }
  48.       } else {
  49.          return super.getBlockIncrement(var1);
  50.       }
  51.    }
  52. }
  53.