45 |
45 |
import org.gvsig.daltransform.swing.impl.components.FeatureTypeAttributesCombo;
|
46 |
46 |
import org.gvsig.daltransform.swing.impl.components.FeatureTypeAttributesList;
|
47 |
47 |
import org.gvsig.fmap.dal.exception.DataException;
|
|
48 |
import org.gvsig.fmap.dal.exception.ParameterMissingException;
|
48 |
49 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
49 |
50 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
50 |
51 |
import org.gvsig.fmap.dal.feature.FeatureType;
|
... | ... | |
79 |
80 |
*/
|
80 |
81 |
public SelectParametersWizardPanel() {
|
81 |
82 |
super();
|
82 |
|
initComponents();
|
83 |
|
initLabels();
|
84 |
83 |
}
|
85 |
84 |
|
|
85 |
|
|
86 |
public void updatePanel() {
|
|
87 |
initComponents();
|
|
88 |
initLabels();
|
|
89 |
try {
|
|
90 |
updateFeatureStores();
|
|
91 |
} catch (DataException e) {
|
|
92 |
logger.error("While updating feature stores", e);
|
|
93 |
}
|
|
94 |
}
|
|
95 |
|
86 |
96 |
private void initLabels(){
|
87 |
97 |
key1Label.setText(PluginServices.getText(this,"join_first_key"));
|
88 |
98 |
key2Label.setText(PluginServices.getText(this,"join_second_key"));
|
... | ... | |
195 |
205 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
196 |
206 |
add(attributesScroll, gridBagConstraints);
|
197 |
207 |
}
|
|
208 |
|
198 |
209 |
|
199 |
210 |
/**
|
200 |
211 |
* @return
|
... | ... | |
231 |
242 |
return attributesList.getAttributesName();
|
232 |
243 |
}
|
233 |
244 |
|
|
245 |
|
|
246 |
public void setSecondFeatureStore(FeatureStore selectedFeatureStore) {
|
|
247 |
secondFeatStore = selectedFeatureStore;
|
|
248 |
|
|
249 |
}
|
234 |
250 |
/**
|
235 |
251 |
* @param selectedFeatureStore
|
236 |
252 |
* @throws DataException
|
237 |
253 |
*/
|
238 |
|
public void updateFeatureStores(FeatureStore selectedFeatureStore) throws DataException {
|
239 |
|
secondFeatStore = selectedFeatureStore;
|
|
254 |
public void updateFeatureStores() throws DataException {
|
|
255 |
|
|
256 |
if (secondFeatStore == null) {
|
|
257 |
throw new ParameterMissingException("Second feature store");
|
|
258 |
}
|
|
259 |
|
240 |
260 |
key1Combo.addFeatureAttributes(getFeatureStore().getDefaultFeatureType());
|
241 |
|
attributesList.addFeatureAttributes(selectedFeatureStore.getDefaultFeatureType());
|
|
261 |
attributesList.addFeatureAttributes(secondFeatStore.getDefaultFeatureType());
|
242 |
262 |
|
243 |
263 |
if (key1Combo.getItemCount() == 0) {
|
244 |
264 |
|
... | ... | |
291 |
311 |
TransformUtils.getComparableDataTypes(ft, the_type);
|
292 |
312 |
|
293 |
313 |
if (key2_Combo.addFeatureAttributes(ft, comparable_types) == 0) {
|
294 |
|
getDataTransformWizard().setApplicable(false);
|
295 |
|
|
|
314 |
|
296 |
315 |
String _msg =
|
297 |
316 |
Messages.getText("_No_compatible_field_in_second_table");
|
298 |
317 |
String _tit = Messages.getText("_Join");
|
... | ... | |
300 |
319 |
JOptionPane.showMessageDialog(
|
301 |
320 |
this, _msg, _tit,
|
302 |
321 |
JOptionPane.ERROR_MESSAGE);
|
|
322 |
getDataTransformWizard().setApplicable(false);
|
|
323 |
|
303 |
324 |
} else {
|
304 |
325 |
getDataTransformWizard().setApplicable(true);
|
305 |
326 |
// JOptionPane.showMessageDialog(this, "(2) OK !!");
|