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 / TreeModelEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.9 KB  |  92 lines

  1. package javax.swing.event;
  2.  
  3. import java.util.EventObject;
  4. import javax.swing.tree.TreePath;
  5.  
  6. public class TreeModelEvent extends EventObject {
  7.    protected TreePath path;
  8.    protected int[] childIndices;
  9.    protected Object[] children;
  10.  
  11.    public TreeModelEvent(Object var1, Object[] var2, int[] var3, Object[] var4) {
  12.       this(var1, new TreePath(var2), var3, var4);
  13.    }
  14.  
  15.    public TreeModelEvent(Object var1, TreePath var2, int[] var3, Object[] var4) {
  16.       super(var1);
  17.       this.path = var2;
  18.       this.childIndices = var3;
  19.       this.children = var4;
  20.    }
  21.  
  22.    public TreeModelEvent(Object var1, Object[] var2) {
  23.       this(var1, new TreePath(var2));
  24.    }
  25.  
  26.    public TreeModelEvent(Object var1, TreePath var2) {
  27.       super(var1);
  28.       this.path = var2;
  29.       this.childIndices = new int[0];
  30.    }
  31.  
  32.    public TreePath getTreePath() {
  33.       return this.path;
  34.    }
  35.  
  36.    public Object[] getPath() {
  37.       return this.path != null ? this.path.getPath() : null;
  38.    }
  39.  
  40.    public Object[] getChildren() {
  41.       if (this.children != null) {
  42.          int var1 = this.children.length;
  43.          Object[] var2 = new Object[var1];
  44.          System.arraycopy(this.children, 0, var2, 0, var1);
  45.          return var2;
  46.       } else {
  47.          return null;
  48.       }
  49.    }
  50.  
  51.    public int[] getChildIndices() {
  52.       if (this.childIndices != null) {
  53.          int var1 = this.childIndices.length;
  54.          int[] var2 = new int[var1];
  55.          System.arraycopy(this.childIndices, 0, var2, 0, var1);
  56.          return var2;
  57.       } else {
  58.          return null;
  59.       }
  60.    }
  61.  
  62.    public String toString() {
  63.       StringBuffer var1 = new StringBuffer();
  64.       var1.append(this.getClass().getName() + " " + Integer.toString(this.hashCode()));
  65.       if (this.path != null) {
  66.          var1.append(" path " + this.path);
  67.       }
  68.  
  69.       if (this.childIndices != null) {
  70.          var1.append(" indicices [ ");
  71.  
  72.          for(int var2 = 0; var2 < this.childIndices.length; ++var2) {
  73.             var1.append(Integer.toString(this.childIndices[var2]) + " ");
  74.          }
  75.  
  76.          var1.append("]");
  77.       }
  78.  
  79.       if (this.children != null) {
  80.          var1.append(" children [ ");
  81.  
  82.          for(int var3 = 0; var3 < this.children.length; ++var3) {
  83.             var1.append(this.children[var3] + " ");
  84.          }
  85.  
  86.          var1.append("]");
  87.       }
  88.  
  89.       return var1.toString();
  90.    }
  91. }
  92.