Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 7097:c64c04d0796e generator-refactoring
Move manual point handling into a Processor
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 23 Sep 2013 12:21:08 +0200 |
parents | 5c059c05b100 |
children | 24f153ad1f40 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Mon Sep 23 12:20:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Mon Sep 23 12:21:08 2013 +0200 @@ -36,8 +36,6 @@ import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; -import org.json.JSONArray; -import org.json.JSONException; import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; import org.dive4elements.artifactdatabase.state.Facet; @@ -907,54 +905,6 @@ /** - * Do Points out. - */ - protected void doPoints( - Object o, - ArtifactAndFacet aandf, - ThemeDocument theme, - boolean visible, - int axisIndex - ) { - String seriesName = aandf.getFacetDescription(); - XYSeries series = new StyledXYSeries(seriesName, theme); - - // Add text annotations for single points. - List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); - - try { - JSONArray points = new JSONArray((String) o); - for (int i = 0, P = points.length(); i < P; i++) { - JSONArray array = points.getJSONArray(i); - double x = array.getDouble(0); - double y = array.getDouble(1); - String name = array.getString(2); - boolean act = array.getBoolean(3); - if (!act) { - continue; - } - //logger.debug(" x " + x + " y " + y ); - series.add(x, y, false); - xy.add(new CollisionFreeXYTextAnnotation(name, x, y)); - } - } - catch(JSONException e){ - logger.error("Could not decode json."); - } - - RiverAnnotation annotation = new RiverAnnotation(null, null, null, theme); - annotation.setTextAnnotations(xy); - - // Do not generate second legend entry. (null was passed for the aand before). - if (visible) { - annotations.add(annotation); - } -// doAnnotations(annotations, null, theme, visible); - addAxisSeries(series, axisIndex, visible); - } - - - /** * Create a hash from a legenditem. * This hash can then be used to merge legend items labels. * @return hash for given legenditem to identify mergeables.