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$TreeHomeAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.0 KB  |  76 lines

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