home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / plaf / basic / BasicTreeUI$TreeIncrementAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.9 KB  |  62 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5.  
  6. public class BasicTreeUI$TreeIncrementAction extends AbstractAction {
  7.    protected int direction;
  8.    private boolean addToSelection;
  9.    private boolean changeSelection;
  10.    // $FF: synthetic field
  11.    private final BasicTreeUI this$0;
  12.  
  13.    public BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3) {
  14.       this(var1, var2, var3, false, true);
  15.    }
  16.  
  17.    private BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
  18.       this.this$0 = var1;
  19.       this.direction = var2;
  20.       this.addToSelection = var4;
  21.       this.changeSelection = var5;
  22.    }
  23.  
  24.    public void actionPerformed(ActionEvent var1) {
  25.       int var2;
  26.       if (this.this$0.tree != null && this.this$0.treeSelectionModel != null && (var2 = this.this$0.getRowCount(this.this$0.tree)) > 0) {
  27.          int var3 = BasicTreeUI.access$1300(this.this$0);
  28.          int var4;
  29.          if (var3 == -1) {
  30.             if (this.direction == 1) {
  31.                var4 = 0;
  32.             } else {
  33.                var4 = var2 - 1;
  34.             }
  35.          } else {
  36.             var4 = Math.min(var2 - 1, Math.max(0, var3 + this.direction));
  37.          }
  38.  
  39.          if (this.addToSelection) {
  40.             BasicTreeUI.access$1500(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4));
  41.          } else if (this.changeSelection) {
  42.             this.this$0.tree.setSelectionInterval(var4, var4);
  43.          } else {
  44.             BasicTreeUI.access$1400(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4), true);
  45.          }
  46.  
  47.          this.this$0.ensureRowsAreVisible(var4, var4);
  48.          this.this$0.lastSelectedRow = var4;
  49.       }
  50.  
  51.    }
  52.  
  53.    public boolean isEnabled() {
  54.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  55.    }
  56.  
  57.    // $FF: synthetic method
  58.    BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5, BasicTreeUI.1 var6) {
  59.       this(var1, var2, var3, var4, var5);
  60.    }
  61. }
  62.