Revision 31496 branches/v2_0_0_prep/extensions/extSextanteGvsigBindings/src/org/gvsig/sextante/gui/gvPostProcessTask.java
gvPostProcessTask.java | ||
---|---|---|
3 | 3 |
import java.awt.Component; |
4 | 4 |
import java.lang.reflect.InvocationTargetException; |
5 | 5 |
import java.util.ArrayList; |
6 |
import java.util.List; |
|
6 | 7 |
|
7 | 8 |
import javax.swing.BorderFactory; |
8 | 9 |
import javax.swing.JScrollPane; |
... | ... | |
14 | 15 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
15 | 16 |
import org.gvsig.app.extension.ProjectExtension; |
16 | 17 |
import org.gvsig.app.project.Project; |
17 |
import org.gvsig.app.project.ProjectFactory; |
|
18 |
import org.gvsig.app.project.documents.table.FeatureTableDocument; |
|
19 |
import org.gvsig.app.project.documents.view.ProjectView; |
|
20 |
import org.gvsig.app.project.documents.view.ProjectViewFactory; |
|
18 |
import org.gvsig.app.project.ProjectManager; |
|
19 |
import org.gvsig.app.project.documents.Document; |
|
20 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
21 |
import org.gvsig.app.project.documents.view.DefaultViewDocument; |
|
22 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
21 | 23 |
import org.gvsig.fmap.mapcontext.MapContext; |
22 | 24 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
23 | 25 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
24 | 26 |
import org.gvsig.fmap.mapcontext.layers.LayersIterator; |
25 | 27 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE; |
26 | 28 |
|
27 |
|
|
28 | 29 |
import es.unex.sextante.core.GeoAlgorithm; |
29 | 30 |
import es.unex.sextante.core.ObjectAndDescription; |
30 | 31 |
import es.unex.sextante.core.OutputObjectsSet; |
... | ... | |
64 | 65 |
|
65 | 66 |
private void setOutputView() { |
66 | 67 |
|
67 |
ProjectView view = null;
|
|
68 |
DefaultViewDocument view = null;
|
|
68 | 69 |
ParametersSet parameters = m_Algorithm.getParameters(); |
69 | 70 |
for (int i = 0; i < parameters.getNumberOfParameters(); i++) { |
70 | 71 |
Parameter param = parameters.getParameter(i); |
... | ... | |
93 | 94 |
} |
94 | 95 |
} |
95 | 96 |
|
96 |
final ProjectView newView = ProjectFactory.createView("NUEVA");
|
|
97 |
((ProjectExtension) PluginServices.getExtension(ProjectExtension.class))
|
|
98 |
.getProject().addDocument(newView);
|
|
99 |
final IWindow window = newView.createWindow();
|
|
97 |
final DefaultViewDocument newView = (DefaultViewDocument) ProjectManager.getInstance().createDocument(ViewManager.TYPENAME,"NUEVA");
|
|
98 |
final Project project = ProjectManager.getInstance().getCurrentProject();
|
|
99 |
project.add(newView);
|
|
100 |
final IWindow window = newView.getFactory().getMainWindow(newView);
|
|
100 | 101 |
|
101 | 102 |
Runnable doWorkRunnable = new Runnable() { |
102 | 103 |
public void run() { |
... | ... | |
115 | 116 |
|
116 | 117 |
} |
117 | 118 |
|
118 |
private ProjectView getViewFromLayer(ILayer layer) {
|
|
119 |
private DefaultViewDocument getViewFromLayer(ILayer layer) {
|
|
119 | 120 |
|
120 | 121 |
FLayer gvSIGBaseLayer = (FLayer) layer.getBaseDataObject(); |
121 |
Project project = ((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject(); |
|
122 |
ArrayList views = project.getDocumentsByType(ProjectViewFactory.registerName); |
|
122 |
//Project project = ((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject(); |
|
123 |
final Project project = ProjectManager.getInstance().getCurrentProject(); |
|
124 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
123 | 125 |
|
124 | 126 |
for (int i = 0; i < views.size(); i++) { |
125 |
ProjectView view = (ProjectView) views.get(i);
|
|
127 |
DefaultViewDocument view = (DefaultViewDocument) views.get(i);
|
|
126 | 128 |
FLayers layers = view.getMapContext().getLayers(); |
127 | 129 |
LayersIterator iter = new LayersIterator(layers); |
128 | 130 |
while (iter.hasNext()){ |
... | ... | |
165 | 167 |
} |
166 | 168 |
else if (object instanceof ITable){ |
167 | 169 |
try { |
168 |
FeatureTableDocument table = (FeatureTableDocument) ((ITable)object).getBaseDataObject();
|
|
170 |
TableDocument table = (TableDocument) ((ITable)object).getBaseDataObject();
|
|
169 | 171 |
if (table != null){ |
170 | 172 |
((ProjectExtension) PluginServices.getExtension(ProjectExtension.class)) |
171 |
.getProject().addDocument(table);
|
|
173 |
.getProject().add(table); |
|
172 | 174 |
|
173 | 175 |
SextanteGUI.getInputFactory().addDataObject((IDataObject) object); |
174 | 176 |
} |
Also available in: Unified diff