public EnvelopePanel setReadOnly( final boolean readOnly ) { visitChildren( TextField.class, new org.apache.wicket.Component.IVisitor() { public Object component(Component component) { component.setEnabled( !readOnly ); return null; } }); crsPanel.setReadOnly(readOnly); return this; }
@Override protected void onModelChanged() { // when the client programmatically changed the model, update the fields // so that the textfields will change too updateFields(); visitChildren(TextField.class, new Component.IVisitor() { public Object component(Component component) { ((TextField) component).clearInput(); return CONTINUE_TRAVERSAL; } }); }
public EnvelopePanel setReadOnly(final boolean readOnly) { visitChildren( TextField.class, (component, visit) -> { component.setEnabled(!readOnly); }); crsPanel.setReadOnly(readOnly); return this; }
@SuppressWarnings("unchecked") @Override protected void onModelChanged() { // when the client programmatically changed the model, update the fields // so that the textfields will change too updateFields(); visitChildren( TextField.class, (component, visit) -> { ((TextField<String>) component).clearInput(); }); }
@Override protected void convertInput() { visitChildren( TextField.class, new org.apache.wicket.Component.IVisitor() { public Object component(Component component) { ((TextField) component).processInput(); return null; } }); if(isCRSFieldVisible()) { crsPanel.processInput(); } // update the envelope model if(minX != null && maxX != null && minY != null && maxY != null) { if(crsRequired && crs == null) { setConvertedInput(null); } else { setConvertedInput(new ReferencedEnvelope(minX, maxX, minY, maxY, crs)); } } else { setConvertedInput(null); } }
@SuppressWarnings("unchecked") @Override public void convertInput() { visitChildren( TextField.class, (component, visit) -> { ((TextField<String>) component).processInput(); }); if (isCRSFieldVisible()) { crsPanel.processInput(); } // update the envelope model if (minX != null && maxX != null && minY != null && maxY != null) { if (crsRequired && crs == null) { setConvertedInput(null); } else { if (is3D()) { double minZsafe = minZ == null ? Double.NaN : minZ; double maxZsafe = maxZ == null ? Double.NaN : maxZ; setConvertedInput( new ReferencedEnvelope3D( minX, maxX, minY, maxY, minZsafe, maxZsafe, crs)); } else { setConvertedInput(new ReferencedEnvelope(minX, maxX, minY, maxY, crs)); } } } else { setConvertedInput(null); } }