/** * Returns the underlying CRS for the panel. * * <p>This method is convenience for: * * <pre> * (CoordinateReferenceSystem) this.getModelObject(); * </pre> */ public CoordinateReferenceSystem getCRS() { // convertInput(); return getModelObject(); }
@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 ); }
@Override protected void onBeforeRender() { CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getModelObject(); if (crs != null) { srsTextField.setModelObject(toSRS(crs)); wktLabel.setDefaultModelObject(crs.getName().toString()); } else { wktLabel.setDefaultModelObject(null); wktLink.setEnabled(false); } super.onBeforeRender(); }
@Override protected void onBeforeRender() { CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getModelObject(); if ( crs != null ) { srsTextField.setModelObject( toSRS(crs) ); wktLabel.setDefaultModelObject( crs.getName().toString() ); } else { wktLabel.setDefaultModelObject(null); wktLink.setEnabled(false); } super.onBeforeRender(); }
@Override public void onClick(AjaxRequestTarget target, Form form) { popupWindow.setInitialHeight( 375 ); popupWindow.setInitialWidth( 525 ); popupWindow.setContent(new WKTPanel( popupWindow.getContentId(), getCRS())); CoordinateReferenceSystem crs = (CoordinateReferenceSystem) CRSPanel.this.getModelObject(); if(crs != null) popupWindow.setTitle(crs.getName().toString()); popupWindow.show(target); } };
@Override public void onClick(AjaxRequestTarget target, Form<?> form) { popupWindow.setInitialHeight(375); popupWindow.setInitialWidth(525); popupWindow.setContent(new WKTPanel(popupWindow.getContentId(), getCRS())); CoordinateReferenceSystem crs = (CoordinateReferenceSystem) CRSPanel.this.getModelObject(); if (crs != null) popupWindow.setTitle(crs.getName().toString()); popupWindow.show(target); } };
wktLink.setEnabled(getModelObject() != null); add(wktLink);
wktLink.setEnabled(getModelObject() != null); add(wktLink);