Mercurial > dive4elements > river
changeset 3245:dd3ddc8ecb14
Remove HYK references/code from ChartGenerator
flys-artifacts/trunk@4878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 06 Jul 2012 09:32:45 +0000 |
parents | 1a79d47ed14b |
children | 229e9b27ce15 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java |
diffstat | 3 files changed, 14 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Jul 05 19:23:52 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Jul 06 09:32:45 2012 +0000 @@ -1,3 +1,11 @@ +2012-07-07 Christian Lins <christian.lins@intevation.de> + + * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: + Remove debugging code. + + * src/main/java/de/intevation/flys/exports/ChartGenerator.java: + Remove HYK references and code. + 2012-07-05 Felix Wolfsteller <felix.wolfsteller@intevation.de> * doc/datacage-config-manual/datacage-config-manual.tex: @@ -16,7 +24,7 @@ 2012-07-05 Christian Lins <christian.lins@intevation.de> * doc/*-themes.xml: - Add textorientation field. + Add textorientation field. * src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java, src/main/java/de/intevation/flys/exports/ChartGenerator.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Thu Jul 05 19:23:52 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Fri Jul 06 09:32:45 2012 +0000 @@ -767,7 +767,7 @@ Node theme = (Node) XMLUtils.xpath( tmp, - "art:themes/theme[@facet='" + facet + + "art:themes/theme[@facet='" + facet + "' and @index='" + String.valueOf(index) + "']", XPathConstants.NODE, ArtifactNamespaceContext.INSTANCE); @@ -786,9 +786,6 @@ addThemeToAttribute(uuid, attr, t, context); theme = t.toXML().getFirstChild(); } - /*else { - log.debug("getFacetThemeFromAttribute: " + XMLUtils.toString(theme)); - }*/ Document doc = XMLUtils.newDocument(); doc.appendChild(doc.importNode(theme, true)); @@ -890,7 +887,7 @@ addThemeToAttribute(uuid, attr, t, context); log.debug("initItemAttribute for facet " + facet + ": " + XMLUtils.toString(attr)); - + return attr; }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Thu Jul 05 19:23:52 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Fri Jul 06 09:32:45 2012 +0000 @@ -59,8 +59,6 @@ import de.intevation.flys.artifacts.resources.Resources; -import de.intevation.flys.artifacts.model.HYKFactory; - import de.intevation.flys.jfree.Bounds; import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; import de.intevation.flys.jfree.DoubleBounds; @@ -185,7 +183,7 @@ annotations.add(annotation); } - + /** * Add a text and a line annotation. * @param area convenience to determine positions in plot. @@ -496,32 +494,9 @@ ta.setY(area.above(0.05d, ta.getY())); plot.getRenderer().addAnnotation(ta, org.jfree.ui.Layer.FOREGROUND); } - - // Hyks. - for (HYKFactory.Zone zone: fa.getBoxes()) { - // For each zone, create a box to fill with color, a box to draw - // the lines and a text to display the type. - fillPaint = colorForHYKZone(zone.getName()); - - XYBoxAnnotation boxA = new XYBoxAnnotation(zone.getFrom(), area.atGround(), - zone.getTo(), area.ofGround(0.03f), basicStroke, tranPaint, fillPaint); - XYBoxAnnotation boxB = new XYBoxAnnotation(zone.getFrom(), area.atGround(), - zone.getTo(), area.atTop(), basicStroke, fillPaint, tranPaint); - - XYTextAnnotation tex = new XYTextAnnotation(zone.getName(), - zone.getFrom() + (zone.getTo() - zone.getFrom()) / 1.0d, - area.ofGround(0.015f)); - if (textStyle != null) { - textStyle.apply(tex); - } - - plot.getRenderer().addAnnotation(boxA, org.jfree.ui.Layer.BACKGROUND); - plot.getRenderer().addAnnotation(boxB, org.jfree.ui.Layer.BACKGROUND); - plot.getRenderer().addAnnotation(tex, org.jfree.ui.Layer.BACKGROUND); - } } } - + /** * This method needs to be implemented by concrete subclasses to create new @@ -626,32 +601,6 @@ protected void addSubtitles(JFreeChart chart) { // do nothing } - - - /** Get color for hyk zones by their type (which is the name). */ - protected Paint colorForHYKZone(String zoneName) { - if (zoneName.startsWith("R")) { - // Brownish. - return new Color(153, 60, 0); - } - else if (zoneName.startsWith("V")) { - // Greenish. - return new Color(0, 255, 0); - } - else if (zoneName.startsWith("B")) { - // Grayish. - return new Color(128, 128, 128); - } - else if (zoneName.startsWith("H")) { - // Blueish. - return new Color(0, 0, 255); - } - else { - // Default. - logger.debug("Unknown zone type found."); - return new Color(255, 0, 0); - } - } /** @@ -687,7 +636,7 @@ addAnnotations(annotations); } } - + /** * Generate chart.