Mercurial > dive4elements > river
changeset 1900:64ffc371afe7
Adjusted implementation to match implementation in StaticWKmsArtifact.
flys-artifacts/trunk@3260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 16 Nov 2011 09:15:25 +0000 |
parents | d002198c64a2 |
children | da52932f3bc1 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java |
diffstat | 2 files changed, 33 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Nov 16 09:12:54 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Nov 16 09:15:25 2011 +0000 @@ -1,3 +1,9 @@ +2011-11-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java: + Adjusted to similar implementations. Added TODO about merging with + these similar implementations. + 2011-11-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java Wed Nov 16 09:12:54 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java Wed Nov 16 09:15:25 2011 +0000 @@ -87,33 +87,30 @@ String [] parts = code.split("-"); if (parts.length >= 4) { - try { - int col = Integer.valueOf(parts[2]); - int wst = Integer.valueOf(parts[3]); - - addStringData("col_pos", parts[2]); - addStringData("wst_id", parts[3]); - - String wkmsName = WKmsFactory.getWKmsName(col, wst); + int col = Integer.valueOf(parts[2]); + int wst = Integer.valueOf(parts[3]); - String name; - if (parts[0].equals(HEIGHTMARKS_POINTS)) { - name = HEIGHTMARKS_POINTS; - } - else { - name = STATIC_WQKMS; - } + addStringData("col_pos", parts[2]); + addStringData("wst_id", parts[3]); - Facet facet = new WQKmsFacet( - name, - Resources.getMsg( - callMeta, - wkmsName, - wkmsName)); - fs.add(facet); - facets.put(state.getID(), fs); + String wkmsName = WKmsFactory.getWKmsName(col, wst); + + String name; + if (parts[0].equals(HEIGHTMARKS_POINTS)) { + name = HEIGHTMARKS_POINTS; } - catch (Exception e) {} + else { + name = STATIC_WQKMS; + } + + Facet facet = new WQKmsFacet( + name, + Resources.getMsg( + callMeta, + wkmsName, + wkmsName)); + fs.add(facet); + facets.put(state.getID(), fs); } } @@ -125,23 +122,19 @@ /** * Initialize the static state with output. * @return static state + * @TODO merge with StaticWKmsArtifact implementation. */ protected State spawnState() { state = new StaticState(STATIC_STATE_NAME); List<Facet> fs = facets.get(STATIC_STATE_NAME); - DefaultOutput output1 = new DefaultOutput( - "w_differences", - "w_differences.longitudinal_section", "image/png", - fs, - "chart"); - DefaultOutput output2 = new DefaultOutput( - "longitudinal_section", - "longitudinal_section.longitudinal_section", "image/png", + DefaultOutput output = new DefaultOutput( + "general", + "general", + "image/png", fs, "chart"); - state.getOutputs().add(output1); - state.getOutputs().add(output2); + state.getOutputs().add(output); return state; }