Revision 33275 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/legend/gui/General.java
General.java | ||
---|---|---|
53 | 53 |
import java.awt.event.ActionListener; |
54 | 54 |
import java.text.NumberFormat; |
55 | 55 |
import java.text.ParseException; |
56 |
import java.util.Iterator; |
|
57 | 56 |
|
58 | 57 |
import javax.swing.BorderFactory; |
59 | 58 |
import javax.swing.ButtonGroup; |
60 |
import javax.swing.DefaultComboBoxModel; |
|
61 | 59 |
import javax.swing.JCheckBox; |
62 |
import javax.swing.JComboBox; |
|
63 | 60 |
import javax.swing.JLabel; |
64 | 61 |
import javax.swing.JPanel; |
65 | 62 |
import javax.swing.JRadioButton; |
... | ... | |
74 | 71 |
import org.cresques.cts.IProjection; |
75 | 72 |
import org.gvsig.andami.PluginServices; |
76 | 73 |
import org.gvsig.andami.messages.NotificationManager; |
77 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
78 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
|
79 |
import org.gvsig.app.project.documents.view.legend.CreateSpatialIndexMonitorableTask; |
|
80 | 74 |
import org.gvsig.fmap.dal.DataStoreParameters; |
81 | 75 |
import org.gvsig.fmap.dal.exception.DataException; |
82 | 76 |
import org.gvsig.fmap.dal.exception.ReadException; |
83 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
84 | 77 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
85 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
86 | 78 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
87 | 79 |
import org.gvsig.fmap.geom.primitive.Envelope; |
88 | 80 |
import org.gvsig.fmap.geom.type.GeometryType; |
... | ... | |
94 | 86 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
95 | 87 |
import org.gvsig.gui.beans.swing.JBlank; |
96 | 88 |
import org.gvsig.tools.locator.LocatorException; |
97 |
import org.gvsig.utils.swing.threads.IMonitorableTask; |
|
98 | 89 |
|
99 | 90 |
|
100 | 91 |
|
... | ... | |
114 | 105 |
|
115 | 106 |
private static final long serialVersionUID = 1L; |
116 | 107 |
private FLayer layer; |
117 |
private ViewDocument view; |
|
118 | 108 |
private NumberFormat nf = NumberFormat.getInstance(); |
119 | 109 |
private JPanel pnlLayerName = null; |
120 | 110 |
private GridBagLayoutPanel pnlScale = null; |
... | ... | |
126 | 116 |
private JRadioButton rdBtnShowAlways = null; |
127 | 117 |
private JRadioButton rdBtnDoNotShow = null; |
128 | 118 |
private JTextField txtMinScale = null; |
129 |
private JComboBox cmbLinkField = null; |
|
130 |
private JTextField txtLinkExtension = null; |
|
131 |
private JComboBox cmbLinkType = null; |
|
132 | 119 |
private JCheckBox jCheckBoxSpatialIndex = null; |
133 |
private JPanel pnlHyperLink; |
|
134 |
private JLabel lblLinkExtension; |
|
135 |
private JLabel lblLinkField; |
|
136 |
private JLabel lblDefaultAction; |
|
137 |
private JPanel pnlFieldAndExtension; |
|
138 |
private JPanel pnlHyperLinkAction; |
|
120 |
|
|
121 |
// private ViewDocument view; |
|
122 |
// private JTextField txtLinkExtension = null; |
|
123 |
// private JComboBox cmbLinkField = null; |
|
124 |
// private JComboBox cmbLinkType = null; |
|
125 |
// private JPanel pnlHyperLink; |
|
126 |
// private JLabel lblLinkExtension; |
|
127 |
// private JLabel lblLinkField; |
|
128 |
// private JPanel pnlFieldAndExtension; |
|
129 |
// private JPanel pnlHyperLinkAction; |
|
130 |
// |
|
131 |
// private JLabel lblDefaultAction; |
|
139 | 132 |
private JScrollPane scrlProperties; |
140 | 133 |
|
141 | 134 |
/** |
... | ... | |
159 | 152 |
aux.addComponent("", getPnlScale()); |
160 | 153 |
JPanel aux2 = new JPanel(new GridLayout(1,2)); |
161 | 154 |
aux2.add(getPnlProperties()); |
162 |
aux2.add(getPnlHyperLink()); |
|
155 |
// aux2.add(getPnlHyperLink());
|
|
163 | 156 |
aux.addComponent(aux2); |
164 | 157 |
|
165 | 158 |
|
... | ... | |
182 | 175 |
this.layer = layer; |
183 | 176 |
|
184 | 177 |
if (layer instanceof FLyrVect) { |
185 |
FLyrVect lyrVect = (FLyrVect) layer; |
|
178 |
// FLyrVect lyrVect = (FLyrVect) layer;
|
|
186 | 179 |
|
187 | 180 |
|
188 | 181 |
//TODO |
... | ... | |
212 | 205 |
showLayerInfo(); |
213 | 206 |
|
214 | 207 |
|
215 |
if (PluginServices.getMainFrame() != null) { |
|
216 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof AbstractViewPanel ){ |
|
217 |
AbstractViewPanel theView = (AbstractViewPanel)PluginServices.getMDIManager().getActiveWindow(); |
|
218 |
view = theView.getModel(); |
|
219 |
try { |
|
220 |
if (layer instanceof FLyrVect) { |
|
221 |
FLyrVect ad = (FLyrVect) layer; |
|
222 |
FeatureStore fs; |
|
223 |
fs = ad.getFeatureStore(); |
|
224 |
FeatureType ftype = fs.getDefaultFeatureType(); |
|
225 |
String[] names = new String[ftype.size()]; |
|
226 |
Iterator iter = ftype.iterator(); |
|
227 |
int i=0; |
|
228 |
while (iter.hasNext()){ |
|
229 |
names[i] = ((FeatureAttributeDescriptor)iter.next()).getName(); |
|
230 |
i++; |
|
231 |
} |
|
232 |
DefaultComboBoxModel defaultModel = new DefaultComboBoxModel(names); |
|
233 |
cmbLinkField.setModel(defaultModel); |
|
208 |
// if (PluginServices.getMainFrame() != null) { |
|
209 |
// if (PluginServices.getMDIManager().getActiveWindow() instanceof AbstractViewPanel ){ |
|
210 |
// AbstractViewPanel theView = (AbstractViewPanel)PluginServices.getMDIManager().getActiveWindow(); |
|
211 |
// view = theView.getModel(); |
|
212 |
// try { |
|
213 |
// if (layer instanceof FLyrVect) { |
|
214 |
// FLyrVect ad = (FLyrVect) layer; |
|
215 |
// FeatureStore fs; |
|
216 |
// fs = ad.getFeatureStore(); |
|
217 |
// FeatureType ftype = fs.getDefaultFeatureType(); |
|
218 |
// String[] names = new String[ftype.size()]; |
|
219 |
// Iterator iter = ftype.iterator(); |
|
220 |
// int i=0; |
|
221 |
// while (iter.hasNext()){ |
|
222 |
// names[i] = ((FeatureAttributeDescriptor)iter.next()).getName(); |
|
223 |
// i++; |
|
224 |
// } |
|
225 |
// DefaultComboBoxModel defaultModel = new DefaultComboBoxModel(names); |
|
226 |
// cmbLinkField.setModel(defaultModel); |
|
227 |
// |
|
228 |
// if (layer.getLinkProperties().getField()!=null) { |
|
229 |
// cmbLinkField.setSelectedItem(layer.getLinkProperties().getField()); |
|
230 |
// } else { |
|
231 |
// cmbLinkField.setSelectedItem(view.getSelectedField()); |
|
232 |
// } |
|
233 |
// } else { |
|
234 |
// cmbLinkField = new JComboBox(); |
|
235 |
// } |
|
236 |
// } catch (DataException e) { |
|
237 |
// NotificationManager.addError("No se pudo obtener la tabla", e); |
|
238 |
// } |
|
239 |
// |
|
240 |
// |
|
241 |
// if(layer.getLinkProperties().getExt()!=null) { |
|
242 |
// getTxtLinkExtension().setText(layer.getLinkProperties().getExt()); |
|
243 |
// } |
|
244 |
// |
|
245 |
// getCmbLinkType().addItem(PluginServices.getText(this, |
|
246 |
// "Enlazar_a_ficheros_de_imagen")); |
|
247 |
// getCmbLinkType().addItem(PluginServices.getText(this, |
|
248 |
// "Enlazar_a_fichero_de_texto")); |
|
249 |
// |
|
250 |
// getCmbLinkType().addItem(PluginServices.getText(this, |
|
251 |
// "Enlazar_a_documento_PDF")); |
|
252 |
// getCmbLinkType().addItem(PluginServices.getText(this, |
|
253 |
// "Enlazar_a_imagen_SVG")); |
|
254 |
// |
|
255 |
// if (layer.getLinkProperties().getType()!=-1) { |
|
256 |
// getCmbLinkType().setSelectedIndex(layer.getLinkProperties().getType()); |
|
257 |
// } |
|
258 |
// |
|
259 |
// } |
|
260 |
// } |
|
234 | 261 |
|
235 |
if (layer.getLinkProperties().getField()!=null) { |
|
236 |
cmbLinkField.setSelectedItem(layer.getLinkProperties().getField()); |
|
237 |
} else { |
|
238 |
cmbLinkField.setSelectedItem(view.getSelectedField()); |
|
239 |
} |
|
240 |
} else { |
|
241 |
cmbLinkField = new JComboBox(); |
|
242 |
} |
|
243 |
} catch (DataException e) { |
|
244 |
NotificationManager.addError("No se pudo obtener la tabla", e); |
|
245 |
} |
|
246 |
|
|
247 |
|
|
248 |
if(layer.getLinkProperties().getExt()!=null) { |
|
249 |
getTxtLinkExtension().setText(layer.getLinkProperties().getExt()); |
|
250 |
} |
|
251 |
|
|
252 |
getCmbLinkType().addItem(PluginServices.getText(this, |
|
253 |
"Enlazar_a_ficheros_de_imagen")); |
|
254 |
getCmbLinkType().addItem(PluginServices.getText(this, |
|
255 |
"Enlazar_a_fichero_de_texto")); |
|
256 |
|
|
257 |
getCmbLinkType().addItem(PluginServices.getText(this, |
|
258 |
"Enlazar_a_documento_PDF")); |
|
259 |
getCmbLinkType().addItem(PluginServices.getText(this, |
|
260 |
"Enlazar_a_imagen_SVG")); |
|
261 |
|
|
262 |
if (layer.getLinkProperties().getType()!=-1) { |
|
263 |
getCmbLinkType().setSelectedIndex(layer.getLinkProperties().getType()); |
|
264 |
} |
|
265 |
|
|
266 |
} |
|
267 |
} |
|
268 |
|
|
269 | 262 |
} |
270 | 263 |
|
271 | 264 |
/** |
... | ... | |
457 | 450 |
private String getLayerName(){ |
458 | 451 |
return txtLayerName.getText().toString(); |
459 | 452 |
} |
453 |
// /** |
|
454 |
// * This method initializes jPanel3, this panel contains the components of the |
|
455 |
// * HyperLink |
|
456 |
// * |
|
457 |
// * @return javax.swing.JPanel |
|
458 |
// */ |
|
459 |
// private JPanel getPnlHyperLink() { |
|
460 |
// if (pnlHyperLink == null) { |
|
461 |
// pnlHyperLink = new JPanel(); |
|
462 |
// pnlHyperLink.setBorder(BorderFactory.createTitledBorder( |
|
463 |
// BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), |
|
464 |
// PluginServices.getText(this, "Hiperenlace"), |
|
465 |
// TitledBorder.DEFAULT_JUSTIFICATION, |
|
466 |
// TitledBorder.DEFAULT_POSITION, null, null) |
|
467 |
// ); |
|
468 |
// JPanel aux = new JPanel(new BorderLayout()); |
|
469 |
// pnlHyperLink.setLayout(new BorderLayout()); |
|
470 |
// aux.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
|
471 |
// aux.add(getPnlFieldAndExtension(), BorderLayout.NORTH); |
|
472 |
// aux.add(getPnlHyperLinkAction(), BorderLayout.CENTER); |
|
473 |
// pnlHyperLink.add(aux); |
|
474 |
// } |
|
475 |
// return pnlHyperLink; |
|
476 |
// } |
|
477 |
// |
|
478 |
// |
|
479 |
// private JPanel getPnlFieldAndExtension() { |
|
480 |
// if (pnlFieldAndExtension == null) { |
|
481 |
// lblLinkExtension = new JLabel(); |
|
482 |
// lblLinkExtension.setText(" \t \t"+PluginServices.getText(this,"extension")); |
|
483 |
// lblLinkField = new JLabel(); |
|
484 |
// lblLinkField.setText(PluginServices.getText(this, "Campo")); |
|
485 |
// pnlFieldAndExtension = new JPanel(); |
|
486 |
// pnlFieldAndExtension.add(lblLinkField, null); |
|
487 |
// pnlFieldAndExtension.add(getCmbLinkField(), null); |
|
488 |
// pnlFieldAndExtension.add(lblLinkExtension, null); |
|
489 |
// pnlFieldAndExtension.add(getTxtLinkExtension(), null); |
|
490 |
// } |
|
491 |
// return pnlFieldAndExtension; |
|
492 |
// } |
|
493 |
// /** |
|
494 |
// * This method initializes jPanel8. This panel contains the ComboBox to select |
|
495 |
// * the action, (type of HyperLink) |
|
496 |
// * |
|
497 |
// * @return javax.swing.JPanel |
|
498 |
// */ |
|
499 |
// private JPanel getPnlHyperLinkAction() { |
|
500 |
// if (pnlHyperLinkAction == null) { |
|
501 |
// lblDefaultAction = new JLabel(); |
|
502 |
// lblDefaultAction.setText(PluginServices.getText(this, "Accion_Predefinida") + " "); |
|
503 |
// pnlHyperLinkAction = new JPanel(); |
|
504 |
// pnlHyperLinkAction.add(lblDefaultAction, null); |
|
505 |
// pnlHyperLinkAction.add(getCmbLinkType(), null); |
|
506 |
// } |
|
507 |
// return pnlHyperLinkAction; |
|
508 |
// } |
|
509 |
// /** |
|
510 |
// * This method initializes jComboBox |
|
511 |
// * |
|
512 |
// * @return javax.swing.JComboBox |
|
513 |
// */ |
|
514 |
// private JComboBox getCmbLinkField() { |
|
515 |
// if (cmbLinkField == null) { |
|
516 |
// cmbLinkField = new JComboBox(); |
|
517 |
// } |
|
518 |
// return cmbLinkField; |
|
519 |
// } |
|
520 |
// /** |
|
521 |
// * This method initializes jTextField |
|
522 |
// * |
|
523 |
// * @return javax.swing.JTextField |
|
524 |
// */ |
|
525 |
// private JTextField getTxtLinkExtension() { |
|
526 |
// if (txtLinkExtension == null) { |
|
527 |
// txtLinkExtension = new JTextField(); |
|
528 |
// txtLinkExtension.setPreferredSize(new Dimension(40,20)); |
|
529 |
// } |
|
530 |
// return txtLinkExtension; |
|
531 |
// } |
|
532 |
// /** |
|
533 |
// * This method initializes jComboBox1 |
|
534 |
// * |
|
535 |
// * @return javax.swing.JComboBox |
|
536 |
// */ |
|
537 |
// private JComboBox getCmbLinkType() { |
|
538 |
// if (cmbLinkType == null) { |
|
539 |
// cmbLinkType = new JComboBox(); |
|
540 |
// } |
|
541 |
// return cmbLinkType; |
|
542 |
// } |
|
543 |
// |
|
544 |
// /** |
|
545 |
// * @return Returns the view. |
|
546 |
// */ |
|
547 |
// private ViewDocument getView() { |
|
548 |
// return view; |
|
549 |
// } |
|
460 | 550 |
/** |
461 |
* This method initializes jPanel3, this panel contains the components of the |
|
462 |
* HyperLink |
|
463 |
* |
|
464 |
* @return javax.swing.JPanel |
|
465 |
*/ |
|
466 |
private JPanel getPnlHyperLink() { |
|
467 |
if (pnlHyperLink == null) { |
|
468 |
pnlHyperLink = new JPanel(); |
|
469 |
pnlHyperLink.setBorder(BorderFactory.createTitledBorder( |
|
470 |
BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), |
|
471 |
PluginServices.getText(this, "Hiperenlace"), |
|
472 |
TitledBorder.DEFAULT_JUSTIFICATION, |
|
473 |
TitledBorder.DEFAULT_POSITION, null, null) |
|
474 |
); |
|
475 |
JPanel aux = new JPanel(new BorderLayout()); |
|
476 |
pnlHyperLink.setLayout(new BorderLayout()); |
|
477 |
aux.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
|
478 |
aux.add(getPnlFieldAndExtension(), BorderLayout.NORTH); |
|
479 |
aux.add(getPnlHyperLinkAction(), BorderLayout.CENTER); |
|
480 |
pnlHyperLink.add(aux); |
|
481 |
} |
|
482 |
return pnlHyperLink; |
|
483 |
} |
|
484 |
|
|
485 |
|
|
486 |
private JPanel getPnlFieldAndExtension() { |
|
487 |
if (pnlFieldAndExtension == null) { |
|
488 |
lblLinkExtension = new JLabel(); |
|
489 |
lblLinkExtension.setText(" \t \t"+PluginServices.getText(this,"extension")); |
|
490 |
lblLinkField = new JLabel(); |
|
491 |
lblLinkField.setText(PluginServices.getText(this, "Campo")); |
|
492 |
pnlFieldAndExtension = new JPanel(); |
|
493 |
pnlFieldAndExtension.add(lblLinkField, null); |
|
494 |
pnlFieldAndExtension.add(getCmbLinkField(), null); |
|
495 |
pnlFieldAndExtension.add(lblLinkExtension, null); |
|
496 |
pnlFieldAndExtension.add(getTxtLinkExtension(), null); |
|
497 |
} |
|
498 |
return pnlFieldAndExtension; |
|
499 |
} |
|
500 |
/** |
|
501 |
* This method initializes jPanel8. This panel contains the ComboBox to select |
|
502 |
* the action, (type of HyperLink) |
|
503 |
* |
|
504 |
* @return javax.swing.JPanel |
|
505 |
*/ |
|
506 |
private JPanel getPnlHyperLinkAction() { |
|
507 |
if (pnlHyperLinkAction == null) { |
|
508 |
lblDefaultAction = new JLabel(); |
|
509 |
lblDefaultAction.setText(PluginServices.getText(this, "Accion_Predefinida") + " "); |
|
510 |
pnlHyperLinkAction = new JPanel(); |
|
511 |
pnlHyperLinkAction.add(lblDefaultAction, null); |
|
512 |
pnlHyperLinkAction.add(getCmbLinkType(), null); |
|
513 |
} |
|
514 |
return pnlHyperLinkAction; |
|
515 |
} |
|
516 |
/** |
|
517 |
* This method initializes jComboBox |
|
518 |
* |
|
519 |
* @return javax.swing.JComboBox |
|
520 |
*/ |
|
521 |
private JComboBox getCmbLinkField() { |
|
522 |
if (cmbLinkField == null) { |
|
523 |
cmbLinkField = new JComboBox(); |
|
524 |
} |
|
525 |
return cmbLinkField; |
|
526 |
} |
|
527 |
/** |
|
528 |
* This method initializes jTextField |
|
529 |
* |
|
530 |
* @return javax.swing.JTextField |
|
531 |
*/ |
|
532 |
private JTextField getTxtLinkExtension() { |
|
533 |
if (txtLinkExtension == null) { |
|
534 |
txtLinkExtension = new JTextField(); |
|
535 |
txtLinkExtension.setPreferredSize(new Dimension(40,20)); |
|
536 |
} |
|
537 |
return txtLinkExtension; |
|
538 |
} |
|
539 |
/** |
|
540 |
* This method initializes jComboBox1 |
|
541 |
* |
|
542 |
* @return javax.swing.JComboBox |
|
543 |
*/ |
|
544 |
private JComboBox getCmbLinkType() { |
|
545 |
if (cmbLinkType == null) { |
|
546 |
cmbLinkType = new JComboBox(); |
|
547 |
} |
|
548 |
return cmbLinkType; |
|
549 |
} |
|
550 |
/** |
|
551 |
* @return Returns the view. |
|
552 |
*/ |
|
553 |
private ViewDocument getView() { |
|
554 |
return view; |
|
555 |
} |
|
556 |
/** |
|
557 | 551 |
* This method initializes jCheckBox |
558 | 552 |
* |
559 | 553 |
* @return javax.swing.JCheckBox |
... | ... | |
567 | 561 |
return jCheckBoxSpatialIndex; |
568 | 562 |
} |
569 | 563 |
|
570 |
/** |
|
571 |
* Returns the selected Type in the ComboBox |
|
572 |
*/ |
|
573 |
private int getLinkType() { |
|
574 |
return getCmbLinkType().getSelectedIndex(); |
|
564 |
// /** |
|
565 |
// * Returns the selected Type in the ComboBox |
|
566 |
// */ |
|
567 |
// private int getLinkType() { |
|
568 |
// return getCmbLinkType().getSelectedIndex(); |
|
569 |
// |
|
570 |
// } |
|
571 |
// |
|
572 |
// /** |
|
573 |
// * Returns the Selected Field in the ComboBox |
|
574 |
// */ |
|
575 |
// private String getSelectedLinkField() { |
|
576 |
// return (String) getCmbLinkField().getSelectedItem(); |
|
577 |
// } |
|
578 |
// |
|
579 |
// /** |
|
580 |
// * Returns the Extension in the TextField |
|
581 |
// */ |
|
582 |
// private String getExtensionLink() { |
|
583 |
// return getTxtLinkExtension().getText(); |
|
584 |
// } |
|
585 |
// |
|
586 |
// /** |
|
587 |
// * Returns true or false if the CheckBox is marked or not |
|
588 |
// */ |
|
589 |
// private boolean isSpatialIndexSelected() { |
|
590 |
// return getJCheckBoxSpatialIndex().isSelected(); |
|
591 |
// } |
|
575 | 592 |
|
576 |
} |
|
577 |
|
|
578 | 593 |
/** |
579 |
* Returns the Selected Field in the ComboBox |
|
580 |
*/ |
|
581 |
private String getSelectedLinkField() { |
|
582 |
return (String) getCmbLinkField().getSelectedItem(); |
|
583 |
} |
|
584 |
|
|
585 |
/** |
|
586 |
* Returns the Extension in the TextField |
|
587 |
*/ |
|
588 |
private String getExtensionLink() { |
|
589 |
return getTxtLinkExtension().getText(); |
|
590 |
} |
|
591 |
|
|
592 |
/** |
|
593 |
* Returns true or false if the CheckBox is marked or not |
|
594 |
*/ |
|
595 |
private boolean isSpatialIndexSelected() { |
|
596 |
return getJCheckBoxSpatialIndex().isSelected(); |
|
597 |
} |
|
598 |
|
|
599 |
/** |
|
600 | 594 |
* Add the information of the layer to the textArea |
601 | 595 |
*/ |
602 | 596 |
private void showLayerInfo() { |
... | ... | |
732 | 726 |
return getRdBtnDoNotShowWhen().isSelected(); |
733 | 727 |
} |
734 | 728 |
|
735 |
/** |
|
736 |
* Instanciates a ITask (@see com.iver.utiles.swing.threads.ITask) |
|
737 |
* to create a spatial index for the selected layer in background. |
|
738 |
* This task also allow to monitor process evolution, and to cancel |
|
739 |
* this process. |
|
740 |
*/ |
|
741 |
private IMonitorableTask getCreateSpatialIndexTask() throws DataException { |
|
742 |
// FIXME REVISAR ESTO (Quizas lanzar TaskException) |
|
743 |
return new CreateSpatialIndexMonitorableTask((FLyrVect)layer); |
|
744 |
} |
|
729 |
// /**
|
|
730 |
// * Instanciates a ITask (@see com.iver.utiles.swing.threads.ITask)
|
|
731 |
// * to create a spatial index for the selected layer in background.
|
|
732 |
// * This task also allow to monitor process evolution, and to cancel
|
|
733 |
// * this process.
|
|
734 |
// */
|
|
735 |
// private IMonitorableTask getCreateSpatialIndexTask() throws DataException {
|
|
736 |
// // FIXME REVISAR ESTO (Quizas lanzar TaskException)
|
|
737 |
// return new CreateSpatialIndexMonitorableTask((FLyrVect)layer);
|
|
738 |
// }
|
|
745 | 739 |
|
746 | 740 |
public void acceptAction() { |
747 |
// Implementaci?n para hacer funcionar el hyperlink ... |
|
748 |
//com.iver.cit.gvsig.gui.View theView = (com.iver.cit.gvsig.gui.View)PluginServices.getMDIManager().getActiveView(); |
|
749 |
//ProjectView view = theView.getModel(); |
|
750 |
if (PluginServices.getMainFrame() != null) |
|
751 |
{ |
|
752 |
ViewDocument view = getView(); |
|
753 |
view.setTypeLink(getLinkType()); |
|
754 |
if (getSelectedLinkField()!=null) |
|
755 |
{ |
|
756 |
view.setSelectedField(getSelectedLinkField().toString().trim()); |
|
757 |
view.setExtLink(getExtensionLink()); |
|
741 |
// // Implementaci?n para hacer funcionar el hyperlink ... |
|
742 |
// //com.iver.cit.gvsig.gui.View theView = (com.iver.cit.gvsig.gui.View)PluginServices.getMDIManager().getActiveView(); |
|
743 |
// //ProjectView view = theView.getModel(); |
|
744 |
// if (PluginServices.getMainFrame() != null) |
|
745 |
// { |
|
746 |
// ViewDocument view = getView(); |
|
747 |
// view.setTypeLink(getLinkType()); |
|
748 |
// if (getSelectedLinkField()!=null) |
|
749 |
// { |
|
750 |
// view.setSelectedField(getSelectedLinkField().toString().trim()); |
|
751 |
// view.setExtLink(getExtensionLink()); |
|
752 |
// |
|
753 |
// } |
|
754 |
// } |
|
758 | 755 |
|
759 |
} |
|
760 |
} |
|
761 | 756 |
|
762 |
|
|
763 | 757 |
} |
764 | 758 |
|
765 | 759 |
public void cancelAction() { |
... | ... | |
801 | 795 |
layer.setName(getLayerName()); |
802 | 796 |
} |
803 | 797 |
|
804 |
if (layer instanceof FLyrVect){ |
|
805 |
FLyrVect lyrVect = (FLyrVect) layer; |
|
806 |
if (isSpatialIndexSelected()) { |
|
807 |
// TODO |
|
808 |
|
|
798 |
// if (layer instanceof FLyrVect){
|
|
799 |
// FLyrVect lyrVect = (FLyrVect) layer;
|
|
800 |
// if (isSpatialIndexSelected()) {
|
|
801 |
// // TODO
|
|
802 |
// |
|
809 | 803 |
// if(lyrVect.getISpatialIndex() == null) { |
810 | 804 |
// //AZABALA |
811 | 805 |
// try { |
... | ... | |
816 | 810 |
// NotificationManager.addError(e.getMessage(), e); |
817 | 811 |
// } |
818 | 812 |
// } |
819 |
} |
|
820 |
//AZABALA |
|
821 |
/* |
|
822 |
* If we unselect the spatial index checkbox...Must we delete |
|
823 |
* spatial index file, or we only have to put Spatial Index |
|
824 |
* reference to null?. I have followed the second choice |
|
825 |
*/ |
|
826 |
else{ |
|
827 |
// lyrVect.deleteSpatialIndex(); |
|
828 |
} |
|
829 |
|
|
830 |
|
|
831 |
} |
|
832 |
//Codigo relacionado |
|
833 |
if (layer instanceof FLyrVect ){ |
|
834 |
FLyrVect vectlyr=(FLyrVect) layer; |
|
835 |
if (getSelectedLinkField()!=null){ |
|
836 |
vectlyr.getLinkProperties().setExt(getExtensionLink()); |
|
837 |
vectlyr.getLinkProperties().setField(getSelectedLinkField().toString().trim()); |
|
838 |
vectlyr.getLinkProperties().setType(getLinkType()); |
|
839 |
|
|
840 |
System.out.println("Link Properties"); |
|
841 |
System.out.println("Extensi?n: " + vectlyr.getLinkProperties().getExt()); |
|
842 |
System.out.println("Campo: " + vectlyr.getLinkProperties().getField()); |
|
843 |
System.out.println("Tipo: " + vectlyr.getLinkProperties().getType()); |
|
844 |
} |
|
845 |
} |
|
813 |
// }
|
|
814 |
// //AZABALA
|
|
815 |
// /*
|
|
816 |
// * If we unselect the spatial index checkbox...Must we delete
|
|
817 |
// * spatial index file, or we only have to put Spatial Index
|
|
818 |
// * reference to null?. I have followed the second choice
|
|
819 |
// */
|
|
820 |
// else{
|
|
821 |
//// lyrVect.deleteSpatialIndex();
|
|
822 |
// }
|
|
823 |
// |
|
824 |
// |
|
825 |
// }
|
|
826 |
// //Codigo relacionado
|
|
827 |
// if (layer instanceof FLyrVect ){
|
|
828 |
// FLyrVect vectlyr=(FLyrVect) layer;
|
|
829 |
// if (getSelectedLinkField()!=null){
|
|
830 |
// vectlyr.getLinkProperties().setExt(getExtensionLink());
|
|
831 |
// vectlyr.getLinkProperties().setField(getSelectedLinkField().toString().trim());
|
|
832 |
// vectlyr.getLinkProperties().setType(getLinkType());
|
|
833 |
// |
|
834 |
// System.out.println("Link Properties");
|
|
835 |
// System.out.println("Extensi?n: " + vectlyr.getLinkProperties().getExt());
|
|
836 |
// System.out.println("Campo: " + vectlyr.getLinkProperties().getField());
|
|
837 |
// System.out.println("Tipo: " + vectlyr.getLinkProperties().getType());
|
|
838 |
// }
|
|
839 |
// }
|
|
846 | 840 |
} |
847 | 841 |
|
848 | 842 |
/* |
Also available in: Unified diff