# HG changeset patch # User Felix Wolfsteller # Date 1324393931 0 # Node ID 76cedac30d35bd84623f8d9d59ad1081d810e171 # Parent 5746c74c69cf117be9f3f803e0b54dca99e8427a Store additional Parameter in AreaArtifact (paint everything between curve a and b?). flys-artifacts/trunk@3498 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5746c74c69cf -r 76cedac30d35 flys-artifacts/src/main/java/de/intevation/flys/artifacts/AreaArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AreaArtifact.java Tue Dec 20 15:06:41 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AreaArtifact.java Tue Dec 20 15:12:11 2011 +0000 @@ -48,6 +48,9 @@ /** data item name to access lower curve. */ protected static final String AREA_CURVE_UNDER = "area.curve_under"; + /** data item name to access whether or not paint over and under. */ + protected static final String AREA_BETWEEN = "area.between"; + /** Name of state. */ protected static final String AREA_NAME = "area.name"; @@ -103,6 +106,7 @@ // do nothing } + /** * Get name of facets to create. */ @@ -110,6 +114,7 @@ return getDataAsString(FACET_NAME); } + /** * Get dataprovider key for the 'lower' curve (we got that information fed * from the client and store it as data). @@ -120,6 +125,16 @@ /** + * True if the whole area between the two curves shall be filled. + */ + public boolean getPaintBetween() { + String val = getDataAsString(AREA_BETWEEN); + + return val != null && val.equals("true"); + } + + + /** * Get dataprovider key for the 'upper' curve (we got that information fed * from the client and store it as data). */ @@ -162,6 +177,7 @@ return states; } + /** Trivia. */ protected State getState(Object context, String stateID) { return getCurrentState(null); diff -r 5746c74c69cf -r 76cedac30d35 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/AreaFacet.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/AreaFacet.java Tue Dec 20 15:06:41 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/AreaFacet.java Tue Dec 20 15:12:11 2011 +0000 @@ -83,7 +83,9 @@ logger.warn("Not given 'upper' and 'lower' for area"); } - return new Object[] {lowerData, upperData}; + return new Object[] {lowerData, + upperData, + Boolean.valueOf(artifact.getPaintBetween())}; } diff -r 5746c74c69cf -r 76cedac30d35 flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Tue Dec 20 15:06:41 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java Tue Dec 20 15:12:11 2011 +0000 @@ -200,7 +200,12 @@ area.addSeries(up); } else if (up != null && down != null) { - area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); + if (doubles[2] != null && ((Boolean)doubles[2]).booleanValue()) { + area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); + } + else { + area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE); + } area.addSeries(up); area.addSeries(down); }