diff artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java @ 6905:1b35b2ddfc28

Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 22 Aug 2013 23:31:38 +0200
parents d9dfa52f69eb
children 0a337f0005c2
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Thu Aug 22 15:38:57 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Thu Aug 22 23:31:38 2013 +0200
@@ -23,7 +23,7 @@
 import org.dive4elements.river.jfree.StyledDomainMarker;
 import org.dive4elements.river.jfree.StyledTimeSeries;
 import org.dive4elements.river.jfree.StyledValueMarker;
-import org.dive4elements.river.utils.ThemeUtil;
+import org.dive4elements.river.themes.ThemeDocument;
 
 import java.io.OutputStream;
 import java.text.NumberFormat;
@@ -160,7 +160,7 @@
     @Override
     public void doOut(
             ArtifactAndFacet artifactFacet,
-            Document         theme,
+            ThemeDocument    theme,
             boolean          visible
             ) {
         String name = artifactFacet.getFacetName();
@@ -230,11 +230,11 @@
 
 
     protected void doReferencePeriodsOut(
-            D4EArtifact artifact,
-            Object       data,
-            String       desc,
-            Document     theme,
-            boolean      visible)
+            D4EArtifact   artifact,
+            Object        data,
+            String        desc,
+            ThemeDocument theme,
+            boolean       visible)
     {
         logger.debug("doReferencePeriodsOut()");
 
@@ -260,11 +260,11 @@
 
 
     protected void doSectorAverageOut(
-            D4EArtifact artifact,
-            Object       data,
-            String       desc,
-            Document     theme,
-            boolean      visible)
+            D4EArtifact   artifact,
+            Object        data,
+            String        desc,
+            ThemeDocument theme,
+            boolean       visible)
     {
         logger.debug("doSectorAverageOut(): description = " + desc);
 
@@ -289,7 +289,7 @@
 
         addAxisDataset(tsc, 0, visible);
 
-        if (visible && ThemeUtil.parseShowLineLabel(theme)) {
+        if (visible && theme.parseShowLineLabel()) {
             List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
             XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
                     "\u0394 W(t) [cm] " + (float)Math.round(qwd.qwd.getDeltaW() * 10000) / 10000,
@@ -308,7 +308,7 @@
             D4EArtifact artifact,
             Object       data,
             String       desc,
-            Document     theme,
+            ThemeDocument theme,
             boolean      visible
             ) {
         logger.debug("doAnalysisEventsOut: desc = " + desc);
@@ -318,7 +318,7 @@
     }
 
 
-    protected void doQWDEventsOut(QWD qwd, String desc, Document theme, boolean visible)
+    protected void doQWDEventsOut(QWD qwd, String desc, ThemeDocument theme, boolean visible)
     {
         TimeSeriesCollection tsc = new TimeSeriesCollection();
 
@@ -369,11 +369,11 @@
      * @param annoIdxMap map of index in qwds to series/data item indices in tsc.
      */
     protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap,
-            TimeSeriesCollection tsc, QWD qwd, Document theme,
+            TimeSeriesCollection tsc, QWD qwd, ThemeDocument theme,
             boolean visible) {
         logger.debug("doQWDTextAnnotation()");
 
-        if (!visible || !ThemeUtil.parseShowPointLabel(theme)) {
+        if (!visible || !theme.parseShowPointLabel()) {
             logger.debug("doQWDTextAnnotation: annotation not visible");
             return;
         }
@@ -401,11 +401,11 @@
 
 
     protected void doReferenceEventsOut(
-            D4EArtifact artifact,
-            Object       data,
-            String       desc,
-            Document     theme,
-            boolean      visible
+            D4EArtifact  artifact,
+            Object        data,
+            String        desc,
+            ThemeDocument theme,
+            boolean       visible
             ) {
         logger.debug("doReferenceEventsOut: desc = " + desc);
 
@@ -415,11 +415,11 @@
 
 
     protected void doDeviationOut(
-            D4EArtifact artifact,
-            Object       data,
-            String       desc,
-            Document     theme,
-            boolean      visible
+            D4EArtifact   artifact,
+            Object        data,
+            String        desc,
+            ThemeDocument theme,
+            boolean       visible
             ) {
         logger.debug("doDeviationOut: desc = " + desc);
 
@@ -438,10 +438,10 @@
 
     protected void doAnalysisPeriodsOut(
             D4EArtifact artifact,
-            Object       data,
-            String       desc,
-            Document     theme,
-            boolean      visible)
+            Object        data,
+            String        desc,
+            ThemeDocument theme,
+            boolean       visible)
     {
         DateRange[] ranges = (DateRange[]) data;
         if (ranges == null || !visible) {
@@ -473,7 +473,9 @@
 
         context.putContextValue("currentKm", currentKm);
 
-        StyledValueMarker marker = new StyledValueMarker(0, request);
+        // XXX: This looks hackish!
+        StyledValueMarker marker =
+            new StyledValueMarker(0, new ThemeDocument(request));
         valueMarker.add(marker);
     }
 }

http://dive4elements.wald.intevation.org