Revision 10626 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/impl/buffer/gui/GeoProcessingBufferPanel.java
GeoProcessingBufferPanel.java | ||
---|---|---|
56 | 56 |
import javax.swing.JFileChooser; |
57 | 57 |
import javax.swing.JFormattedTextField; |
58 | 58 |
import javax.swing.JLabel; |
59 |
import javax.swing.JPanel; |
|
59 | 60 |
import javax.swing.JRadioButton; |
60 | 61 |
import javax.swing.JSpinner; |
61 | 62 |
import javax.swing.JTextField; |
62 | 63 |
import javax.swing.SpinnerListModel; |
63 | 64 |
|
65 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
64 | 66 |
import com.hardcode.gdbms.engine.data.DataSource; |
65 | 67 |
import com.iver.andami.PluginServices; |
66 | 68 |
import com.iver.andami.ui.mdiManager.IWindow; |
67 | 69 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
68 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
69 | 70 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
70 | 71 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
71 | 72 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
... | ... | |
75 | 76 |
import com.iver.cit.gvsig.geoprocess.core.fmap.XTypes; |
76 | 77 |
import com.iver.cit.gvsig.geoprocess.core.gui.AbstractGeoprocessPanel; |
77 | 78 |
import com.iver.utiles.GenericFileFilter; |
78 |
import javax.swing.JPanel; |
|
79 | 79 |
|
80 | 80 |
/** |
81 | 81 |
* Component that represents a Step of the GeoProcessingPanel Wizard. It allows |
82 | 82 |
* user to make selections to do buffers geoprocesses. |
83 |
*
|
|
83 |
* |
|
84 | 84 |
* @author jmorell, azabala |
85 |
*
|
|
85 |
* |
|
86 | 86 |
* TODO copiar del ClipPanel el que se muestre el numero de elementos |
87 | 87 |
* seleccionados en la capa |
88 | 88 |
*/ |
... | ... | |
155 | 155 |
|
156 | 156 |
/** |
157 | 157 |
* This method initializes this |
158 |
*
|
|
158 |
* |
|
159 | 159 |
* @return void |
160 | 160 |
*/ |
161 | 161 |
private void initialize() { |
... | ... | |
196 | 196 |
for (int i = 0; i < ds.getFieldCount(); i++) { |
197 | 197 |
fieldNames[i] = ds.getFieldName(i); |
198 | 198 |
} |
199 |
} catch (DriverException e) { |
|
199 |
} catch (ReadDriverException e) {
|
|
200 | 200 |
// TODO Auto-generated catch block |
201 | 201 |
e.printStackTrace(); |
202 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
203 |
// TODO Auto-generated catch block |
|
204 |
e.printStackTrace(); |
|
205 | 202 |
} |
206 | 203 |
return fieldNames; |
207 | 204 |
} |
... | ... | |
212 | 209 |
FBitSet fBitSet = null; |
213 | 210 |
try { |
214 | 211 |
fBitSet = inputLayer.getRecordset().getSelection(); |
215 |
} catch (DriverException e) { |
|
212 |
} catch (ReadDriverException e) {
|
|
216 | 213 |
// TODO Auto-generated catch block |
217 | 214 |
e.printStackTrace(); |
218 | 215 |
} |
... | ... | |
236 | 233 |
|
237 | 234 |
/** |
238 | 235 |
* This method initializes layersComboBox |
239 |
*
|
|
236 |
* |
|
240 | 237 |
* @return javax.swing.JComboBox |
241 | 238 |
*/ |
242 | 239 |
private JComboBox getLayersComboBox() { |
... | ... | |
263 | 260 |
} |
264 | 261 |
return layersComboBox; |
265 | 262 |
} |
266 |
|
|
267 |
|
|
263 |
|
|
264 |
|
|
268 | 265 |
private void verifyTypeBufferComboEnabled(){ |
269 | 266 |
String layerName = (String) layersComboBox.getSelectedItem(); |
270 | 267 |
FLyrVect layer = (FLyrVect) layers.getLayer(layerName); |
271 | 268 |
boolean enable = false; |
272 | 269 |
try { |
273 | 270 |
enable = layer.getShapeType() == XTypes.POLYGON; |
274 |
} catch (DriverException e1) { |
|
275 |
e1.printStackTrace(); |
|
271 |
} catch (ReadDriverException e) { |
|
272 |
// TODO Auto-generated catch block |
|
273 |
e.printStackTrace(); |
|
276 | 274 |
} |
277 | 275 |
enableTypePolygonBufferPanel(enable); |
278 | 276 |
} |
279 |
|
|
280 | 277 |
|
278 |
|
|
281 | 279 |
/** |
282 | 280 |
* This method initializes fileNameResultTextField |
283 |
*
|
|
281 |
* |
|
284 | 282 |
* @return javax.swing.JTextField |
285 | 283 |
*/ |
286 | 284 |
public JTextField getFileNameResultTextField() { |
... | ... | |
294 | 292 |
|
295 | 293 |
/** |
296 | 294 |
* This method initializes openFileButton |
297 |
*
|
|
295 |
* |
|
298 | 296 |
* @return javax.swing.JButton |
299 | 297 |
*/ |
300 | 298 |
private JButton getOpenFileButton() { |
... | ... | |
322 | 320 |
|
323 | 321 |
/** |
324 | 322 |
* This method initializes distanceBufferRadioButton |
325 |
*
|
|
323 |
* |
|
326 | 324 |
* @return javax.swing.JRadioButton |
327 | 325 |
*/ |
328 | 326 |
private JRadioButton getDistanceBufferRadioButton() { |
... | ... | |
345 | 343 |
|
346 | 344 |
/** |
347 | 345 |
* This method initializes bufferDistanceTextField |
348 |
*
|
|
346 |
* |
|
349 | 347 |
* @return javax.swing.JTextField |
350 | 348 |
*/ |
351 | 349 |
private JTextField getBufferDistanceTextField() { |
... | ... | |
359 | 357 |
|
360 | 358 |
/** |
361 | 359 |
* This method initializes attributeBufferRadioButton |
362 |
*
|
|
360 |
* |
|
363 | 361 |
* @return javax.swing.JRadioButton |
364 | 362 |
*/ |
365 | 363 |
private JRadioButton getAttributeBufferRadioButton() { |
... | ... | |
382 | 380 |
|
383 | 381 |
/** |
384 | 382 |
* This method initializes layerFieldsComboBox |
385 |
*
|
|
383 |
* |
|
386 | 384 |
* @return javax.swing.JComboBox |
387 | 385 |
*/ |
388 | 386 |
private JComboBox getLayerFieldsComboBox() { |
... | ... | |
470 | 468 |
throw new GeoprocessException( |
471 | 469 |
"Atributo no numerico para distancia de buffer"); |
472 | 470 |
|
473 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
471 |
} catch (ReadDriverException e) {
|
|
474 | 472 |
throw new GeoprocessException( |
475 |
"Problemas accediendo al campo que define la distancia de buffer"); |
|
476 |
} catch (DriverException e) { |
|
477 |
throw new GeoprocessException( |
|
478 |
"Problemas accediendo al campo que define la distancia de buffer"); |
|
473 |
"Problemas accediendo al campo que define la distancia de buffer"); |
|
479 | 474 |
} |
480 | 475 |
return attributeField; |
481 | 476 |
} |
... | ... | |
499 | 494 |
|
500 | 495 |
/** |
501 | 496 |
* This method initializes methodSelectionPanel |
502 |
*
|
|
497 |
* |
|
503 | 498 |
* @return javax.swing.JPanel |
504 | 499 |
*/ |
505 | 500 |
private JPanel getMethodSelectionPanel() { |
... | ... | |
523 | 518 |
|
524 | 519 |
/** |
525 | 520 |
* This method initializes resultSelectionPanel |
526 |
*
|
|
521 |
* |
|
527 | 522 |
* @return javax.swing.JPanel |
528 | 523 |
*/ |
529 | 524 |
private JPanel getResultSelectionPanel() { |
... | ... | |
552 | 547 |
|
553 | 548 |
/** |
554 | 549 |
* This method initializes endCapCheckBox |
555 |
*
|
|
550 |
* |
|
556 | 551 |
* @return javax.swing.JCheckBox |
557 | 552 |
*/ |
558 | 553 |
private JCheckBox getEndCapCheckBox() { |
... | ... | |
567 | 562 |
|
568 | 563 |
/** |
569 | 564 |
* This method initializes extendedOptionsPanel |
570 |
*
|
|
565 |
* |
|
571 | 566 |
* @return javax.swing.JPanel |
572 | 567 |
*/ |
573 | 568 |
private JPanel getExtendedOptionsPanel() { |
... | ... | |
587 | 582 |
|
588 | 583 |
/** |
589 | 584 |
* This method initializes typePolygonBufferPanel |
590 |
*
|
|
585 |
* |
|
591 | 586 |
* @return javax.swing.JPanel |
592 | 587 |
*/ |
593 | 588 |
private JPanel getTypePolygonBufferPanel() { |
... | ... | |
608 | 603 |
|
609 | 604 |
/** |
610 | 605 |
* This method initializes typeBufferComboBox |
611 |
*
|
|
606 |
* |
|
612 | 607 |
* @return javax.swing.JComboBox |
613 | 608 |
*/ |
614 | 609 |
private JComboBox getTypeBufferComboBox() { |
... | ... | |
627 | 622 |
/** |
628 | 623 |
* Returns the type of polygon byffer (inside, outside, inside and outside) |
629 | 624 |
* selected by user |
630 |
*
|
|
625 |
* |
|
631 | 626 |
* @return |
632 | 627 |
*/ |
633 | 628 |
public String getTypePolygonBuffer() { |
... | ... | |
638 | 633 |
* Allow to enable/disable typePolygonBufferPanel (and all its components). |
639 | 634 |
* The reason is that this customizations are only possible with polygon |
640 | 635 |
* layers. |
641 |
*
|
|
636 |
* |
|
642 | 637 |
* @param enable |
643 | 638 |
*/ |
644 | 639 |
public void enableTypePolygonBufferPanel(boolean enable) { |
... | ... | |
648 | 643 |
|
649 | 644 |
/** |
650 | 645 |
* This method initializes numBuffersPanel |
651 |
*
|
|
646 |
* |
|
652 | 647 |
* @return javax.swing.JPanel |
653 | 648 |
*/ |
654 | 649 |
private JPanel getNumBuffersPanel() { |
... | ... | |
668 | 663 |
|
669 | 664 |
/** |
670 | 665 |
* This method initializes radialBufferTextField |
671 |
*
|
|
666 |
* |
|
672 | 667 |
* @return javax.swing.JTextField |
673 | 668 |
*/ |
674 | 669 |
private JSpinner getRadialBufferSpinner() { |
... | ... | |
694 | 689 |
/** |
695 | 690 |
* Returns the number of radial buffers selected by user (by now, only a |
696 | 691 |
* maximum of three radial buffers allowed) |
697 |
*
|
|
692 |
* |
|
698 | 693 |
* @return |
699 | 694 |
*/ |
700 | 695 |
public int getNumberOfRadialBuffers() { |
Also available in: Unified diff