Lines 91-96
Link Here
|
91 |
/** linked list of removed nodes, that is filled in getChildren ().removed () method |
91 |
/** linked list of removed nodes, that is filled in getChildren ().removed () method |
92 |
*/ |
92 |
*/ |
93 |
public LinkedList removed = new LinkedList (); |
93 |
public LinkedList removed = new LinkedList (); |
|
|
94 |
|
95 |
private Node[]removedNodes; |
94 |
|
96 |
|
95 |
static final long serialVersionUID =5102881916407672392L; |
97 |
static final long serialVersionUID =5102881916407672392L; |
96 |
/** Constructor for add of nodes notification. |
98 |
/** Constructor for add of nodes notification. |
Lines 100-108
Link Here
|
100 |
*/ |
102 |
*/ |
101 |
public Removed ( |
103 |
public Removed ( |
102 |
VisualizerChildren ch, |
104 |
VisualizerChildren ch, |
103 |
int[] indx |
105 |
Node[] removedNodes |
104 |
) { |
106 |
) { |
105 |
super (ch, indx); |
107 |
super (ch, null); |
|
|
108 |
this.removedNodes = removedNodes; |
109 |
} |
110 |
|
111 |
public Node[] getRemovedNodes () { |
112 |
return removedNodes; |
113 |
} |
114 |
|
115 |
public void setRemovedIndicies (int[] arr) { |
116 |
super.array = arr; |
106 |
} |
117 |
} |
107 |
|
118 |
|
108 |
/** Process the event |
119 |
/** Process the event |
Lines 132-162
Link Here
|
132 |
super (ch, indx); |
143 |
super (ch, indx); |
133 |
} |
144 |
} |
134 |
|
145 |
|
135 |
/** Prepares list of changed indices for use in tree model. |
146 |
// /** Prepares list of changed indices for use in tree model. |
136 |
*/ |
147 |
// */ |
137 |
public int[] getChangedIndices () { |
148 |
// public int[] getChangedIndices () { |
138 |
if (changedIndices == null) { |
149 |
// if (changedIndices == null) { |
139 |
int[] permutation = super.getArray (); |
150 |
// int[] permutation = super.getArray (); |
140 |
int size = permutation.length; |
151 |
// int size = permutation.length; |
141 |
int changes = 0; |
152 |
// int changes = 0; |
142 |
for (int i = 0; i < size; i++) { |
153 |
// for (int i = 0; i < size; i++) { |
143 |
if (permutation[i] != i) |
154 |
// if (permutation[i] != i) |
144 |
changes++; |
155 |
// changes++; |
145 |
} |
156 |
// } |
146 |
|
157 |
// |
147 |
int[] indices = new int[changes]; |
158 |
// int[] indices = new int[changes]; |
148 |
|
159 |
// |
149 |
int current = 0; |
160 |
// int current = 0; |
150 |
for (int i = 0; i < size; i++) { |
161 |
// for (int i = 0; i < size; i++) { |
151 |
if (permutation[i] != i) { |
162 |
// if (permutation[i] != i) { |
152 |
indices[current++] = i; |
163 |
// indices[current++] = i; |
153 |
} |
164 |
// } |
154 |
} |
165 |
// } |
155 |
|
166 |
// |
156 |
changedIndices = indices; |
167 |
// changedIndices = indices; |
157 |
} |
168 |
// } |
158 |
return changedIndices; |
169 |
// return changedIndices; |
159 |
} |
170 |
// } |
160 |
|
171 |
|
161 |
/** Process the event |
172 |
/** Process the event |
162 |
*/ |
173 |
*/ |