Revision 6490
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/manager/GeoprocessTree.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.3 2006-06-27 16:14:29 azabala |
|
48 |
* Revision 1.4 2006-07-21 09:32:01 azabala |
|
49 |
* fixed bug 644: disabling ok button untill user select a geoprocess |
|
50 |
* |
|
51 |
* Revision 1.3 2006/06/27 16:14:29 azabala |
|
49 | 52 |
* added geoprocess panel opening with user mouse interaction |
50 | 53 |
* |
51 | 54 |
* Revision 1.2 2006/06/23 19:04:23 azabala |
... | ... | |
80 | 83 |
* This component shows all registered geoprocesses in extension point |
81 | 84 |
* "GeoprocessManager", in a tree style. |
82 | 85 |
* |
83 |
* Its tree hasnt root node, and different subnodes represents an organization
|
|
86 |
* Its different subnodes represents an organization |
|
84 | 87 |
* of geoprocesses. |
85 | 88 |
* |
86 | 89 |
* Leaf nodes are IGeoprocessPlugin instances. |
... | ... | |
111 | 114 |
|
112 | 115 |
public static void main(String[] args){ |
113 | 116 |
JFrame f = new JFrame(); |
114 |
//ESTO SE HARA EN EL METODO INITIALIZE DE CADA EXTENSION |
|
115 | 117 |
ExtensionPoints extensionPoints = |
116 | 118 |
ExtensionPointsSingleton.getInstance(); |
117 | 119 |
extensionPoints.add("GeoprocessManager","BUFFER", BufferGeoprocessPlugin.class); |
118 | 120 |
extensionPoints.add("GeoprocessManager","CLIP", ClipGeoprocessPlugin.class); |
119 |
//REVISAR ESTO ULTIMO, PUES EST? PETANDO |
|
120 |
// GeoprocessTree tree = new GeoprocessTree(); |
|
121 | 121 |
GeoprocessManager tree = new GeoprocessManager(); |
122 | 122 |
f.getContentPane().add(tree); |
123 | 123 |
f.setSize(800,600); |
... | ... | |
148 | 148 |
} |
149 | 149 |
} |
150 | 150 |
|
151 |
/** |
|
152 |
* Registers a new geoprocess (linked to the plugin) |
|
153 |
* in the geoprocess manager. |
|
154 |
*/ |
|
151 | 155 |
public void register(IGeoprocessPlugin metadata) { |
152 | 156 |
String namespace = metadata.getNamespace(); |
153 | 157 |
String[] directories = getObjectsInPath(namespace); |
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/manager/GeoprocessManager.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.4 2006-07-04 16:42:37 azabala |
|
48 |
* Revision 1.5 2006-07-21 09:32:01 azabala |
|
49 |
* fixed bug 644: disabling ok button untill user select a geoprocess |
|
50 |
* |
|
51 |
* Revision 1.4 2006/07/04 16:42:37 azabala |
|
49 | 52 |
* *** empty log message *** |
50 | 53 |
* |
51 | 54 |
* Revision 1.3 2006/06/27 16:16:49 azabala |
... | ... | |
92 | 95 |
import com.iver.cit.gvsig.geoprocess.core.gui.IGeoprocessPanel; |
93 | 96 |
import com.iver.cit.gvsig.geoprocess.manager.GeoprocessTree.GeoprocessTreeDirectory; |
94 | 97 |
|
98 |
/** |
|
99 |
* Main panel of the Geoprocess Manager gui component. |
|
100 |
* |
|
101 |
* It has a tree where shows all geoprocesses structure, and |
|
102 |
* buttons to open geoprocess' panel, and to close itself. |
|
103 |
* |
|
104 |
* It also listens for tree selection events. |
|
105 |
* |
|
106 |
* @author azabala |
|
107 |
* |
|
108 |
*/ |
|
95 | 109 |
public class GeoprocessManager extends JPanel |
96 | 110 |
implements View, TreeSelectionListener { |
97 | 111 |
|
... | ... | |
284 | 298 |
getText(this, "Error_seleccionar_gp_desc"); |
285 | 299 |
JOptionPane.showMessageDialog(this, errorDescription, error, |
286 | 300 |
JOptionPane.ERROR_MESSAGE); |
301 |
return; |
|
287 | 302 |
} |
288 | 303 |
IGeoprocessPanel panel = |
289 | 304 |
geoprocess.getGeoprocessPanel(); |
... | ... | |
307 | 322 |
openGeoprocessPanel(); |
308 | 323 |
} |
309 | 324 |
}); |
325 |
//it will be disabled until user select a geoprocess |
|
326 |
//in the tree |
|
327 |
openGeoprocess.setEnabled(false); |
|
310 | 328 |
} |
311 | 329 |
return openGeoprocess; |
312 | 330 |
} |
... | ... | |
329 | 347 |
} |
330 | 348 |
|
331 | 349 |
|
332 |
|
|
333 |
|
|
350 |
|
|
351 |
/** |
|
352 |
* processes tree selection events. |
|
353 |
*/ |
|
334 | 354 |
public void valueChanged(TreeSelectionEvent event) { |
335 | 355 |
DefaultMutableTreeNode selectedNode = |
336 | 356 |
(DefaultMutableTreeNode) event.getPath(). |
... | ... | |
344 | 364 |
} catch (IOException e) { |
345 | 365 |
htmlPane.setText("<p>Descripcion no disponible</p>"); |
346 | 366 |
} |
367 |
getJButtonOpenGeop().setEnabled(true); |
|
347 | 368 |
}else{ |
348 | 369 |
GeoprocessTreeDirectory directory = |
349 | 370 |
(GeoprocessTreeDirectory)userObject; |
350 | 371 |
htmlPane.setText("<p>"+ |
351 | 372 |
directory.getDescription()+ |
352 | 373 |
"</p>"); |
374 |
getJButtonOpenGeop().setEnabled(false); |
|
353 | 375 |
} |
354 | 376 |
} |
355 | 377 |
|
Also available in: Unified diff