45 |
45 |
*
|
46 |
46 |
* $Id$
|
47 |
47 |
* $Log$
|
48 |
|
* Revision 1.2 2006-06-23 19:04:23 azabala
|
|
48 |
* Revision 1.3 2006-06-27 16:14:29 azabala
|
|
49 |
* added geoprocess panel opening with user mouse interaction
|
|
50 |
*
|
|
51 |
* Revision 1.2 2006/06/23 19:04:23 azabala
|
49 |
52 |
* bug for tree creation by namespacies resolved
|
50 |
53 |
*
|
51 |
54 |
* Revision 1.1 2006/06/22 17:46:30 azabala
|
... | ... | |
55 |
58 |
*/
|
56 |
59 |
package com.iver.cit.gvsig.geoprocess.manager;
|
57 |
60 |
|
|
61 |
import java.awt.event.MouseListener;
|
58 |
62 |
import java.util.Iterator;
|
59 |
63 |
|
60 |
64 |
import javax.swing.JFrame;
|
... | ... | |
64 |
68 |
import javax.swing.tree.DefaultMutableTreeNode;
|
65 |
69 |
import javax.swing.tree.TreeSelectionModel;
|
66 |
70 |
|
|
71 |
import com.iver.andami.PluginServices;
|
67 |
72 |
import com.iver.cit.gvsig.geoprocess.core.IGeoprocessPlugin;
|
68 |
73 |
import com.iver.cit.gvsig.geoprocess.impl.buffer.BufferGeoprocessPlugin;
|
69 |
74 |
import com.iver.cit.gvsig.geoprocess.impl.clip.ClipGeoprocessPlugin;
|
... | ... | |
84 |
89 |
*
|
85 |
90 |
*/
|
86 |
91 |
public class GeoprocessTree extends JScrollPane implements IGeoprocessTree {
|
|
92 |
private static final long serialVersionUID = -6244491453178280294L;
|
87 |
93 |
private JTree tree;
|
88 |
94 |
DefaultMutableTreeNode root;
|
89 |
95 |
final GeoprocessTreeDirectory ROOT = new GeoprocessTreeDirectory();
|
... | ... | |
91 |
97 |
public GeoprocessTree() {
|
92 |
98 |
super();
|
93 |
99 |
root = new DefaultMutableTreeNode();
|
|
100 |
ROOT.description = "";
|
94 |
101 |
root.setUserObject(ROOT);
|
95 |
102 |
tree = new JTree(root);
|
96 |
103 |
loadGeoprocesses();
|
... | ... | |
154 |
161 |
break;
|
155 |
162 |
boolean match = true;
|
156 |
163 |
for(int i = 0; i < numChilds; i++){
|
|
164 |
match = true;//is true if we dont verify is false
|
157 |
165 |
scanned =
|
158 |
166 |
(DefaultMutableTreeNode) bestMatch.getChildAt(i);
|
159 |
167 |
if(scanned.isLeaf() ||
|
... | ... | |
216 |
224 |
|
217 |
225 |
}
|
218 |
226 |
packageName += newPath[newPath.length -1];
|
219 |
|
String description = metadata.
|
220 |
|
getDescriptionForPackage(packageName);
|
|
227 |
String description = GeoprocessManager.
|
|
228 |
getDescriptionFor(packageName);
|
221 |
229 |
path.description = description;
|
222 |
230 |
prev.add(newNode);
|
223 |
231 |
prev = newNode;
|
... | ... | |
275 |
283 |
if(path != null && path.length > 0)
|
276 |
284 |
return path[path.length-1];
|
277 |
285 |
else
|
278 |
|
return "GpGvSig";
|
|
286 |
return PluginServices.getText(this,
|
|
287 |
"Geoprocesos");
|
279 |
288 |
}
|
280 |
289 |
}
|
281 |
290 |
|
... | ... | |
286 |
295 |
public void addTreeSelectionListener(TreeSelectionListener l) {
|
287 |
296 |
tree.addTreeSelectionListener(l);
|
288 |
297 |
}
|
|
298 |
|
|
299 |
public void addMouseListener(MouseListener l){
|
|
300 |
tree.addMouseListener(l);
|
|
301 |
}
|
289 |
302 |
}
|