Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | bbf6cf555e89 |
children | e5f688820951 0a5239a1e46e |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Thu Jan 18 20:10:59 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Thu Jan 18 20:12:01 2018 +0100 @@ -291,10 +291,12 @@ */ java.net.URL imageURL; if (logo.equals("Intevation")) { - imageURL = DiagramGenerator.class.getResource("/images/intevation.png"); + imageURL = DiagramGenerator.class.getResource( + "/images/intevation.png"); } else { // TODO else if ... - imageURL = DiagramGenerator.class.getResource("/images/bfg_logo.gif"); + imageURL = DiagramGenerator.class.getResource( + "/images/bfg_logo.gif"); } imageIcon = new ImageIcon(imageURL); @@ -314,7 +316,8 @@ yPos = (Double)getYBounds(0).getLower(); } else if (placev.equals("center")) { - yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d; + yPos = ((Double)getYBounds(0).getUpper() + + (Double)getYBounds(0).getLower())/2d; } else { log.debug("Unknown place-v value: " + placev); @@ -330,7 +333,8 @@ xPos = getRightX(); } else if (placeh.equals("center")) { - xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; + xPos = ((Double)getXBounds(0).getUpper() + + (Double)getXBounds(0).getLower())/2d; } else { log.debug("Unknown place-h value: " + placeh); @@ -376,7 +380,8 @@ XYAnnotation xyannotation = new XYImageAnnotation(xPos, yPos, imageIcon.getImage(), anchor); - plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + xyannotation, org.jfree.ui.Layer.BACKGROUND); } @@ -456,9 +461,14 @@ * Registers an area to be drawn. * @param area Area to be drawn. * @param axisName Name of the axis. - * @param visible Whether or not to be visible (important for range calculations). + * @param visible Whether or not to be visible + * (important for range calculations). */ - public void addAreaSeries(StyledAreaSeriesCollection area, String axisName, boolean visible) { + public void addAreaSeries( + StyledAreaSeriesCollection area, + String axisName, + boolean visible + ) { addAreaSeries(area, diagramAttributes.getAxisIndex(axisName), visible); } @@ -466,9 +476,14 @@ * Registers an area to be drawn. * @param area Area to be drawn. * @param index 'axis index' - * @param visible Whether or not to be visible (important for range calculations). + * @param visible Whether or not to be visible + * (important for range calculations). */ - public void addAreaSeries(StyledAreaSeriesCollection area, int index, boolean visible) { + public void addAreaSeries( + StyledAreaSeriesCollection area, + int index, + boolean visible + ) { if (area == null) { log.warn("Cannot yet render above/under curve."); return; @@ -510,12 +525,22 @@ * @param axisName name of the axis. * @param visible whether or not the data should be plotted. */ - public void addAxisSeries(XYSeries series, String axisName, boolean visible) { - addAxisSeries(series, diagramAttributes.getAxisIndex(axisName), visible); + public void addAxisSeries( + XYSeries series, + String axisName, + boolean visible + ) { + addAxisSeries( + series, diagramAttributes.getAxisIndex(axisName), visible); } - public void addAxisDataset(XYDataset dataset, String axisName, boolean visible) { - addAxisDataset(dataset, diagramAttributes.getAxisIndex(axisName), visible); + public void addAxisDataset( + XYDataset dataset, + String axisName, + boolean visible + ) { + addAxisDataset( + dataset, diagramAttributes.getAxisIndex(axisName), visible); } /** @@ -656,7 +681,8 @@ if (b != null && b.getLower().equals(b.getUpper())) { - log.debug("Check whether to expand a x axis.i ("+b.getLower() + "-" + b.getUpper()+")"); + log.debug("Check whether to expand a x axis.i (" + + b.getLower() + "-" + b.getUpper() + ")"); setXBounds(key, ChartHelper.expandBounds(b, 5)); } } @@ -788,8 +814,12 @@ * * @return true, if a zoom range was specified, otherwise false. */ - protected boolean zoom(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { - + protected boolean zoom( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { if (bounds == null) { return false; } @@ -990,7 +1020,8 @@ * @return hash for given legenditem to identify mergeables. */ public static String legendItemHash(LegendItem li) { - // TODO Do proper implementation. Ensure that only mergable sets are created. + // TODO Do proper implementation. + // Ensure that only mergable sets are created. // getFillPaint() // getFillPaintTransformer() // getLabel() @@ -1104,7 +1135,9 @@ } return label; } - for (Processor pr: diagramAttributes.getProcessorsForAxisName(axisName)) { + for ( + Processor pr: diagramAttributes.getProcessorsForAxisName(axisName) + ) { String label = pr.getAxisLabel(this); if (label != null) { return label; @@ -1122,7 +1155,8 @@ protected List<AxisSection> buildYAxisSections() { List<AxisSection> axisSections = new ArrayList<AxisSection>(); - List<DiagramAttributes.AxisAttributes> axesAttrs = diagramAttributes.getAxesAttributes(); + List<DiagramAttributes.AxisAttributes> axesAttrs = + diagramAttributes.getAxesAttributes(); for (int i = 0, n = axesAttrs.size(); i < n; i++) { AxisSection ySection = new AxisSection(); @@ -1208,7 +1242,8 @@ if (visible) { // Save the label that should be added for this processor - int axisIdx = diagramAttributes.getAxisIndex(pr.getAxisName()); + int axisIdx = diagramAttributes.getAxisIndex( + pr.getAxisName()); LinkedHashSet<String> curLabels = axesLabels.get(axisIdx); if (curLabels == null) { curLabels = new LinkedHashSet<String>(5);