protected void updateTransformation(AjaxRequestTarget ajaxTarget) { if (sourceCRS != null && targetCRS != null) { MathTransform mt = getTransform(); if (mt != null) { wktLink.setEnabled(true); ajaxTarget.add(wktLink); } } }
Component editAttributeLink(final IModel<AttributeDescription> itemModel) { GeoServerAjaxFormLink link = new GeoServerAjaxFormLink("link") { @Override protected void onClick(AjaxRequestTarget target, Form<?> form) { AttributeDescription attribute = itemModel.getObject(); setResponsePage(new AttributeEditPage(attribute, NewFeatureTypePage.this)); } }; link.add(new Label("name", new PropertyModel<String>(itemModel, "name"))); return link; }
wktLink.setEnabled(getModelObject() != null); add(wktLink); wktLink.add(wktLabel); wktLabel.setOutputMarkupId(true);
describeLink.setEnabled(false); describeLink.setOutputMarkupId(true); add(describeLink);
@Override protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) { super.onAfterSubmit(target, form); try { CoordinateReferenceSystem crs = envelopePanel.getCoordinateReferenceSystem(); if (crs == null) return; ReferencedEnvelope refEnv = new ReferencedEnvelope(CRS.getEnvelope(crs)); envelopePanel.setModelObject(refEnv); envelopePanel.modelChanged(); target.add(envelopePanel); } catch (Exception e) { throw new WicketRuntimeException(e); } }
wktLink.setEnabled(getModelObject() != null); add(wktLink); wktLink.add( wktLabel ); wktLabel.setOutputMarkupId( true );
describeLink.setEnabled(false); describeLink.setOutputMarkupId(true); add(describeLink);
@Override protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) { super.onAfterSubmit(target, form); if (CollectionUtils.isEmpty(getSelectedLayers())) return; GeoServerApplication gsa = (GeoServerApplication) getApplication(); LayerGroupInfo lg = gsa.getCatalog().getFactory().createLayerGroup(); getSelectedLayers() .forEach( l -> { lg.getLayers().add(gsa.getCatalog().getLayerByName(l)); }); try { CoordinateReferenceSystem crs = envelopePanel.getCoordinateReferenceSystem(); // CRS.decode(envelopePanel.getCoordinateReferenceSystem()); if (crs != null) { new CatalogBuilder(gsa.getCatalog()) .calculateLayerGroupBounds(lg, crs); } else { // calculate from scratch new CatalogBuilder(gsa.getCatalog()).calculateLayerGroupBounds(lg); } ReferencedEnvelope renv = lg.getBounds(); envelopePanel.setModelObject(renv); } catch (Exception e) { throw new WicketRuntimeException(e); } target.add(mainDiv); }
@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); } });
Component editAttributeLink(final IModel itemModel) { GeoServerAjaxFormLink link = new GeoServerAjaxFormLink("link") { @Override protected void onClick(AjaxRequestTarget target, Form form) { AttributeDescription attribute = (AttributeDescription) itemModel.getObject(); setResponsePage(new AttributeEditPage(attribute, NewFeatureTypePage.this)); } }; link.add(new Label("name", new PropertyModel(itemModel, "name"))); return link; }
@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); } });
addLink.add(new Icon("addIcon", ADD_ICON)); container.add(addLink);
@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 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); } };
@Override protected void onCodeClicked(AjaxRequestTarget target, String epsgCode) { popupWindow.close(target); String srs = "EPSG:" + epsgCode ; srsTextField.setModelObject( srs ); target.addComponent( srsTextField ); CoordinateReferenceSystem crs = fromSRS( srs ); wktLabel.setDefaultModelObject( crs.getName().toString() ); wktLink.setEnabled(true); target.addComponent( wktLink ); onSRSUpdated(srs, target); } };
@Override protected void onSubmit(AjaxRequestTarget target) { details.setVisible(true); String coverageName = coverage.getModelObject(); Catalog catalog = GeoServerApplication.get().getCatalog(); CoverageInfo ci = catalog.getCoverageByName(coverageName); ReferencedEnvelope ri = ci.getNativeBoundingBox(); final GetCoverageRequest gc = WCSRequestBuilderPanel.this.getCoverage; gc.bounds = ri; gc.targetCRS = ri.getCoordinateReferenceSystem(); gc.sourceGridRange = null; describeLink.setEnabled(true); target.add(WCSRequestBuilderPanel.this); } });