Revision 12202 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/wizard/DefSistCoordenadas.java
DefSistCoordenadas.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.geotools.referencing.crs.DefaultProjectedCRS; |
34 | 34 |
import org.gvsig.crs.CrsException; |
35 |
import org.gvsig.crs.CrsFactory; |
|
35 | 36 |
import org.gvsig.crs.ICrs; |
36 | 37 |
import org.gvsig.crs.Proj4; |
38 |
import org.gvsig.crs.gui.dialog.ImportNewCrsDialog; |
|
37 | 39 |
import org.opengis.referencing.crs.CoordinateReferenceSystem; |
38 | 40 |
|
39 | 41 |
import com.iver.andami.PluginServices; |
... | ... | |
79 | 81 |
//final static String GEOGRAFICOPANEL = "Geografico"; |
80 | 82 |
private String sourceUnit = null; |
81 | 83 |
|
84 |
ICrs crs; |
|
82 | 85 |
Proj4 proj4 = null; |
83 | 86 |
private int pos; |
84 | 87 |
int divider=10000; |
... | ... | |
469 | 472 |
/*Se muestra el panel de Sistema de Coordenadas Geografico*/ |
470 | 473 |
//cl.show(cardPanel, GEOGRAFICOPANEL); |
471 | 474 |
deshabilitarControles(); |
472 |
} |
|
475 |
} else if (e.getSource().equals(getBtnImportar())) { |
|
476 |
System.out.println("Importar Proyeccion"); |
|
477 |
ImportNewCrsDialog newCrs = new ImportNewCrsDialog(PluginServices.getText(this, "projection")); |
|
478 |
PluginServices.getMDIManager().addWindow(newCrs); |
|
479 |
if (newCrs.getCode() != -1) { |
|
480 |
setCrs(newCrs.getCode()); |
|
481 |
fillData(getCrs()); |
|
482 |
} |
|
483 |
} |
|
473 | 484 |
} |
474 | 485 |
|
475 | 486 |
/* |
... | ... | |
917 | 928 |
getTxtNombreProy().setEnabled(false); |
918 | 929 |
getLblNombreProy().setEnabled(false); |
919 | 930 |
getLblProyeccion().setEnabled(false); |
920 |
getCbProyeccion().setEnabled(false); |
|
931 |
getCbProyeccion().setEnabled(false); |
|
932 |
getBtnImportar().setEnabled(false); |
|
921 | 933 |
} |
922 | 934 |
|
923 | 935 |
private void habilitarControles() { |
... | ... | |
927 | 939 |
getTxtNombreProy().setEnabled(true); |
928 | 940 |
getLblNombreProy().setEnabled(true); |
929 | 941 |
getLblProyeccion().setEnabled(true); |
930 |
getCbProyeccion().setEnabled(true); |
|
942 |
getCbProyeccion().setEnabled(true); |
|
943 |
getBtnImportar().setEnabled(true); |
|
931 | 944 |
} |
932 | 945 |
/** |
933 | 946 |
* Inicializa el boton que importa la proyeccion actual |
... | ... | |
936 | 949 |
public JButton getBtnImportar() { |
937 | 950 |
if(btnImportar==null){ |
938 | 951 |
btnImportar=new JButton("..."); |
952 |
btnImportar.addActionListener(this); |
|
953 |
|
|
939 | 954 |
} |
940 | 955 |
return btnImportar; |
941 | 956 |
} |
957 |
|
|
958 |
public void setCrs(int code) { |
|
959 |
try { |
|
960 |
crs = new CrsFactory().getCRS("EPSG:"+code); |
|
961 |
} catch (CrsException e) { |
|
962 |
// TODO Auto-generated catch block |
|
963 |
e.printStackTrace(); |
|
964 |
} |
|
965 |
|
|
966 |
} |
|
967 |
|
|
968 |
public ICrs getCrs() { |
|
969 |
return crs; |
|
970 |
} |
|
942 | 971 |
|
943 | 972 |
|
944 | 973 |
} |
Also available in: Unified diff