# HG changeset patch # User Ingo Weinzierl # Date 1347625257 0 # Node ID d29cebf371badc6f265b877863b69f598214e5fa # Parent d8f2ab5b61c31681e03960dc571c6867dcb4fec5 Use data of bed quality facets to fill the chart. flys-artifacts/trunk@5468 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Sep 14 12:20:57 2012 +0000 @@ -1,3 +1,28 @@ +2012-09-14 Ingo Weinzierl + + * doc/conf/artifacts/minfo.xml: Splitted facets for diameter of bed into + two facets: diameter for sublayer and toplayer. + + * doc/conf/themes.xml, + doc/conf/second-themes.xml, + doc/conf/default-themes.xml: Splitted themes for diameter of bed into + two themes. + + * src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java: + Splitted facets for diameter of bed into two facets. + + * src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityResult.java: + New method to retrieve the diameter data. + + * src/main/java/de/intevation/flys/artifacts/model/minfo/BedBedQualityResult.java: + New methods to retrieve the porosity, density and diameter data. + + * src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java: + Create two facets for bed diameter instead of a single one. + + * src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java: + Insert data supported by facets into chart. + 2012-09-14 Ingo Weinzierl * src/main/java/de/intevation/flys/jfree/JFreeUtil.java: Added function to diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/doc/conf/artifacts/minfo.xml --- a/flys-artifacts/doc/conf/artifacts/minfo.xml Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/minfo.xml Fri Sep 14 12:20:57 2012 +0000 @@ -286,8 +286,9 @@ + + - diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/doc/conf/default-themes.xml --- a/flys-artifacts/doc/conf/default-themes.xml Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/default-themes.xml Fri Sep 14 12:20:57 2012 +0000 @@ -1091,7 +1091,14 @@ - + + + + + + + + diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/doc/conf/second-themes.xml --- a/flys-artifacts/doc/conf/second-themes.xml Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/second-themes.xml Fri Sep 14 12:20:57 2012 +0000 @@ -1092,7 +1092,14 @@ - + + + + + + + + diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/doc/conf/themes.xml --- a/flys-artifacts/doc/conf/themes.xml Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/themes.xml Fri Sep 14 12:20:57 2012 +0000 @@ -193,8 +193,9 @@ + + - diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Fri Sep 14 12:20:57 2012 +0000 @@ -215,12 +215,13 @@ String MIDDLE_BED_HEIGHT_EPOCH = "bedheight_middle.epoch"; String MIDDLE_BED_HEIGHT_ANNOTATION = "bedheight_middle.annotation"; - String BED_QUALITY_POROSITY_TOPLAYER = "bed_longitudinal_section.porosity_toplayer"; - String BED_QUALITY_POROSITY_SUBLAYER = "bed_longitudinal_section.porosity_sublayer"; - String BED_QUALITY_BED_DIAMETER = "bed_longitudinal_section.bed_diameter"; - String BED_QUALITY_BEDLOAD_DIAMETER = "bed_longitudinal_section.bedload_diameter"; + String BED_QUALITY_POROSITY_TOPLAYER = "bed_longitudinal_section.porosity_toplayer"; + String BED_QUALITY_POROSITY_SUBLAYER = "bed_longitudinal_section.porosity_sublayer"; + String BED_QUALITY_BED_DIAMETER_TOPLAYER = "bed_longitudinal_section.bed_diameter_toplayer"; + String BED_QUALITY_BED_DIAMETER_SUBLAYER = "bed_longitudinal_section.bed_diameter_sublayer"; String BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER = "bed_longitudinal_section.sediment_density_toplayer"; String BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER = "bed_longitudinal_section.sediment_density_sublayer"; + String BED_QUALITY_BEDLOAD_DIAMETER = "bed_longitudinal_section.bedload_diameter"; String SQ_OVERVIEW = "sq_overview"; diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedBedQualityResult.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedBedQualityResult.java Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedBedQualityResult.java Fri Sep 14 12:20:57 2012 +0000 @@ -2,6 +2,8 @@ import org.apache.poi.hssf.record.formula.functions.T; +import com.vividsolutions.jts.densify.Densifier; + import gnu.trove.TDoubleArrayList; import de.intevation.flys.artifacts.model.DateRange; @@ -59,4 +61,46 @@ public double getDiameterSub(int ndx) { return diameterSub.get(ndx); } + + public double[][] getDiameterCapData() { + return new double[][] { + kms.toNativeArray(), + diameterCap.toNativeArray() + }; + } + + public double[][] getDiameterSubData() { + return new double[][] { + kms.toNativeArray(), + diameterSub.toNativeArray() + }; + } + + public double[][] getPorosityTopLayerData() { + return new double[][] { + kms.toNativeArray(), + porosityCap.toNativeArray() + }; + } + + public double[][] getPorositySubLayerData() { + return new double[][] { + kms.toNativeArray(), + porositySub.toNativeArray() + }; + } + + public double[][] getDensityTopLayerData() { + return new double[][] { + kms.toNativeArray(), + loadDensityCap.toNativeArray() + }; + } + + public double[][] getDensitySubLayerData() { + return new double[][] { + kms.toNativeArray(), + loadDensitySub.toNativeArray() + }; + } } diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityResult.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityResult.java Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityResult.java Fri Sep 14 12:20:57 2012 +0000 @@ -77,4 +77,11 @@ public boolean isEmpty() { return empty; } + + public double[][] getDiameterData() { + return new double[][] { + kms.toNativeArray(), + diameter.toNativeArray() + }; + } } diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/BedQualityState.java Fri Sep 14 12:20:57 2012 +0000 @@ -90,12 +90,17 @@ // TODO I18N for Facet description newFacets.add(new BedloadDiameterFacet(idx, - BED_QUALITY_BEDLOAD_DIAMETER, "bed diameter", + BED_QUALITY_BED_DIAMETER_TOPLAYER, "bed diameter_toplayer", + ComputeType.ADVANCE, stateId, hash)); + + // TODO I18N for Facet description + newFacets.add(new BedloadDiameterFacet(idx, + BED_QUALITY_BED_DIAMETER_SUBLAYER, "bed diameter_sublayer", ComputeType.ADVANCE, stateId, hash)); } else if (result instanceof BedLoadBedQualityResult) { - // TODO CREATE FACETS DEPENDING ON THE CALCULATION RESULT - newFacets.add(new BedDiameterFacet(idx, BED_QUALITY_BED_DIAMETER, + // TODO I18N for Facet description + newFacets.add(new BedDiameterFacet(idx, BED_QUALITY_BEDLOAD_DIAMETER, "bedload diameter", ComputeType.ADVANCE, stateId, hash)); } else { diff -r d8f2ab5b61c3 -r d29cebf371ba flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java Fri Sep 14 12:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java Fri Sep 14 12:20:57 2012 +0000 @@ -9,6 +9,8 @@ import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.minfo.BedBedQualityResult; import de.intevation.flys.artifacts.model.minfo.BedLoadBedQualityResult; +import de.intevation.flys.artifacts.model.minfo.BedQualityResult; +import de.intevation.flys.exports.StyledSeriesBuilder; import de.intevation.flys.exports.XYChartGenerator; import de.intevation.flys.jfree.StyledXYSeries; @@ -143,25 +145,40 @@ return; } - if (name.equals(BED_QUALITY_BED_DIAMETER)) { - doBedDiameterOut( + // TODO BED_QUALITY_BED_DIAMETER_TOPLAYER + if (name.equals(BED_QUALITY_BED_DIAMETER_TOPLAYER)) { + doBedDiameterTopLayerOut( (BedBedQualityResult) artifactAndFacet.getData(context), artifactAndFacet, attr, visible); } + else if (name.equals(BED_QUALITY_BED_DIAMETER_SUBLAYER)) { + doBedDiameterSubLayerOut( + (BedBedQualityResult) artifactAndFacet.getData(context), + artifactAndFacet, attr, visible); + } + // TODO BED_QUALITY_BED_DIAMETER_SUBLAYER else if (name.equals(BED_QUALITY_BEDLOAD_DIAMETER)) { - doBedloadDiameterOut( + doBedLoadDiameterOut( (BedLoadBedQualityResult) artifactAndFacet.getData(context), artifactAndFacet, attr, visible); } - else if (name.equals(BED_QUALITY_POROSITY_TOPLAYER) - || name.equals(BED_QUALITY_POROSITY_SUBLAYER)) { - doPorosityOut( + else if (name.equals(BED_QUALITY_POROSITY_TOPLAYER)) { + doPorosityTopLayerOut( (BedBedQualityResult) artifactAndFacet.getData(context), artifactAndFacet, attr, visible); } - else if (name.equals(BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER) - || name.equals(BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER)) { - doDensityOut( + else if (name.equals(BED_QUALITY_POROSITY_SUBLAYER)) { + doPorositySubLayerOut( + (BedBedQualityResult) artifactAndFacet.getData(context), + artifactAndFacet, attr, visible); + } + else if (name.equals(BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER)) { + doDensityTopLayerOut( + (BedBedQualityResult) artifactAndFacet.getData(context), + artifactAndFacet, attr, visible); + } + else if (name.equals(BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER)) { + doDensitySubLayerOut( (BedBedQualityResult) artifactAndFacet.getData(context), artifactAndFacet, attr, visible); } @@ -175,50 +192,80 @@ } } - protected void doBedDiameterOut(BedBedQualityResult data, + protected void doBedDiameterTopLayerOut(BedBedQualityResult data, ArtifactAndFacet aandf, Document theme, boolean visible) { - logger.debug("BedQuality.doBedDiameterOut"); + logger.debug("BedQuality.doBedDiameterTopLayerOut"); XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); - - // StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), - // true); + StyledSeriesBuilder.addPoints(series, data.getDiameterCapData(), true); addAxisSeries(series, YAXIS.W.idx, visible); } - protected void doBedloadDiameterOut(BedLoadBedQualityResult data, + protected void doBedDiameterSubLayerOut(BedBedQualityResult data, ArtifactAndFacet aandf, Document theme, boolean visible) { - logger.debug("BedQuality.doBedloadDiameterOut"); + logger.debug("BedQuality.doBedDiameterSubLayerOut"); XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); - - // StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), - // true); + StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true); addAxisSeries(series, YAXIS.W.idx, visible); } - protected void doPorosityOut(BedBedQualityResult data, + protected void doBedLoadDiameterOut(BedQualityResult data, ArtifactAndFacet aandf, Document theme, boolean visible) { - logger.debug("BedQuality.doPorosityOut"); + logger.debug("BedQuality.doBedLoadDiameterOut"); + + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true); + + addAxisSeries(series, YAXIS.W.idx, visible); + } + + protected void doPorosityTopLayerOut(BedBedQualityResult data, + ArtifactAndFacet aandf, Document theme, boolean visible) { + logger.debug("BedQuality.doPorosityTopLayerOut"); XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); - // StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), - // true); + StyledSeriesBuilder.addPoints(series, data.getPorosityTopLayerData(), + true); addAxisSeries(series, YAXIS.P.idx, visible); } - protected void doDensityOut(BedBedQualityResult data, + protected void doPorositySubLayerOut(BedBedQualityResult data, + ArtifactAndFacet aandf, Document theme, boolean visible) { + logger.debug("BedQuality.doPorositySubLayerOut"); + + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + + StyledSeriesBuilder.addPoints(series, data.getPorositySubLayerData(), + true); + + addAxisSeries(series, YAXIS.P.idx, visible); + } + + protected void doDensityTopLayerOut(BedBedQualityResult data, ArtifactAndFacet aandf, Document theme, boolean visible) { logger.debug("BedQuality.doDensityOut"); XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); - // StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), - // true); + StyledSeriesBuilder.addPoints(series, data.getDensityTopLayerData(), + true); + + addAxisSeries(series, YAXIS.D.idx, visible); + } + + protected void doDensitySubLayerOut(BedBedQualityResult data, + ArtifactAndFacet aandf, Document theme, boolean visible) { + logger.debug("BedQuality.doDensityOut"); + + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + + StyledSeriesBuilder.addPoints(series, data.getDensitySubLayerData(), + true); addAxisSeries(series, YAXIS.D.idx, visible); }