Mercurial > dive4elements > river
changeset 1944:21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
flys-artifacts/trunk@3334 c6561f87-3c4e-4783-a992-168aeb5c3f6f
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Nov 30 10:10:42 2011 +0000 @@ -1,3 +1,37 @@ +2011-11-30 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + Changed doOut signature to use ArtifactAndFacet, which will be + side effect of upcoming "blackboard" feature. + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java + (getRangesForDataset, getRangesForAxis): Renamed, removed TODO. + + * src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java + (createAxis): Update call to XYChartGenerator.getRangesForAxis, + cosmetics. + + * src/main/java/de/intevation/flys/exports/OutGenerator.java + (doOut): Changed Signature to accet ArifactAndFacet instead of + Artifact and Facet. + + * src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java, + src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java, + src/main/java/de/intevation/flys/exports/ChartGenerator.java, + src/main/java/de/intevation/flys/exports/ReportGenerator.java, + src/main/java/de/intevation/flys/exports/MapGenerator.java, + src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java, + src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java, + src/main/java/de/intevation/flys/exports/AbstractExporter.java, + src/main/java/de/intevation/flys/exports/ATExporter.java, + src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java, + src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java, + src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java, + src/main/java/de/intevation/flys/exports/ChartInfoGenerator.java + (doOut): Adjusted to new signature. + + * src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java: + (adjustAxes): Removed, we do not need a (manual) second axis. + 2011-11-28 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ATExporter.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ATExporter.java Wed Nov 30 10:10:42 2011 +0000 @@ -13,6 +13,7 @@ import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.model.WQ; @@ -48,20 +49,11 @@ @Override public void doOut( - Artifact artifact, - Facet facet, + ArtifactAndFacet artifactf, Document attr, boolean visible ) { - - FLYSArtifact flys = (FLYSArtifact)artifact; - - if ((facet = flys.getNativeFacet(facet)) == null) { - logger.debug("native facet not found."); - return; - } - - data = (WQ)facet.getData(flys, context); + data = (WQ)artifactf.getData(context); } @Override
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java Wed Nov 30 10:10:42 2011 +0000 @@ -13,6 +13,7 @@ import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.artifacts.common.ArtifactNamespaceContext; @@ -112,12 +113,11 @@ */ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { - String name = facet.getName(); + String name = artifactFacet.getFacetName(); logger.debug("AbstractExporter.doOut: " + name); @@ -126,13 +126,7 @@ return; } - FLYSArtifact flys = (FLYSArtifact)artifact; - - Facet nativeFacet = flys.getNativeFacet(facet); - - if (nativeFacet != null) { - addData(nativeFacet.getData(flys, context)); - } + addData(artifactFacet.getData(context)); }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -26,6 +26,7 @@ import de.intevation.flys.model.River; import de.intevation.flys.artifacts.WINFOArtifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.flys.artifacts.resources.Resources; import de.intevation.flys.utils.FLYSUtils; @@ -183,6 +184,9 @@ } + /** + * Get Range of Domain ("X"-) Axis from request. + */ protected Range getDomainAxisRange() { Element xrange = (Element)XMLUtils.xpath( request, @@ -199,8 +203,6 @@ String lower = xrange.getAttributeNS(uri, "from"); String upper = xrange.getAttributeNS(uri, "to"); - logger.debug("FOUND X RANGE: " + lower + " -> " + upper); - if (lower.length() > 0 && upper.length() > 0) { try { double from = Double.parseDouble(lower); @@ -239,8 +241,10 @@ return null; } + String uri = ArtifactNamespaceContext.NAMESPACE_URI; + String lower = yrange.getAttributeNS(uri, "from"); String upper = yrange.getAttributeNS(uri, "to"); @@ -254,13 +258,9 @@ return null; } - if (from > to) { - double tmp = to; - to = from; - from = tmp; - } - - return new Range(from, to); + return from > to + ? new Range(to, from) + : new Range(from, to); } catch (NumberFormatException nfe) { logger.warn("Wrong values for value axis range."); @@ -282,8 +282,7 @@ public abstract void doOut( - Artifact artifact, - Facet facet, + ArtifactAndFacet bundle, Document attr, boolean visible);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -15,6 +15,7 @@ import de.intevation.artifacts.Artifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; @@ -87,12 +88,11 @@ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { - String name = (facet != null) ? facet.getName() : null; + String name = artifactFacet.getFacetName(); logger.debug("ComputedDischargeCurveGenerator.doOut: " + name); @@ -101,17 +101,16 @@ return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); + Facet facet = artifactFacet.getFacet(); if (name.equals(COMPUTED_DISCHARGE_Q)) { - doQOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doQOut((WQKms) artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(STATIC_WQ)) { - doWQOut(f.getData(artifact, context), facet, attr, visible); + doWQOut(artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(STATIC_WQ_ANNOTATIONS)) { - doWQAnnotations(f.getData(artifact, context), facet, attr, visible); + doWQAnnotations(artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) || name.equals(MAINVALUES_Q) @@ -119,10 +118,10 @@ || name.equals(MAINVALUES_W) ) { doAnnotations((FLYSAnnotation) - f.getData(artifact, context), facet, attr, visible); + artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(STATIC_WKMS_INTERPOL)) { - doWAnnotations(f.getData(artifact, context), facet, attr, visible); + doWAnnotations(artifactFacet.getData(context), facet, attr, visible); } else { logger.warn("Unknown facet type for computed discharge: " + name); @@ -134,7 +133,7 @@ * Add WQ Data to plot. */ protected void doWQOut( - Object wqkms, + Object wqkms, Facet facet, Document theme, boolean visible @@ -147,6 +146,7 @@ addAxisSeries(series, YAXIS.W.idx, visible); } + /** * Add Q-Series to plot. * @param wqkms actual data @@ -189,6 +189,7 @@ facet, theme, visible); } + /** * Add W-Annotations to plot. * @param wqkms actual data
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -14,6 +14,7 @@ import de.intevation.artifacts.Artifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; @@ -116,29 +117,15 @@ } - protected void adjustAxes(XYPlot plot) { - super.adjustAxes(plot); - - NumberAxis qAxis = new NumberAxis( - msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT)); - - plot.setRangeAxis(1, qAxis); - - Font font = plot.getRangeAxis(0).getLabelFont(); - qAxis.setLabelFont(font); - } - - /** * Let one facet do its job. */ public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { - String name = facet.getName(); + String name = artifactFacet.getFacetName(); logger.debug("CrossSectionGenerator.doOut: " + name); @@ -147,24 +134,17 @@ return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); - - if (f == null) { - return; - } - if (name.equals(CROSS_SECTION)) { doCrossSectionOut( - f.getData(artifact, context), - f.getDescription(), + artifactFacet.getData(context), + artifactFacet.getFacetDescription(), attr, visible); } else if (name.equals(CROSS_SECTION_WATER_LINE)) { doCrossSectionWaterLineOut( - f.getData(artifact, context), - f.getDescription(), + artifactFacet.getData(context), + artifactFacet.getFacetDescription(), attr, visible); }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -15,6 +15,7 @@ import de.intevation.artifacts.Artifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.model.FacetTypes; @@ -131,29 +132,19 @@ public void doOut( - Artifact artifact, - Facet facet, - Document theme, - boolean visible + ArtifactAndFacet artifactFacet, + Document theme, + boolean visible ) { - logger.debug("DischargeCurveGenerator.doOut: " + facet.getName()); + String name = artifactFacet.getFacetName(); + logger.debug("DischargeCurveGenerator.doOut: " + name); - String name = facet.getName(); - - FLYSArtifact flysArtifact = (FLYSArtifact) artifact; - - Facet nativeFacet = flysArtifact.getNativeFacet(facet); - - if (nativeFacet == null) { - logger.debug("no facet found"); - return; - } if (name.equals(DISCHARGE_CURVE)) { doDischargeOut( - (WINFOArtifact) flysArtifact, - nativeFacet.getData(flysArtifact, context), - nativeFacet.getDescription(), + (WINFOArtifact) artifactFacet.getArtifact(), + artifactFacet.getData(context), + artifactFacet.getFacetDescription(), theme, visible); } @@ -162,8 +153,8 @@ || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) || name.equals(MAINVALUES_W)) { - doAnnotations((FLYSAnnotation) nativeFacet.getData(artifact, context), - facet, theme, visible); + doAnnotations((FLYSAnnotation) artifactFacet.getData(context), + artifactFacet.getFacet(), theme, visible); } else { logger.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name); @@ -177,10 +168,10 @@ */ protected void doDischargeOut( WINFOArtifact artifact, - Object o, - String description, - Document theme, - boolean visible) + Object o, + String description, + Document theme, + boolean visible) { WQKms wqkms = (WQKms) o;
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -8,6 +8,7 @@ import de.intevation.artifacts.Artifact; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; @@ -37,44 +38,38 @@ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { logger.debug("DischargeLongitudinalSectionGenerator.doOut"); - if (facet == null) { - return; - } - - String name = facet.getName(); + String name = artifactFacet.getFacetName(); if (name == null) { return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); + Facet facet = artifactFacet.getFacet(); if (IS.WQ_KM(name)) { - doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WQKms) artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(DISCHARGE_LONGITUDINAL_Q)) { - doQOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doQOut((WQKms) artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(DISCHARGE_LONGITUDINAL_C)) { doCorrectedWOut( - (WQCKms) f.getData(artifact, context), + (WQCKms) artifactFacet.getData(context), facet, attr, visible); } else if (IS.W_KM(name)) { - doWOut((WKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WKms) artifactFacet.getData(context), facet, attr, visible); } else if (name.equals(LONGITUDINAL_ANNOTATION)) { - doAnnotations((FLYSAnnotation) f.getData(artifact, context), + doAnnotations((FLYSAnnotation) artifactFacet.getData(context), facet, attr, visible); } else {
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -17,6 +17,7 @@ import de.intevation.artifacts.Artifact; import de.intevation.artifactdatabase.state.Facet; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.FacetTypes; @@ -146,12 +147,11 @@ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { - String name = facet != null ? facet.getName() : null; + String name = artifactFacet.getFacetName(); logger.debug("DurationCurveGenerator.doOut: " + name); @@ -160,14 +160,11 @@ return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); - if (name.equals(DURATION_W)) { - doWOut((WQDay) f.getData(artifact, context), attr, visible); + doWOut((WQDay) artifactFacet.getData(context), attr, visible); } else if (name.equals(DURATION_Q)) { - doQOut((WQDay) f.getData(artifact, context), attr, visible); + doQOut((WQDay) artifactFacet.getData(context), attr, visible); } else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) || name.equals(MAINVALUES_Q) @@ -175,8 +172,8 @@ || name.equals(MAINVALUES_W) ) { doAnnotations( - (FLYSAnnotation) f.getData(artifact, context), - facet, attr, visible); + (FLYSAnnotation) artifactFacet.getData(context), + artifactFacet.getFacet(), attr, visible); } else { logger.warn("Unknown facet name: " + name);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java Wed Nov 30 10:10:42 2011 +0000 @@ -139,15 +139,16 @@ String type, int pos) { + logger.debug("createAxisElement " + pos); Range range = axis.getRange(); Element e = cr.create(type); - cr.addAttr(e, "pos", String.valueOf(pos), true); + cr.addAttr(e, "pos", String.valueOf(pos), true); cr.addAttr(e, "from", String.valueOf(range.getLowerBound()), true); - cr.addAttr(e, "to", String.valueOf(range.getUpperBound()), true); + cr.addAttr(e, "to", String.valueOf(range.getUpperBound()), true); //Range[] rs = generator.getRangesForDataset(dataset); - Range[] rs = generator.getRangesForDataset(pos); + Range[] rs = generator.getRangesForAxis(pos); Range r = null; if (type.equals("range")) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -26,6 +26,8 @@ import de.intevation.flys.jfree.FLYSAnnotation; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; + import de.intevation.flys.utils.FLYSUtils; import de.intevation.flys.utils.DataUtil; @@ -249,12 +251,11 @@ * @param attr theme for facet */ public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactAndFacet, + Document attr, + boolean visible ) { - String name = facet.getName(); + String name = artifactAndFacet.getFacetName(); logger.debug("LongitudinalSectionGenerator.doOut: " + name); @@ -263,31 +264,30 @@ return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); + Facet facet = artifactAndFacet.getFacet(); - if (f == null) { + if (facet == null) { return; } if (name.equals(LONGITUDINAL_W)) { - doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WQKms) artifactAndFacet.getData(context), facet, attr, visible); } else if (name.equals(LONGITUDINAL_Q)) { - doQOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doQOut((WQKms) artifactAndFacet.getData(context), facet, attr, visible); } else if (name.equals(LONGITUDINAL_ANNOTATION)) { - doAnnotations((FLYSAnnotation) f.getData(artifact, context), + doAnnotations((FLYSAnnotation) artifactAndFacet.getData(context), facet, attr, visible); } else if (name.equals(STATIC_WKMS) || name.equals(HEIGHTMARKS_POINTS) || name.equals(STATIC_WQKMS)) { - doWOut((WKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WKms) artifactAndFacet.getData(context), facet, attr, visible); } else if (name.equals(W_DIFFERENCES)) { doWDifferencesOut( - (WKms) f.getData(artifact, context), + (WKms) artifactAndFacet.getData(context), facet, attr, visible);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -21,6 +21,7 @@ import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; @@ -36,7 +37,6 @@ private static Logger logger = Logger.getLogger(MapGenerator.class); - protected Artifact master; protected Document request; @@ -78,17 +78,17 @@ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible) + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible) { - String name = facet.getName(); + String name = artifactFacet.getFacetName(); - logger.debug("MapGenerator.doOut: " +artifact.identifier()+" | "+name); - FLYSArtifact flys = (FLYSArtifact) artifact; + logger.debug("MapGenerator.doOut: " + + artifactFacet.getArtifact().identifier() + " | " + name); + FLYSArtifact flys = (FLYSArtifact) artifactFacet.getArtifact(); - Facet nativeFacet = flys.getNativeFacet(facet); + Facet nativeFacet = artifactFacet.getFacet(); if (nativeFacet instanceof WMSLayerFacet) { WMSLayerFacet wms = (WMSLayerFacet) nativeFacet;
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -5,6 +5,7 @@ import org.w3c.dom.Document; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; @@ -47,7 +48,7 @@ * producing the output. * @param visible Specifies, if this output should be visible or not. */ - void doOut(Artifact artifact, Facet facet, Document attr, boolean visible); + void doOut(ArtifactAndFacet bundle, Document attr, boolean visible); /** * Writes the collected output of all artifacts specified in the
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -12,6 +12,7 @@ import de.intevation.artifactdatabase.state.Facet; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.Calculation; @@ -45,15 +46,14 @@ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactFacet, + Document attr, + boolean visible ) { logger.debug("doOut"); - facet = ((FLYSArtifact)artifact).getNativeFacet(facet); + Facet facet = artifactFacet.getFacet(); if (facet != null) { - Calculation report = (Calculation)facet.getData(artifact, context); + Calculation report = (Calculation) artifactFacet.getData(context); report.toXML(result, context.getMeta()); } }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -20,9 +20,10 @@ import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.WKms; -import de.intevation.flys.utils.DataUtil; +import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.utils.DataUtil; import de.intevation.flys.utils.FLYSUtils; import de.intevation.flys.jfree.FLYSAnnotation; @@ -133,12 +134,11 @@ */ @Override public void doOut( - Artifact artifact, - Facet facet, - Document attr, - boolean visible + ArtifactAndFacet artifactAndFacet, + Document attr, + boolean visible ) { - String name = facet.getName(); + String name = artifactAndFacet.getFacetName(); logger.debug("WDifferencesCurveGenerator.doOut: " + name); @@ -147,29 +147,24 @@ return; } - FLYSArtifact flys = (FLYSArtifact) artifact; - Facet f = flys.getNativeFacet(facet); - - if (f == null) { - return; - } - if (name.equals(W_DIFFERENCES)) { doWDifferencesOut( - (WKms) f.getData(artifact, context), - facet, + (WKms) artifactAndFacet.getData(context), + artifactAndFacet.getFacetDescription(), attr, visible); } else if (name.equals(LONGITUDINAL_W)) { - doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WQKms) artifactAndFacet.getData(context), + artifactAndFacet.getFacetDescription(), attr, visible); } else if (name.equals(STATIC_WKMS) || name.equals(HEIGHTMARKS_POINTS)) { - doWOut((WKms) f.getData(artifact, context), facet, attr, visible); + doWOut((WKms) artifactAndFacet.getData(context), + artifactAndFacet.getFacetDescription(), attr, visible); } else if (name.equals(LONGITUDINAL_ANNOTATION)) { - doAnnotations((FLYSAnnotation) f.getData(artifact, context), - facet, attr, visible); + doAnnotations((FLYSAnnotation) artifactAndFacet.getData(context), + artifactAndFacet.getFacet(), attr, visible); } else { logger.warn("Unknown facet name: " + name); @@ -187,13 +182,13 @@ */ protected void doWOut( WKms wkms, - Facet facet, + String description, Document theme, boolean visible ) { logger.debug("WDifferencesCurveGenerator.doWOut"); - XYSeries series = new StyledXYSeries(facet.getDescription(), theme); + XYSeries series = new StyledXYSeries(description, theme); StyledSeriesBuilder.addPoints(series, wkms); @@ -232,10 +227,10 @@ * Add items to dataseries which describes the differences. */ protected void doWDifferencesOut( - WKms wkms, - Facet facet, - Document theme, - boolean visible + WKms wkms, + String description, + Document theme, + boolean visible ) { logger.debug("WDifferencesCurveGenerator.doWDifferencesOut"); if (wkms == null) { @@ -243,7 +238,7 @@ return; } - XYSeries series = new StyledXYSeries(facet.getDescription(), theme); + XYSeries series = new StyledXYSeries(description, theme); if (logger.isDebugEnabled()) { if (wkms.size() > 0) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Nov 28 15:00:46 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Wed Nov 30 10:10:42 2011 +0000 @@ -534,9 +534,8 @@ * * @return a Range[] as follows: [x-Range, y-Range]. */ - // TODO When is this actually called? Is it valid as is? - public Range[] getRangesForDataset(int index) { - logger.debug("getRangesForDataset " + index); + public Range[] getRangesForAxis(int index) { + logger.debug("getRangesForAxis " + index); return new Range[] { xRanges.get(Integer.valueOf(0)), yRanges.get(Integer.valueOf(index))