home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicListUI$PageUpAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.4 KB  |  34 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Rectangle;
  4. import javax.swing.ListSelectionModel;
  5.  
  6. class BasicListUI$PageUpAction extends BasicListUI.IncrementLeadSelectionAction {
  7.    // $FF: synthetic field
  8.    private final BasicListUI this$0;
  9.  
  10.    protected BasicListUI$PageUpAction(BasicListUI var1, String var2, int var3) {
  11.       super(var1, var2, var3);
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    protected void ensureIndexIsVisible(int var1) {
  16.       Rectangle var2 = this.this$0.list.getVisibleRect();
  17.       Rectangle var3 = this.this$0.list.getCellBounds(var1, var1);
  18.       var3.height = var2.height;
  19.       this.this$0.list.scrollRectToVisible(var3);
  20.    }
  21.  
  22.    protected int getNextIndex() {
  23.       int var1 = this.this$0.list.getFirstVisibleIndex();
  24.       ListSelectionModel var2 = this.this$0.list.getSelectionModel();
  25.       if (var2.getLeadSelectionIndex() == var1) {
  26.          Rectangle var3 = this.this$0.list.getVisibleRect();
  27.          var3.y = Math.max(0, var3.y - var3.height);
  28.          var1 = this.this$0.list.locationToIndex(var3.getLocation());
  29.       }
  30.  
  31.       return var1;
  32.    }
  33. }
  34.