@Test public void bufferTest() throws GeomajasException { GeometryBufferRequest request = new GeometryBufferRequest(); request.setGeometries(geometries); request.setBufferDistance(50); GeometryBufferResponse response = (GeometryBufferResponse) dispatcher.execute( GeometryBufferRequest.COMMAND, request, null, "en"); List<Geometry> buffered = response.getGeometries(); Assert.assertEquals(3, buffered.size()); Assert.assertTrue(buffered.get(0).getGeometries()[0].getCoordinates().length > 4); Assert.assertTrue(buffered.get(1).getGeometries()[0].getCoordinates().length > 2); Assert.assertTrue(buffered.get(2).getGeometries()[0].getCoordinates().length > 1); }
@Override public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception { List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries(); if (clientGeometries == null || clientGeometries.size() == 0) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request"); } List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>(); double buffer = request.getBufferDistance(); int quadrantSegments = request.getQuadrantSegments(); for (Geometry clientGeometry : clientGeometries) { result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments))); } response.setGeometries(result); }
GeometryBufferCommand implements CommandHasRequest<GeometryBufferRequest, GeometryBufferResponse> { @Override public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception { List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries(); if (clientGeometries == null || clientGeometries.size() == 0) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request"); } List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>(); double buffer = request.getBufferDistance(); int quadrantSegments = request.getQuadrantSegments(); for (Geometry clientGeometry : clientGeometries) { result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments))); } response.setGeometries(result); } }
GeometryBufferCommand implements CommandHasRequest<GeometryBufferRequest, GeometryBufferResponse> { @Override public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception { List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries(); if (clientGeometries == null || clientGeometries.size() == 0) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request"); } List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>(); double buffer = request.getBufferDistance(); int quadrantSegments = request.getQuadrantSegments(); for (Geometry clientGeometry : clientGeometries) { result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments))); } response.setGeometries(result); }  }
GeometryBufferCommand implements CommandHasRequest<GeometryBufferRequest, GeometryBufferResponse> { @Override public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception { List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries(); if (clientGeometries == null || clientGeometries.size() == 0) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request"); } List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>(); double buffer = request.getBufferDistance(); int quadrantSegments = request.getQuadrantSegments(); for (Geometry clientGeometry : clientGeometries) { result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments))); } response.setGeometries(result); }  @Override GeometryBufferRequest getEmptyCommandRequest(); @Override GeometryBufferResponse getEmptyCommandResponse(); @Override void execute(GeometryBufferRequest request, GeometryBufferResponse response); }
GeometryBufferCommand implements CommandHasRequest<GeometryBufferRequest, GeometryBufferResponse> { @Override public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception { List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries(); if (clientGeometries == null || clientGeometries.size() == 0) { throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request"); } List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>(); double buffer = request.getBufferDistance(); int quadrantSegments = request.getQuadrantSegments(); for (Geometry clientGeometry : clientGeometries) { result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments))); } response.setGeometries(result); }  @Override GeometryBufferRequest getEmptyCommandRequest(); @Override GeometryBufferResponse getEmptyCommandResponse(); @Override void execute(GeometryBufferRequest request, GeometryBufferResponse response);  }