1 19 package org.openide.nodes; 20 21 22 26 public final class NodeReorderEvent extends NodeEvent { 27 static final long serialVersionUID = 4479234495493767448L; 28 29 30 private int[] newIndices; 31 32 36 NodeReorderEvent(Node n, int[] newIndices) { 37 super(n); 38 this.newIndices = newIndices; 39 } 40 41 45 public int newIndexOf(int i) { 46 return newIndices[i]; 47 } 48 49 52 public int[] getPermutation() { 53 return newIndices; 54 } 55 56 58 public int getPermutationSize() { 59 return newIndices.length; 60 } 61 62 63 public String toString() { 64 StringBuffer sb = new StringBuffer (); 65 sb.append(getClass().getName()); 66 sb.append("[node="); sb.append(getSource()); 68 sb.append(", permutation = ("); 70 int[] perm = getPermutation(); 71 72 for (int i = 0; i < perm.length;) { 73 sb.append(perm[i]); 74 75 if (++i < perm.length) { 76 sb.append(", "); } 78 } 79 80 sb.append(")]"); 82 return sb.toString(); 83 } 84 } 85 | Popular Tags |