58 |
58 |
import org.gvsig.fmap.dal.OpenDataStoreParameters;
|
59 |
59 |
import org.gvsig.tools.ToolsLocator;
|
60 |
60 |
import org.gvsig.tools.dispose.DisposeUtils;
|
61 |
|
import org.gvsig.tools.dynobject.DynObject;
|
62 |
61 |
import org.gvsig.tools.i18n.I18nManager;
|
63 |
62 |
import org.gvsig.tools.swing.api.ToolsSwingLocator;
|
64 |
63 |
import org.gvsig.tools.swing.icontheme.IconTheme;
|
... | ... | |
78 |
77 |
/**
|
79 |
78 |
*
|
80 |
79 |
*/
|
81 |
|
private static final long serialVersionUID = -3029020587709212310L;
|
|
80 |
private static final long serialVersionUID = 5431162883398861777L;
|
82 |
81 |
private static final String NAME = "DefaultGoogleMapsParametersPanelController";
|
83 |
82 |
private static final Logger logger = LoggerFactory.getLogger(DefaultWCSParametersPanelController.class);
|
84 |
83 |
private static final int TAB_CONNECTION_INDEX = 0;
|
... | ... | |
286 |
285 |
public void actionPerformed(ActionEvent e) {
|
287 |
286 |
updateLstCoverageSelector();
|
288 |
287 |
updateTxtCoverageName();
|
|
288 |
firePropertyChange("all", null, null);
|
289 |
289 |
}
|
290 |
290 |
});
|
291 |
291 |
|
... | ... | |
298 |
298 |
@Override
|
299 |
299 |
public void actionPerformed(ActionEvent e) {
|
300 |
300 |
cboInterpolationMethod.setEnabled(chkUseInterpolation.isSelected());
|
|
301 |
firePropertyChange("all", null, null);
|
301 |
302 |
}
|
302 |
303 |
});
|
303 |
304 |
|
... | ... | |
390 |
391 |
}
|
391 |
392 |
|
392 |
393 |
tabWCS.setEnabledAt(4, true);
|
|
394 |
firePropertyChange("all", null, null);
|
393 |
395 |
}
|
394 |
396 |
|
395 |
397 |
|
... | ... | |
472 |
474 |
|
473 |
475 |
}
|
474 |
476 |
|
|
477 |
@SuppressWarnings("unchecked")
|
475 |
478 |
private void fillConnections() {
|
476 |
479 |
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
|
477 |
480 |
|
... | ... | |
489 |
492 |
this.cboServerList.setModel(model);
|
490 |
493 |
}
|
491 |
494 |
|
|
495 |
@SuppressWarnings("unchecked")
|
492 |
496 |
private void fillFormats(List<String> formats) {
|
493 |
497 |
final DefaultListModel<String> model = new DefaultListModel<>();
|
494 |
498 |
if (formats != null) {
|
... | ... | |
501 |
505 |
@Override
|
502 |
506 |
public void valueChanged(ListSelectionEvent e) {
|
503 |
507 |
int index = lstFormats.getSelectedIndex();
|
504 |
|
format = model.getElementAt(index);
|
|
508 |
if(index>=0){
|
|
509 |
format = model.getElementAt(index);
|
|
510 |
firePropertyChange("all", null, null);
|
|
511 |
} else {
|
|
512 |
format = null;
|
|
513 |
}
|
505 |
514 |
}
|
506 |
515 |
});
|
507 |
516 |
}
|
... | ... | |
518 |
527 |
updateCboParameters();
|
519 |
528 |
}
|
520 |
529 |
this.updateTxtCoverageName();
|
|
530 |
firePropertyChange("all", null, null);
|
|
531 |
|
521 |
532 |
}
|
522 |
533 |
|
|
534 |
@SuppressWarnings("unchecked")
|
523 |
535 |
private void initializeCboInterpolationMethods() {
|
524 |
536 |
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
|
525 |
537 |
cboInterpolationMethod.setModel(model);
|
526 |
538 |
}
|
527 |
539 |
|
528 |
540 |
private void updateCboInterpolationMethods() {
|
|
541 |
@SuppressWarnings("unchecked")
|
529 |
542 |
DefaultComboBoxModel<String> model = (DefaultComboBoxModel<String>) cboInterpolationMethod.getModel();
|
530 |
543 |
model.removeAllElements();
|
531 |
544 |
List<String> methods = selectedCoverage.getInterpolationMethods();
|
... | ... | |
536 |
549 |
cboInterpolationMethod.setSelectedIndex(0);
|
537 |
550 |
}
|
538 |
551 |
|
|
552 |
@SuppressWarnings("unchecked")
|
539 |
553 |
private void initializeCboParameters() {
|
540 |
554 |
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
|
541 |
555 |
cboParameters.setModel(model);
|
... | ... | |
552 |
566 |
}
|
553 |
567 |
|
554 |
568 |
private void updateCboParameters() {
|
|
569 |
@SuppressWarnings("unchecked")
|
555 |
570 |
DefaultComboBoxModel<String> model = (DefaultComboBoxModel<String>) cboParameters.getModel();
|
556 |
571 |
|
557 |
572 |
Map<String, List<String>> wcsParameters = selectedCoverage.getWCSParameters();
|
... | ... | |
562 |
577 |
cboParameters.setSelectedIndex(0);
|
563 |
578 |
}
|
564 |
579 |
|
|
580 |
@SuppressWarnings("unchecked")
|
565 |
581 |
private void initializeLstValues() {
|
566 |
582 |
DefaultListModel<String> model = new DefaultListModel<>();
|
567 |
583 |
lstValues.setModel(model);
|
... | ... | |
570 |
586 |
|
571 |
587 |
private void updateLstValues(String selected) {
|
572 |
588 |
Map<String, List<String>> wcsParameters = selectedCoverage.getWCSParameters();
|
|
589 |
@SuppressWarnings("unchecked")
|
573 |
590 |
DefaultListModel<String> model = (DefaultListModel<String>) lstValues.getModel();
|
574 |
591 |
model.clear();
|
575 |
592 |
List<String> values = wcsParameters.get(selected);
|
576 |
|
for (Iterator iterator = values.iterator(); iterator.hasNext();) {
|
|
593 |
for (Iterator<String> iterator = values.iterator(); iterator.hasNext();) {
|
577 |
594 |
String value = (String) iterator.next();
|
578 |
595 |
model.addElement(value);
|
579 |
596 |
}
|
... | ... | |
629 |
646 |
}
|
630 |
647 |
});
|
631 |
648 |
|
632 |
|
final ListSelectionModel selectionModel = lstCoverageSelector.getSelectionModel();
|
633 |
|
|
634 |
649 |
lstCoverageSelector.setCellRenderer(new DefaultListCellRenderer() {
|
635 |
650 |
|
636 |
651 |
/**
|
... | ... | |
694 |
709 |
int selectedRow = lstProjections.getSelectedIndex();
|
695 |
710 |
if (selectedRow >= 0 && selectedRow < model.getSize()) {
|
696 |
711 |
projection = model.getElementAt(selectedRow);
|
|
712 |
firePropertyChange("all", null, null);
|
697 |
713 |
}
|
698 |
714 |
}
|
699 |
715 |
});
|
... | ... | |
701 |
717 |
lstProjections.setModel(model);
|
702 |
718 |
}
|
703 |
719 |
|
|
720 |
@SuppressWarnings("unchecked")
|
704 |
721 |
private void updateLstProjections() {
|
705 |
722 |
|
706 |
723 |
DefaultListModel<String> model = (DefaultListModel<String>) lstProjections.getModel();
|
... | ... | |
722 |
739 |
for (int i=0; i<model.size(); i++) {
|
723 |
740 |
if(projection.equals(model.elementAt(i))){
|
724 |
741 |
lstProjections.setSelectedIndex(i);
|
|
742 |
firePropertyChange("all", null, null);
|
725 |
743 |
return;
|
726 |
744 |
}
|
727 |
745 |
}
|
... | ... | |
734 |
752 |
IProjection crs=CRSFactory.getCRS(model.elementAt(i));
|
735 |
753 |
if(crs!=null && crs.equals(mapCtxProj)){
|
736 |
754 |
lstProjections.setSelectedIndex(i);
|
|
755 |
firePropertyChange("all", null, null);
|
737 |
756 |
return;
|
738 |
757 |
}
|
739 |
758 |
}catch(Exception e){
|
... | ... | |
744 |
763 |
if(lstProjections.getModel().getSize()>0){
|
745 |
764 |
lstProjections.setSelectedIndex(0);
|
746 |
765 |
}
|
|
766 |
firePropertyChange("all", null, null);
|
747 |
767 |
}
|
748 |
768 |
|
749 |
769 |
@Override
|
... | ... | |
781 |
801 |
public boolean refreshLocalCache() {
|
782 |
802 |
return chkRefreshLocalCache.isSelected();
|
783 |
803 |
}
|
|
804 |
|
|
805 |
@Override
|
|
806 |
public boolean areSettingsValid() {
|
|
807 |
return serverExplorer!=null && format!=null && projection!=null && selectedCoverage!=null && !lstValues.getSelectedValuesList().isEmpty();
|
|
808 |
}
|
784 |
809 |
}
|