use of org.opengis.referencing.crs.SingleCRS in project hale by halestudio.
the class SelectCRSDialog method updateMessage.
/**
* Update the dialog message
*/
private void updateMessage() {
if (radioCRS.getSelection()) {
if (wktWarning != null) {
wktWarning.setVisible(false);
}
updateMessage(crsField);
} else {
if (wktField.isValid()) {
setErrorMessage(null);
CoordinateReferenceSystem wktCrs = wktField.getCRSDefinition().getCRS();
boolean bursaWolfApplicable = false;
boolean bursaWolfAvailable = false;
if (wktCrs instanceof SingleCRS && ((SingleCRS) wktCrs).getDatum() instanceof DefaultGeodeticDatum) {
// Check for Bursa-Wolf parameters
bursaWolfApplicable = true;
DefaultGeodeticDatum datum = (DefaultGeodeticDatum) ((SingleCRS) wktCrs).getDatum();
bursaWolfAvailable = datum.getBursaWolfParameters().length > 0;
}
boolean showWktWarning = bursaWolfApplicable && !bursaWolfAvailable;
setMessage(wktField.getCRSDefinition().getCRS().getName().toString(), showWktWarning ? IMessageProvider.WARNING : IMessageProvider.INFORMATION);
if (wktWarning != null) {
wktWarning.setVisible(showWktWarning);
}
} else {
setErrorMessage(wktField.getErrorMessage());
setMessage(DEF_MESSAGE, IMessageProvider.INFORMATION);
wktWarning.setVisible(false);
}
}
}
Aggregations