@Override protected void onUpdate(AjaxRequestTarget target) { convertInput(); CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getConvertedInput(); if(crs != null) { setModelObject(crs); wktLabel.setDefaultModelObject(crs.getName().toString()); wktLink.setEnabled(true); } else { wktLabel.setDefaultModelObject(null); wktLink.setEnabled(false); } target.addComponent(wktLink); onSRSUpdated(toSRS(crs), target); } });
@Override protected void onUpdate(AjaxRequestTarget target) { convertInput(); CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getConvertedInput(); if (crs != null) { setModelObject(crs); wktLabel.setDefaultModelObject(crs.getName().toString()); wktLink.setEnabled(true); } else { wktLabel.setDefaultModelObject(null); wktLink.setEnabled(false); } target.add(wktLink); onSRSUpdated(toSRS(crs), target); } });
@Override protected void onCodeClicked(AjaxRequestTarget target, String epsgCode) { popupWindow.close(target); String srs = "EPSG:" + epsgCode; srsTextField.setModelObject(srs); target.add(srsTextField); CoordinateReferenceSystem crs = fromSRS(srs); CRSPanel.this.setModelObject(crs); if (crs != null) { wktLabel.setDefaultModelObject(crs.getName().toString()); wktLink.setEnabled(true); } else { wktLabel.setDefaultModelObject(null); wktLink.setEnabled(false); } target.add(wktLink); onSRSUpdated(srs, target); } };
public PGRasterPanel(final String id, final IModel paramsModel, final Form storeEditForm) { super(id); server = addTextPanel(paramsModel, "server", true); port = addTextPanel(paramsModel, "port", true); SRSToCRSModel srsModel = new SRSToCRSModel(new PropertyModel(paramsModel, "ESPG:4326")); epsgcode = new CRSPanel("epsgcode", srsModel); epsgcode.setModelObject(DEFAULT_CRS); add(epsgcode); user = addTextPanel(paramsModel, "user", "Postgis user", true); password = addPasswordPanel(paramsModel, "password"); database = addTextPanel(paramsModel, "database", "Postgis Database", true); table = addTextPanel(paramsModel, "table", true); schema = addTextPanel(paramsModel, "schema", true); schema.setModelValue(new String[] {"public"}); fileext = addTextPanel(paramsModel, "fileext", "tiles file extension filter", false); importopt = addTextPanel(paramsModel, "importopt", "raster2pgsql script import options", false); server.setOutputMarkupId(true); port.setOutputMarkupId(true); user.setOutputMarkupId(true); password.setOutputMarkupId(true); database.setOutputMarkupId(true); table.setOutputMarkupId(true); schema.setOutputMarkupId(true); fileext.setOutputMarkupId(true); importopt.setOutputMarkupId(true); }