Revision 31496 branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/JoinToolExtension.java
JoinToolExtension.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import java.util.ArrayList; |
31 | 31 |
import java.util.Iterator; |
32 |
import java.util.List; |
|
32 | 33 |
|
33 |
import org.gvsig.andami.PluginServices; |
|
34 | 34 |
import org.gvsig.andami.messages.NotificationManager; |
35 |
import org.gvsig.app.extension.ProjectExtension; |
|
36 | 35 |
import org.gvsig.app.extension.TableOperations; |
37 | 36 |
import org.gvsig.app.join.dal.feature.JoinTransform; |
38 |
import org.gvsig.app.project.documents.table.FeatureTableDocument;
|
|
39 |
import org.gvsig.app.project.documents.table.FeatureTableDocumentFactory;
|
|
40 |
import org.gvsig.fmap.dal.DALLocator;
|
|
41 |
import org.gvsig.fmap.dal.DataManager;
|
|
37 |
import org.gvsig.app.project.Project;
|
|
38 |
import org.gvsig.app.project.ProjectManager;
|
|
39 |
import org.gvsig.app.project.documents.table.TableDocument;
|
|
40 |
import org.gvsig.app.project.documents.table.TableManager;
|
|
42 | 41 |
import org.gvsig.fmap.dal.exception.DataException; |
43 | 42 |
import org.gvsig.fmap.dal.exception.ReadException; |
44 | 43 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
50 | 49 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
51 | 50 |
*/ |
52 | 51 |
public class JoinToolExtension extends TableOperations { |
53 |
private FeatureStore featureStore = null; |
|
52 |
// private FeatureStore featureStore = null;
|
|
54 | 53 |
|
55 | 54 |
/** |
56 | 55 |
* @see com.iver.mdiApp.plugins.IExtension#updateUI(java.lang.String) |
57 | 56 |
*/ |
58 | 57 |
public void execute(String actionCommand) { |
59 |
ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
60 |
org.gvsig.app.project.Project project=pe.getProject(); |
|
61 |
FeatureTableDocument[] pts = project.getDocumentsByType(FeatureTableDocumentFactory.registerName) |
|
62 |
.toArray(new FeatureTableDocument[0]); |
|
58 |
// ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
59 |
// org.gvsig.app.project.Project project=pe.getProject(); |
|
60 |
Project project = ProjectManager.getInstance().getCurrentProject(); |
|
61 |
TableDocument[] pts = project.getDocuments(TableManager.TYPENAME) |
|
62 |
.toArray(new TableDocument[0]); |
|
63 | 63 |
|
64 | 64 |
JoinWizardController wizardController = new JoinWizardController(this); |
65 | 65 |
wizardController.runWizard(pts); |
66 | 66 |
} |
67 | 67 |
|
68 |
public void execJoin(FeatureTableDocument sourceProjectTable, |
|
68 |
@SuppressWarnings("unchecked") |
|
69 |
public void execJoin(TableDocument sourceProjectTable, |
|
69 | 70 |
String field1, String prefix1, |
70 |
FeatureTableDocument targetProjectTable, String field2,
|
|
71 |
TableDocument targetProjectTable, String field2, |
|
71 | 72 |
String prefix2) { |
72 | 73 |
|
73 | 74 |
FeatureStore fs1 = sourceProjectTable.getStore(); |
... | ... | |
80 | 81 |
} |
81 | 82 |
|
82 | 83 |
try { |
83 |
DataManager dm = DALLocator.getDataManager(); |
|
84 |
// DataManager dm = DALLocator.getDataManager();
|
|
84 | 85 |
JoinTransform jt = new JoinTransform(); |
85 |
ArrayList<String> fields = new ArrayList<String>();
|
|
86 |
Iterator iterator2 = fs2.getDefaultFeatureType().iterator(); |
|
86 |
List<String> fields = new ArrayList<String>(); |
|
87 |
Iterator<FeatureAttributeDescriptor> iterator2 = fs2.getDefaultFeatureType().iterator();
|
|
87 | 88 |
while (iterator2.hasNext()) { |
88 | 89 |
FeatureAttributeDescriptor descriptor = (FeatureAttributeDescriptor) iterator2 |
89 | 90 |
.next(); |
Also available in: Unified diff