Revision 6872
trunk/libraries/libJCRS/src/org/gvsig/crs/ui/CRSSelectionPanel.java | ||
---|---|---|
433 | 433 |
else { |
434 | 434 |
selectedRowTable = lsm.getMinSelectionIndex(); |
435 | 435 |
|
436 |
setCodeCRS(Integer.parseInt((String)dtm.getValueAt(selectedRowTable,0))); |
|
436 |
setCodeCRS(Integer.parseInt((String)dtm.getValueAt(selectedRowTable,0))); |
|
437 |
setWKT(); |
|
437 | 438 |
} |
438 | 439 |
infoCrs.setEnabled(true); |
439 | 440 |
} |
... | ... | |
494 | 495 |
public ICrs getProjection() { |
495 | 496 |
return getCrs(); |
496 | 497 |
} |
497 |
public ICrs getCrs() { |
|
498 |
Epsg2wkt wkt; |
|
498 |
public ICrs getCrs() { |
|
499 |
try { |
|
500 |
String txt = getWKT(); |
|
501 |
ICrs crs = new CrsFactory().getCRS(epsg_code, txt); |
|
502 |
return crs ; |
|
503 |
} catch (CrsException e) { |
|
504 |
e.printStackTrace(); |
|
505 |
} |
|
506 |
return null; |
|
507 |
} |
|
508 |
|
|
509 |
public void setWKT(){ |
|
510 |
Epsg2wkt wkt = null; |
|
499 | 511 |
|
500 | 512 |
epsg_code = getCodeCRS(); |
501 | 513 |
if (epsg_code != -1){ |
... | ... | |
534 | 546 |
JOptionPane.showMessageDialog(this, |
535 | 547 |
"No CRS selected.", |
536 | 548 |
"Warning...", JOptionPane.WARNING_MESSAGE); |
537 |
return null; |
|
538 |
} |
|
539 |
try { |
|
540 |
String txt = wkt.getWKT(); |
|
541 |
setWKT(txt); |
|
542 |
ICrs crs = new CrsFactory().getCRS(epsg_code, txt); |
|
543 |
return crs ; |
|
544 |
} catch (CrsException e) { |
|
545 |
e.printStackTrace(); |
|
549 |
|
|
546 | 550 |
} |
547 |
return null;
|
|
551 |
cadWKT = wkt.getWKT();
|
|
548 | 552 |
} |
549 | 553 |
|
550 |
public void setWKT(String cad){ |
|
551 |
cadWKT = cad; |
|
552 |
} |
|
553 |
|
|
554 | 554 |
public String getWKT(){ |
555 | 555 |
return cadWKT; |
556 | 556 |
} |
Also available in: Unified diff