/** * Constructs the CRS panel specifying the underlying CRS explicitly. * <p> * When this constructor is used the {@link #getCRS()} method should be used * after the form is submitted to retrieve the final value of the CRS. * </p> * @param id The component id. * @param crs The underlying CRS object. */ public CRSPanel(String id, CoordinateReferenceSystem crs ) { //JD: while the CoordinateReferenceSystem interface does not implement Serializable // all the CRS objects we use do, hence the cast super(id, new Model((Serializable) crs)); initComponents(); setConvertedInput(crs); }
@Override public void convertInput() { String srs = srsTextField.getInput(); CoordinateReferenceSystem crs = null; if (srs != null && !"".equals(srs)) { if ("UNKNOWN".equals(srs)) { // leave underlying crs unchanged if (getModelObject() instanceof CoordinateReferenceSystem) { setConvertedInput(getModelObject()); } return; } crs = fromSRS(srs); } setConvertedInput(crs); }
@Override protected void convertInput() { String srs = srsTextField.getInput(); CoordinateReferenceSystem crs = null; if ( srs != null && !"".equals(srs)) { if ( "UNKNOWN".equals( srs ) ) { //leave underlying crs unchanged if ( getModelObject() instanceof CoordinateReferenceSystem ) { setConvertedInput(getModelObject()); } return; } crs = fromSRS( srs ); } setConvertedInput( crs ); }
/** * Constructs the CRS panel specifying the underlying CRS explicitly. * * <p>When this constructor is used the {@link #getCRS()} method should be used after the form * is submitted to retrieve the final value of the CRS. * * @param id The component id. * @param crs The underlying CRS object. */ public CRSPanel(String id, CoordinateReferenceSystem crs) { // JD: while the CoordinateReferenceSystem interface does not implement Serializable // all the CRS objects we use do, hence the cast super(id, new CRSModel(crs)); initComponents(); setConvertedInput(crs); }