diff flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 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 1dca41dba135
children 4eb91fb1e73e
line wrap: on
line diff
--- 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.

http://dive4elements.wald.intevation.org