Mercurial > dive4elements > river
changeset 2033:76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
flys-artifacts/trunk@3498 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 20 Dec 2011 15:12:11 +0000 |
parents | 5746c74c69cf |
children | 7bc9293de4e6 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/AreaArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/AreaFacet.java flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java |
diffstat | 3 files changed, 25 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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())}; }
--- 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); }