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 / event / TreeSelectionEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.7 KB  |  75 lines

  1. package javax.swing.event;
  2.  
  3. import java.util.EventObject;
  4. import javax.swing.tree.TreePath;
  5.  
  6. public class TreeSelectionEvent extends EventObject {
  7.    protected TreePath[] paths;
  8.    protected boolean[] areNew;
  9.    protected TreePath oldLeadSelectionPath;
  10.    protected TreePath newLeadSelectionPath;
  11.  
  12.    public TreeSelectionEvent(Object var1, TreePath[] var2, boolean[] var3, TreePath var4, TreePath var5) {
  13.       super(var1);
  14.       this.paths = var2;
  15.       this.areNew = var3;
  16.       this.oldLeadSelectionPath = var4;
  17.       this.newLeadSelectionPath = var5;
  18.    }
  19.  
  20.    public TreeSelectionEvent(Object var1, TreePath var2, boolean var3, TreePath var4, TreePath var5) {
  21.       super(var1);
  22.       this.paths = new TreePath[1];
  23.       this.paths[0] = var2;
  24.       this.areNew = new boolean[1];
  25.       this.areNew[0] = var3;
  26.       this.oldLeadSelectionPath = var4;
  27.       this.newLeadSelectionPath = var5;
  28.    }
  29.  
  30.    public TreePath[] getPaths() {
  31.       int var1 = this.paths.length;
  32.       TreePath[] var2 = new TreePath[var1];
  33.       System.arraycopy(this.paths, 0, var2, 0, var1);
  34.       return var2;
  35.    }
  36.  
  37.    public TreePath getPath() {
  38.       return this.paths[0];
  39.    }
  40.  
  41.    public boolean isAddedPath() {
  42.       return this.areNew[0];
  43.    }
  44.  
  45.    public boolean isAddedPath(TreePath var1) {
  46.       for(int var2 = this.paths.length - 1; var2 >= 0; --var2) {
  47.          if (this.paths[var2].equals(var1)) {
  48.             return this.areNew[var2];
  49.          }
  50.       }
  51.  
  52.       throw new IllegalArgumentException("path is not a path identified by the TreeSelectionEvent");
  53.    }
  54.  
  55.    public boolean isAddedPath(int var1) {
  56.       if (this.paths != null && var1 >= 0 && var1 < this.paths.length) {
  57.          return this.areNew[var1];
  58.       } else {
  59.          throw new IllegalArgumentException("index is beyond range of added paths identified by TreeSelectionEvent");
  60.       }
  61.    }
  62.  
  63.    public TreePath getOldLeadSelectionPath() {
  64.       return this.oldLeadSelectionPath;
  65.    }
  66.  
  67.    public TreePath getNewLeadSelectionPath() {
  68.       return this.newLeadSelectionPath;
  69.    }
  70.  
  71.    public Object cloneWithSource(Object var1) {
  72.       return new TreeSelectionEvent(var1, this.paths, this.areNew, this.oldLeadSelectionPath, this.newLeadSelectionPath);
  73.    }
  74. }
  75.