Revision 44406 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/DefaultExportProcess.java
DefaultExportProcess.java | ||
---|---|---|
1 | 1 |
package org.gvsig.export.impl; |
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 |
import java.util.Objects; |
|
5 |
import javax.swing.JOptionPane; |
|
4 | 6 |
import org.cresques.cts.ICoordTrans; |
5 | 7 |
import org.cresques.cts.IProjection; |
6 | 8 |
import org.gvsig.export.ExportException; |
... | ... | |
15 | 17 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
16 | 18 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
17 | 19 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
20 |
import org.gvsig.tools.ToolsLocator; |
|
21 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
18 | 22 |
import org.gvsig.tools.task.TaskStatus; |
19 | 23 |
|
20 | 24 |
/** |
... | ... | |
68 | 72 |
this.service = this.factory.createService(this.parameters); |
69 | 73 |
this.parameters.setSourceFeatureStore(this.sourceFeatureStore); |
70 | 74 |
this.parameters.setContext(this.context); |
71 |
|
|
75 |
|
|
72 | 76 |
this.featuresToUse = this.parameters.getFeaturesToUse(); |
73 |
this.filterExpression = this.parameters.getFilterExpresion(); |
|
77 |
if (Objects.equals(this.filterExpression, this.parameters.getFilterExpresion())) { |
|
78 |
int keepFilter = ToolsSwingLocator.getThreadSafeDialogsManager().confirmDialog( |
|
79 |
ToolsLocator.getI18nManager().getTranslation("_Do_you_want_to_keep_the_applied_filter_and_not_use_the_one_in_the_parameters"), |
|
80 |
ToolsLocator.getI18nManager().getTranslation("_Filter_to_apply"), |
|
81 |
JOptionPane.YES_NO_OPTION, |
|
82 |
JOptionPane.WARNING_MESSAGE, |
|
83 |
"exporto-overwrite-expression-parameters"); |
|
84 |
if (keepFilter == JOptionPane.YES_OPTION) { |
|
85 |
this.parameters.setFilterExpresion(this.filterExpression); |
|
86 |
} else { |
|
87 |
this.filterExpression = this.parameters.getFilterExpresion(); |
|
88 |
} |
|
89 |
} else { |
|
90 |
this.filterExpression = this.parameters.getFilterExpresion(); |
|
91 |
} |
|
92 |
|
|
74 | 93 |
if (this.parameters instanceof ExportParametersGeometry) { |
75 | 94 |
ExportParametersGeometry pa = (ExportParametersGeometry) this.parameters; |
76 | 95 |
this.contextProjection = pa.getContextProjection(); |
77 | 96 |
this.sourceProjection = pa.getSourceProjection(); |
78 | 97 |
this.sourceTransformation = pa.getSourceTransformation(); |
98 |
|
|
79 | 99 |
} |
80 | 100 |
} |
81 |
|
|
101 |
|
|
82 | 102 |
@Override |
83 |
public void setSourceFeatureStore(FeatureStore store) { |
|
103 |
public void setSourceFeatureStore(FeatureStore store |
|
104 |
) { |
|
84 | 105 |
this.sourceFeatureStore = store; |
85 | 106 |
if (this.parameters != null) { |
86 | 107 |
this.parameters.setSourceFeatureStore(sourceFeatureStore); |
... | ... | |
88 | 109 |
} |
89 | 110 |
|
90 | 111 |
@Override |
91 |
public void setContextProjection(IProjection projection) { |
|
112 |
public void setContextProjection(IProjection projection |
|
113 |
) { |
|
92 | 114 |
this.contextProjection = projection; |
93 | 115 |
if (this.parameters instanceof ExportParametersGeometry) { |
94 | 116 |
((ExportParametersGeometry) this.parameters).setContextProjection(projection); |
... | ... | |
96 | 118 |
} |
97 | 119 |
|
98 | 120 |
@Override |
99 |
public void setSourceTransformation(ICoordTrans transformation) { |
|
121 |
public void setSourceTransformation(ICoordTrans transformation |
|
122 |
) { |
|
100 | 123 |
this.sourceTransformation = transformation; |
101 | 124 |
if (this.parameters instanceof ExportParametersGeometry) { |
102 | 125 |
((ExportParametersGeometry) this.parameters).setSourceTransformation(transformation); |
... | ... | |
104 | 127 |
} |
105 | 128 |
|
106 | 129 |
@Override |
107 |
public void setSourceProjection(IProjection projection) { |
|
130 |
public void setSourceProjection(IProjection projection |
|
131 |
) { |
|
108 | 132 |
this.sourceProjection = projection; |
109 | 133 |
if (this.parameters instanceof ExportParametersGeometry) { |
110 | 134 |
((ExportParametersGeometry) this.parameters).setSourceProjection(projection); |
... | ... | |
117 | 141 |
} |
118 | 142 |
|
119 | 143 |
@Override |
120 |
public void setContext(Object context) { |
|
144 |
public void setContext(Object context |
|
145 |
) { |
|
121 | 146 |
this.context = context; |
122 | 147 |
if (this.parameters != null) { |
123 | 148 |
this.parameters.setContext(context); |
... | ... | |
178 | 203 |
} |
179 | 204 |
|
180 | 205 |
@Override |
181 |
public void setFilterExpression(Expression expression) { |
|
206 |
public void setFilterExpression(Expression expression |
|
207 |
) { |
|
182 | 208 |
this.filterExpression = expression; |
183 | 209 |
if (this.parameters != null) { |
184 | 210 |
this.parameters.setFilterExpresion(expression); |
... | ... | |
191 | 217 |
} |
192 | 218 |
|
193 | 219 |
@Override |
194 |
public void setFeaturesToUse(int featuresToUse) { |
|
220 |
public void setFeaturesToUse(int featuresToUse |
|
221 |
) { |
|
195 | 222 |
this.featuresToUse = featuresToUse; |
196 | 223 |
if (this.parameters != null) { |
197 | 224 |
this.parameters.setFeaturesToUse(featuresToUse); |
Also available in: Unified diff