# HG changeset patch # User Ingo Weinzierl # Date 1264000655 0 # Node ID fec85cd0149787bb4e31db3604c2ed7190eb4aac # Parent 70adafe2b9d575833d848822ff7c1f76e0e21c4a Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts. gnv-artifacts/trunk@585 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/ChangeLog Wed Jan 20 15:17:35 2010 +0000 @@ -1,3 +1,22 @@ +2010-01-20 Ingo Weinzierl + + Issue105 The option to enable/disable data points in charts is now + available in gui. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Parse optional chart parameter 'points' to adjust rendering of shapes. + + * doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml, + doc/conf/products/horizontalprofile/conf_mesh_cross.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: Added an + option to enable/disable data points in charts. + 2010-01-20 Sascha L. Teichmann * doc/conf/conf.xml: Set number of per axis samples to 1024 diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml --- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml Wed Jan 20 15:17:35 2010 +0000 @@ -222,6 +222,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml Wed Jan 20 15:17:35 2010 +0000 @@ -201,6 +201,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml --- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml Wed Jan 20 15:17:35 2010 +0000 @@ -168,6 +168,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml Wed Jan 20 15:17:35 2010 +0000 @@ -183,6 +183,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml --- a/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml Wed Jan 20 15:17:35 2010 +0000 @@ -194,6 +194,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml Wed Jan 20 15:17:35 2010 +0000 @@ -146,6 +146,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml --- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml Wed Jan 20 15:17:35 2010 +0000 @@ -91,6 +91,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml Wed Jan 20 15:17:35 2010 +0000 @@ -205,6 +205,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml --- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml Wed Jan 20 15:17:35 2010 +0000 @@ -165,6 +165,7 @@ + diff -r 70adafe2b9d5 -r fec85cd01497 gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Wed Jan 20 14:47:30 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Wed Jan 20 15:17:35 2010 +0000 @@ -207,27 +207,40 @@ CallMeta callMeta = callContext.getMeta(); + int chartWidth = 600; + int chartHeight = 400; + boolean sVisible = false; + + // lines are always visible. if lines should be configurable we need a + // parameter in the user interface + boolean lVisible = true; + + try { + if (inputData != null) { + Iterator it = inputData.iterator(); + while (it.hasNext()) { + InputData ip = it.next(); + String optionName = ip.getName().trim(); + + if (optionName.equals("width")) { + chartWidth = Integer.parseInt(ip.getValue()); + } + else if (optionName.equals("height")) { + chartHeight = Integer.parseInt(ip.getValue()); + } + else if (optionName.equals("points")) { + sVisible = Boolean.parseBoolean(ip.getValue()); + } + } + } + } catch (NumberFormatException e) { + log.error(e, e); + throw new StateException(e); + } + try { if (outputMode.equalsIgnoreCase("chart")) { log.debug("Chart will be generated."); - int chartWidth = 600; - int chartHeight = 400; - try { - if (inputData != null) { - Iterator it = inputData.iterator(); - while (it.hasNext()) { - InputData ip = it.next(); - if (ip.getName().equalsIgnoreCase("width")) { - chartWidth = Integer.parseInt(ip.getValue()); - } else if (ip.getName().equalsIgnoreCase("height")) { - chartHeight = Integer.parseInt(ip.getValue()); - } - } - } - } catch (NumberFormatException e) { - log.error(e, e); - throw new StateException(e); - } PreferredLocale[] locales = callMeta.getLanguages(); Locale[] serverLocales = @@ -248,10 +261,6 @@ String exportFormat = getExportFormat(mimeType); - // TODO Remove this and parse input data - boolean linesVisible = true; - boolean shapesVisible = true; - this.createChart( outputStream, parameters, @@ -264,8 +273,8 @@ locale, chartWidth, chartHeight, - linesVisible, - shapesVisible, + lVisible, + sVisible, callContext ); } @@ -277,10 +286,6 @@ Locale locale = callMeta.getPreferredLocale(serverLocales); - // TODO Remove this and parse input data - boolean linesVisible = true; - boolean shapesVisible = true; - log.debug( "Best locale - regarding intersection of server and " + "browser locales - is " + locale.toString() @@ -303,20 +308,14 @@ uuid, "A4", true, - linesVisible, - shapesVisible, + lVisible, + sVisible, locale, callContext ); } else if (outputMode.equalsIgnoreCase("svg")) { log.debug("Output mode == svg"); - int width = 600; - int height = 400; - - // TODO Remove this and parse input data - boolean linesVisible = true; - boolean shapesVisible = true; Locale[] serverLocales = RessourceFactory.getInstance().getLocales(); @@ -344,10 +343,10 @@ ), uuid, locale, - width, - height, - linesVisible, - shapesVisible, + chartWidth, + chartHeight, + lVisible, + sVisible, callContext ); } @@ -392,7 +391,6 @@ XMLUtils.toStream(doc, outputStream); } else if (outputMode.equalsIgnoreCase("odv")) { - Collection odvResult = this.getODVResult(uuid); this.createODV(outputStream, odvResult); }