# HG changeset patch # User Christian Lins # Date 1341567165 0 # Node ID dd3ddc8ecb14982f29a33b8a884fcc8f94f63998 # Parent 1a79d47ed14bc1f7d332c3e600e34a9ad4671adf Remove HYK references/code from ChartGenerator flys-artifacts/trunk@4878 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1a79d47ed14b -r dd3ddc8ecb14 flys-artifacts/ChangeLog --- 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 + + * 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 * doc/datacage-config-manual/datacage-config-manual.tex: @@ -16,7 +24,7 @@ 2012-07-05 Christian Lins * 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, diff -r 1a79d47ed14b -r dd3ddc8ecb14 flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.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; } diff -r 1a79d47ed14b -r dd3ddc8ecb14 flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java --- 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.