Mercurial > dive4elements > river
changeset 2004:94c4dd5aaf20
Made StaticState a bit more convenient to use.
flys-artifacts/trunk@3446 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 14:11:50 +0000 |
parents | ec5d6149b176 |
children | 79b15491177a |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/StaticState.java |
diffstat | 2 files changed, 22 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Dec 16 14:09:59 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Dec 16 14:11:50 2011 +0000 @@ -1,3 +1,8 @@ +2011-12-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/states/StaticState.java: + Added convenience function and easy sybclassing. + 2011-12-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/StaticState.java Fri Dec 16 14:09:59 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/StaticState.java Fri Dec 16 14:11:50 2011 +0000 @@ -46,11 +46,25 @@ getOutputs().add(output); } + public static void addDefaultChartOutput( + DefaultState state, + String nameDesc, + List<Facet> facets + ) { + DefaultOutput output = new DefaultOutput(nameDesc, + nameDesc, "image/png", facets, "chart"); + state.getOutputs().add(output); + } + /** * Do nothing (override to include your logic). * @param facets List of facets (to add to). */ + public Object staticCompute(List<Facet> facets, FLYSArtifact artifact) { + return staticCompute(facets); + } + public Object staticCompute(List<Facet> facets) { return null; } @@ -65,7 +79,7 @@ List<Facet> facets, Object old ) { - return staticCompute(facets); + return staticCompute(facets, artifact); } @@ -78,7 +92,7 @@ List<Facet> facets, Object old ) { - return staticCompute(facets); + return staticCompute(facets, artifact); } @@ -91,7 +105,7 @@ CallMeta meta, List<Facet> facets ) { - return staticCompute(facets); + return staticCompute(facets, artifact); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :