110 |
TreePath newLeadSelectionPath) |
TreePath newLeadSelectionPath) |
111 |
{ |
{ |
112 |
super(source); |
super(source); |
113 |
//TODO this.paths = new TreePath[1]{path}; |
this.paths = new TreePath[]{path}; |
114 |
//TODO this.areNew = new boolean[1]{isNew}; |
this.areNew = new boolean[]{isNew}; |
115 |
this.oldLeadSelectionPath = oldLeadSelectionPath; |
this.oldLeadSelectionPath = oldLeadSelectionPath; |
116 |
this.newLeadSelectionPath = newLeadSelectionPath; |
this.newLeadSelectionPath = newLeadSelectionPath; |
117 |
} // TreeSelectionEvent() |
} // TreeSelectionEvent() |
122 |
//------------------------------------------------------------- |
//------------------------------------------------------------- |
123 |
|
|
124 |
/** |
/** |
125 |
* getPath |
* @returns the first path element |
|
* @returns TreePath |
|
126 |
*/ |
*/ |
127 |
public TreePath getPath() |
public TreePath getPath() |
128 |
{ |
{ |
130 |
} // getPath() |
} // getPath() |
131 |
|
|
132 |
/** |
/** |
133 |
* getPaths |
* |
134 |
* @returns TreePath[] |
* @returns the paths with selection changed |
135 |
*/ |
*/ |
136 |
public TreePath[] getPaths() |
public TreePath[] getPaths() |
137 |
{ |
{ |
138 |
return paths; |
return (TreePath[]) paths.clone(); |
139 |
} // getPaths() |
} // getPaths() |
140 |
|
|
141 |
/** |
/** |
142 |
* isAddedPath |
* @return true if the first path is added to the selection, false otherwise |
|
* @returns boolean |
|
143 |
*/ |
*/ |
144 |
public boolean isAddedPath() |
public boolean isAddedPath() |
145 |
{ |
{ |
146 |
return false; // TODO |
return areNew[0]; |
147 |
} // isAddedPath() |
} // isAddedPath() |
148 |
|
|
149 |
/** |
/** |
150 |
* isAddedPath |
* @param path the path to check |
151 |
* @param path TODO |
* @return true if the path is added to the selection, false otherwise |
|
* @returns boolean |
|
152 |
*/ |
*/ |
153 |
public boolean isAddedPath(TreePath path) |
public boolean isAddedPath(TreePath path) |
154 |
{ |
{ |
155 |
return false; // TODO |
for (int i = paths.length - 1; i >= 0; i--) |
156 |
|
if (paths[i].equals(path)) |
157 |
|
return areNew[i]; |
158 |
|
|
159 |
|
return false; |
160 |
} // isAddedPath() |
} // isAddedPath() |
161 |
|
|
162 |
/** |
/** |
163 |
* isAddedPath |
* @param index the index'th path |
164 |
* @param index TODO |
* @return true if the path is added to the selection, false otherwise |
|
* @returns boolean |
|
165 |
*/ |
*/ |
166 |
public boolean isAddedPath(int index) |
public boolean isAddedPath(int index) |
167 |
{ |
{ |
168 |
return false; // TODO |
return areNew[index]; |
169 |
} // isAddedPath() |
} // isAddedPath() |
170 |
|
|
171 |
/** |
/** |
172 |
* getOldLeadSelectionPath |
* @return the previous lead selection path |
|
* @returns TreePath |
|
173 |
*/ |
*/ |
174 |
public TreePath getOldLeadSelectionPath() |
public TreePath getOldLeadSelectionPath() |
175 |
{ |
{ |
177 |
} // getOldLeadSelectionPath() |
} // getOldLeadSelectionPath() |
178 |
|
|
179 |
/** |
/** |
180 |
* getNewLeadSelectionPath |
* @returns the current lead selection path |
|
* @returns TreePath |
|
181 |
*/ |
*/ |
182 |
public TreePath getNewLeadSelectionPath() |
public TreePath getNewLeadSelectionPath() |
183 |
{ |
{ |
185 |
} // getNewLeadSelectionPath() |
} // getNewLeadSelectionPath() |
186 |
|
|
187 |
/** |
/** |
188 |
* cloneWithSource |
* @param source the new event source |
189 |
* @param source TODO |
* @return a cloned event with another event source |
|
* @returns Object |
|
190 |
*/ |
*/ |
191 |
public Object cloneWithSource(Object source) |
public Object cloneWithSource(Object source) |
192 |
{ |
{ |
193 |
return null; // TODO |
return new TreeSelectionEvent (source, paths, areNew, |
194 |
|
oldLeadSelectionPath, |
195 |
|
newLeadSelectionPath); |
196 |
} // cloneWithSource() |
} // cloneWithSource() |
197 |
|
|
198 |
|
|