Revision 10626 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/dissolve/gui/GeoProcessingDissolvePanel.java
GeoProcessingDissolvePanel.java | ||
---|---|---|
64 | 64 |
import javax.swing.JPanel; |
65 | 65 |
import javax.swing.JScrollPane; |
66 | 66 |
|
67 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
67 | 68 |
import com.hardcode.gdbms.engine.data.DataSource; |
68 | 69 |
import com.iver.andami.PluginServices; |
69 | 70 |
import com.iver.andami.ui.mdiManager.IWindow; |
70 | 71 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
71 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
72 | 72 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
73 | 73 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
74 | 74 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
... | ... | |
85 | 85 |
|
86 | 86 |
/** |
87 | 87 |
* Panel to work with DissolveGeoprocess in Geoprocessing Wizard. |
88 |
*
|
|
88 |
* |
|
89 | 89 |
* Precondition: all inputs layer of constructor must be FLyrVect |
90 |
*
|
|
90 |
* |
|
91 | 91 |
* @author azabala |
92 |
*
|
|
92 |
* |
|
93 | 93 |
*/ |
94 | 94 |
public class GeoProcessingDissolvePanel extends AbstractGeoprocessPanel implements |
95 | 95 |
DissolvePanelIF, IWindow { |
... | ... | |
105 | 105 |
* be spatial adjacency |
106 | 106 |
*/ |
107 | 107 |
private JCheckBox onlySelectedItemsJCheckBox = null; |
108 |
|
|
109 |
|
|
108 |
|
|
109 |
|
|
110 | 110 |
private JLabel dissolveFieldJLabel = null; |
111 | 111 |
/** |
112 | 112 |
* Allows user to specify dissolve field |
... | ... | |
133 | 133 |
* Relates a numeric field with its sumarize functions |
134 | 134 |
*/ |
135 | 135 |
private Map nField_sumFuntionList = null; |
136 |
|
|
136 |
|
|
137 | 137 |
private WindowInfo viewInfo; |
138 | 138 |
|
139 | 139 |
private JPanel resultLayerPanel = null; |
... | ... | |
149 | 149 |
private JCheckBox adjacencyCheckbox = null; |
150 | 150 |
/** |
151 | 151 |
* This constructor initializes the set of layers |
152 |
*
|
|
152 |
* |
|
153 | 153 |
* TODO PRECONDITION: check for only FLyrVect layers |
154 |
*
|
|
155 |
*
|
|
154 |
* |
|
155 |
* |
|
156 | 156 |
*/ |
157 | 157 |
public GeoProcessingDissolvePanel(FLayers layers) { |
158 | 158 |
super(); |
... | ... | |
162 | 162 |
|
163 | 163 |
/** |
164 | 164 |
* This method initializes this |
165 |
*
|
|
165 |
* |
|
166 | 166 |
* @return void |
167 | 167 |
*/ |
168 | 168 |
private void initialize() { |
... | ... | |
208 | 208 |
for (int i = 0; i < ds.getFieldCount(); i++) { |
209 | 209 |
fieldNames[i] = ds.getFieldName(i); |
210 | 210 |
} |
211 |
} catch (DriverException e) { |
|
211 |
} catch (ReadDriverException e) {
|
|
212 | 212 |
e.printStackTrace(); |
213 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
214 |
e.printStackTrace(); |
|
215 | 213 |
} |
216 | 214 |
return fieldNames; |
217 | 215 |
} |
218 |
|
|
216 |
|
|
219 | 217 |
/** |
220 | 218 |
* Says if adjacency checkbox has been checked by |
221 | 219 |
* user |
... | ... | |
230 | 228 |
FBitSet fBitSet = null; |
231 | 229 |
try { |
232 | 230 |
fBitSet = inputSelectable.getRecordset().getSelection(); |
233 |
} catch (DriverException e) { |
|
231 |
} catch (ReadDriverException e) {
|
|
234 | 232 |
// TODO Auto-generated catch block |
235 | 233 |
e.printStackTrace(); |
236 | 234 |
} |
... | ... | |
244 | 242 |
|
245 | 243 |
/** |
246 | 244 |
* This method initializes inputCoverJComboBox |
247 |
*
|
|
245 |
* |
|
248 | 246 |
* @return javax.swing.JComboBox |
249 | 247 |
*/ |
250 | 248 |
private JComboBox getInputCoverJComboBox() { |
... | ... | |
266 | 264 |
|
267 | 265 |
/** |
268 | 266 |
* This method initializes onlySelectedItemsJCheckBox |
269 |
*
|
|
267 |
* |
|
270 | 268 |
* @return javax.swing.JCheckBox |
271 | 269 |
*/ |
272 | 270 |
private JCheckBox getOnlySelectedItemsJCheckBox() { |
... | ... | |
281 | 279 |
|
282 | 280 |
/** |
283 | 281 |
* This method initializes dissolveFieldJComboBox |
284 |
*
|
|
282 |
* |
|
285 | 283 |
* @return javax.swing.JComboBox |
286 | 284 |
*/ |
287 | 285 |
private JComboBox getDissolveFieldJComboBox() { |
... | ... | |
297 | 295 |
|
298 | 296 |
/** |
299 | 297 |
* This method initializes additionalOperationsJScrollPane |
300 |
*
|
|
298 |
* |
|
301 | 299 |
* @return javax.swing.JScrollPane |
302 | 300 |
*/ |
303 | 301 |
private JScrollPane getAdditionalOperationsJScrollPane() { |
... | ... | |
313 | 311 |
|
314 | 312 |
/** |
315 | 313 |
* This method initializes numericFieldJList |
316 |
*
|
|
314 |
* |
|
317 | 315 |
* @return javax.swing.JList |
318 | 316 |
*/ |
319 | 317 |
private JList getNumericFieldJList() { |
... | ... | |
323 | 321 |
return numericFieldJList; |
324 | 322 |
} |
325 | 323 |
|
326 |
|
|
324 |
|
|
327 | 325 |
/** |
328 | 326 |
* This method initializes outputCoverJButton |
329 |
*
|
|
327 |
* |
|
330 | 328 |
* @return javax.swing.JButton |
331 | 329 |
*/ |
332 | 330 |
private JButton getOutputCoverJButton() { |
... | ... | |
373 | 371 |
public String getDissolveFieldName() { |
374 | 372 |
return (String) dissolveFieldJComboBox.getSelectedItem(); |
375 | 373 |
} |
376 |
|
|
374 |
|
|
377 | 375 |
/** |
378 | 376 |
* Returns numeric fields' names of the selected input layer. |
379 | 377 |
* Needed to say user where he could apply sumarization functions. |
... | ... | |
382 | 380 |
String[] solution; |
383 | 381 |
FLyrVect layer = getInputLayer(); |
384 | 382 |
ArrayList list = new ArrayList(); |
385 |
|
|
383 |
|
|
386 | 384 |
try { |
387 | 385 |
SelectableDataSource recordset = layer.getRecordset(); |
388 | 386 |
int numFields = recordset.getFieldCount(); |
... | ... | |
391 | 389 |
list.add(recordset.getFieldName(i)); |
392 | 390 |
} |
393 | 391 |
}// for |
394 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
392 |
} catch (ReadDriverException e) {
|
|
395 | 393 |
return null; |
396 |
} catch (DriverException e) { |
|
397 |
return null; |
|
398 | 394 |
} |
399 | 395 |
solution = new String[list.size()]; |
400 | 396 |
list.toArray(solution); |
... | ... | |
404 | 400 |
|
405 | 401 |
/** |
406 | 402 |
* This method initializes sumarizationFunctionScrollPane |
407 |
*
|
|
403 |
* |
|
408 | 404 |
* @return javax.swing.JScrollPane |
409 | 405 |
*/ |
410 | 406 |
private JScrollPane getSumarizationFunctionScrollPane() { |
... | ... | |
421 | 417 |
/** |
422 | 418 |
* Returns a list with SumarizationFunctions for each numerical field of |
423 | 419 |
* field lists (in the same order). |
424 |
*
|
|
420 |
* |
|
425 | 421 |
* @return |
426 | 422 |
*/ |
427 | 423 |
private JList getSumarizeFunctionsJList() { |
... | ... | |
433 | 429 |
|
434 | 430 |
/** |
435 | 431 |
* This method initializes sumFunctionSelectionJButton |
436 |
*
|
|
432 |
* |
|
437 | 433 |
* @return javax.swing.JButton |
438 | 434 |
*/ |
439 | 435 |
private JButton getSumFunctionSelectionJButton() { |
... | ... | |
520 | 516 |
return (SummarizationFunction[]) nField_sumFuntionList |
521 | 517 |
.get(numericFieldName); |
522 | 518 |
} |
523 |
|
|
519 |
|
|
524 | 520 |
public WindowInfo getWindowInfo() { |
525 | 521 |
if (viewInfo == null) { |
526 | 522 |
viewInfo = new WindowInfo(WindowInfo.MODALDIALOG); |
... | ... | |
531 | 527 |
} |
532 | 528 |
|
533 | 529 |
/** |
534 |
* This method initializes resultLayerPanel
|
|
535 |
*
|
|
536 |
* @return javax.swing.JPanel
|
|
530 |
* This method initializes resultLayerPanel |
|
531 |
* |
|
532 |
* @return javax.swing.JPanel |
|
537 | 533 |
*/ |
538 | 534 |
private JPanel getResultLayerPanel() { |
539 | 535 |
if (resultLayerPanel == null) { |
... | ... | |
571 | 567 |
} |
572 | 568 |
|
573 | 569 |
/** |
574 |
* This method initializes sumarizeAttributesPanel
|
|
575 |
*
|
|
576 |
* @return javax.swing.JPanel
|
|
570 |
* This method initializes sumarizeAttributesPanel |
|
571 |
* |
|
572 |
* @return javax.swing.JPanel |
|
577 | 573 |
*/ |
578 | 574 |
private JPanel getSumarizeAttributesPanel() { |
579 | 575 |
if (sumarizeAttributesPanel == null) { |
... | ... | |
597 | 593 |
} |
598 | 594 |
|
599 | 595 |
/** |
600 |
* This method initializes adjacencyCheckbox
|
|
601 |
*
|
|
602 |
* @return javax.swing.JCheckBox
|
|
596 |
* This method initializes adjacencyCheckbox |
|
597 |
* |
|
598 |
* @return javax.swing.JCheckBox |
|
603 | 599 |
*/ |
604 | 600 |
private JCheckBox getAdjacencyCheckbox() { |
605 | 601 |
if (adjacencyCheckbox == null) { |
Also available in: Unified diff