[Dive4elements-commits] [PATCH 3 of 3] Merged
Wald Commits
scm-commit at wald.intevation.org
Mon Oct 29 11:17:16 CET 2012
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1351506116 -3600
# Node ID 2a64d42a75e62b74faf696ad95aa9a0d37b37c33
# Parent 22f03e7b0ed104788379e842a26b844336b37c10
# Parent 250c4a0fa69647a15ea27750e50cd1007db10358
Merged
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/doc/conf/default-themes.xml
--- a/flys-artifacts/doc/conf/default-themes.xml Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/doc/conf/default-themes.xml Mon Oct 29 11:21:56 2012 +0100
@@ -81,7 +81,7 @@
<theme name="HistoricalDischargeWQCurve">
<inherits>
- <inherit from="DischargeCurve" />
+ <inherit from="HiddenColorLines" />
</inherits>
<fields>
<field name="linecolor" type="Color" display="Linienfarbe"
@@ -89,6 +89,76 @@
</fields>
</theme>
+ <theme name="HistoricalDischargeWQW">
+ <inherits>
+ <inherit from="HiddenColorLines" />
+ </inherits>
+ <fields>
+ <field name="linecolor" type="Color" display="Linienfarbe"
+ default="#0000FF" />
+ <field name="linesize" type="int" display="Liniendicke"
+ default="1" hidden="true" />
+ <field name="linetype" type="Dash" display="Linienart"
+ default="10" hidden="true" />
+ <field name="showlines" type="boolean" display="Linie anzeigen"
+ default="true" hidden="true" />
+ <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+ default="false" hidden="true" />
+ <field name="pointsize" type="int" display="Punktdicke"
+ default="5" hidden="true" />
+ <field name="showlinelabel" type="boolean"
+ display="Beschriftung anzeigen" default="false" hidden="true" />
+ <field name="labelfontface" type="Font"
+ display="Beschriftung: Schriftart" default="arial" hidden="true"/>
+ <field name="labelfontcolor" type="Color"
+ display="Beschriftung: Schriftfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelfontsize" type="int"
+ display="Beschriftung: Schriftgröße" default="10" hidden="true" />
+ <field name="labelfontstyle" type="Style"
+ display="Beschriftung: Schriftstil" default="standard" hidden="true" />
+ <field name="labelbgcolor" type="Color"
+ display="Beschriftung: Hintergrundfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelshowbg" type="boolean"
+ display="Beschriftung: Hintergrund füllen" default="false" hidden="true" />
+
+ </fields>
+ </theme>
+
+ <theme name="HistoricalDischargeWQQ">
+ <inherits>
+ <inherit from="HiddenColorLines" />
+ </inherits>
+ <fields>
+ <field name="linecolor" type="Color" display="Linienfarbe"
+ default="204, 204, 204" />
+ <field name="linesize" type="int" display="Liniendicke"
+ default="1" hidden="true" />
+ <field name="linetype" type="Dash" display="Linienart"
+ default="10" hidden="true" />
+ <field name="showlines" type="boolean" display="Linie anzeigen"
+ default="true" hidden="true" />
+ <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+ default="false" hidden="true" />
+ <field name="pointsize" type="int" display="Punktdicke"
+ default="5" hidden="true" />
+ <field name="showlinelabel" type="boolean"
+ display="Beschriftung anzeigen" default="false" hidden="true" />
+ <field name="labelfontface" type="Font"
+ display="Beschriftung: Schriftart" default="arial" hidden="true"/>
+ <field name="labelfontcolor" type="Color"
+ display="Beschriftung: Schriftfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelfontsize" type="int"
+ display="Beschriftung: Schriftgröße" default="10" hidden="true" />
+ <field name="labelfontstyle" type="Style"
+ display="Beschriftung: Schriftstil" default="standard" hidden="true" />
+ <field name="labelbgcolor" type="Color"
+ display="Beschriftung: Hintergrundfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelshowbg" type="boolean"
+ display="Beschriftung: Hintergrund füllen" default="false" hidden="true" />
+
+ </fields>
+ </theme>
+
<!-- Discharge Longitudinal Section -->
<theme name="LongitudinalSectionW">
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/doc/conf/second-themes.xml
--- a/flys-artifacts/doc/conf/second-themes.xml Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/doc/conf/second-themes.xml Mon Oct 29 11:21:56 2012 +0100
@@ -72,6 +72,75 @@
</inherits>
</theme>
+ <theme name="HistoricalDischargeWQW">
+ <inherits>
+ <inherit from="DischargeCurve" />
+ </inherits>
+ <fields>
+ <field name="linecolor" type="Color" display="Linienfarbe"
+ default="204, 204, 204" />
+ <field name="linesize" type="int" display="Liniendicke"
+ default="1" hidden="true" />
+ <field name="linetype" type="Dash" display="Linienart"
+ default="10" hidden="true" />
+ <field name="showlines" type="boolean" display="Linie anzeigen"
+ default="true" hidden="true" />
+ <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+ default="false" hidden="true" />
+ <field name="pointsize" type="int" display="Punktdicke"
+ default="5" hidden="true" />
+ <field name="showlinelabel" type="boolean"
+ display="Beschriftung anzeigen" default="false" hidden="true" />
+ <field name="labelfontface" type="Font"
+ display="Beschriftung: Schriftart" default="arial" hidden="true"/>
+ <field name="labelfontcolor" type="Color"
+ display="Beschriftung: Schriftfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelfontsize" type="int"
+ display="Beschriftung: Schriftgröße" default="10" hidden="true" />
+ <field name="labelfontstyle" type="Style"
+ display="Beschriftung: Schriftstil" default="standard" hidden="true" />
+ <field name="labelbgcolor" type="Color"
+ display="Beschriftung: Hintergrundfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelshowbg" type="boolean"
+ display="Beschriftung: Hintergrund füllen" default="false" hidden="true" />
+
+ </fields>
+ </theme>
+
+ <theme name="HistoricalDischargeWQQ">
+ <inherits>
+ <inherit from="DischargeCurve" />
+ </inherits>
+ <fields>
+ <field name="linecolor" type="Color" display="Linienfarbe"
+ default="104, 104, 104" />
+ <field name="linesize" type="int" display="Liniendicke"
+ default="1" hidden="true" />
+ <field name="linetype" type="Dash" display="Linienart"
+ default="10" hidden="true" />
+ <field name="showlines" type="boolean" display="Linie anzeigen"
+ default="true" hidden="true" />
+ <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+ default="false" hidden="true" />
+ <field name="pointsize" type="int" display="Punktdicke"
+ default="5" hidden="true" />
+ <field name="showlinelabel" type="boolean"
+ display="Beschriftung anzeigen" default="false" hidden="true" />
+ <field name="labelfontface" type="Font"
+ display="Beschriftung: Schriftart" default="arial" hidden="true"/>
+ <field name="labelfontcolor" type="Color"
+ display="Beschriftung: Schriftfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelfontsize" type="int"
+ display="Beschriftung: Schriftgröße" default="10" hidden="true" />
+ <field name="labelfontstyle" type="Style"
+ display="Beschriftung: Schriftstil" default="standard" hidden="true" />
+ <field name="labelbgcolor" type="Color"
+ display="Beschriftung: Hintergrundfarbe" default="0, 0, 0" hidden="true" />
+ <field name="labelshowbg" type="boolean"
+ display="Beschriftung: Hintergrund füllen" default="false" hidden="true" />
+
+ </fields>
+ </theme>
<!-- Discharge Longitudinal Section -->
<theme name="LongitudinalSectionW">
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/doc/conf/themes.xml
--- a/flys-artifacts/doc/conf/themes.xml Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/doc/conf/themes.xml Mon Oct 29 11:21:56 2012 +0100
@@ -133,6 +133,8 @@
<mapping from="historical_discharge.historicalw" to="HistoricalDischargeCurveW" />
<mapping from="historical_discharge.historicalw.diff" to="HistoricalDischargeCurveWDiff" />
<mapping from="historical_discharge.wq.curve" to="HistoricalDischargeWQCurve" />
+ <mapping from="historical_discharge.wq.w" to="HistoricalDischargeWQW" />
+ <mapping from="historical_discharge.wq.q" to="HistoricalDischargeWQQ" />
<mapping from="cross_section" to="CrossSection" />
<mapping from="cross_section_water_line" to="CrossSectionWaterLine" />
<mapping from="computed_discharge_curve.q" to="ComputedDischargeCurve" />
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java Mon Oct 29 11:21:56 2012 +0100
@@ -169,7 +169,7 @@
double[] kms = new double[values[0].length];
Arrays.fill(kms, km);
- return new HistoricalWQKms(kms, values[1], values[0],
+ return new HistoricalWQKms(kms, values[0], values[1],
String.valueOf(km), dt.getTimeInterval());
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java Mon Oct 29 11:21:56 2012 +0100
@@ -1,7 +1,10 @@
package de.intevation.flys.artifacts.services;
import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.util.Date;
import java.util.List;
+import java.util.Locale;
import org.apache.log4j.Logger;
@@ -17,6 +20,7 @@
import de.intevation.flys.model.MeasurementStation;
import de.intevation.flys.model.Range;
import de.intevation.flys.model.River;
+import de.intevation.flys.model.TimeInterval;
/**
* @author <a href="mailto:bjoern.ricks at intevation.de">Björn Ricks</a>
@@ -26,6 +30,9 @@
private static final Logger logger = Logger.getLogger(
MeasurementStationInfoService.class);
+ public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance(
+ DateFormat.SHORT, Locale.GERMANY);
+
@Override
public Document doProcess(
Document data,
@@ -88,6 +95,20 @@
ec.addAttr(eg, "operator", moperator, true);
}
+ TimeInterval tinterval = mstation.getObservationTimerange();
+ if (tinterval != null) {
+ Date tstart = tinterval.getStartTime();
+ if (tstart != null) {
+ ec.addAttr(eg, "starttime", DATE_FORMAT.format(tstart),
+ true);
+ }
+ Date tstop = tinterval.getStopTime();
+ if (tstop != null) {
+ ec.addAttr(eg, "stoptime", DATE_FORMAT.format(tstop),
+ true);
+ }
+ }
+
egs.appendChild(eg);
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeWQCurveGenerator.java Mon Oct 29 11:21:56 2012 +0100
@@ -10,6 +10,7 @@
import de.intevation.flys.artifacts.model.FacetTypes;
import de.intevation.flys.artifacts.model.Timerange;
import de.intevation.flys.artifacts.model.WQKms;
+import de.intevation.flys.jfree.StyledValueMarker;
import de.intevation.flys.jfree.StyledXYSeries;
import de.intevation.flys.utils.FLYSUtils;
@@ -128,16 +129,14 @@
protected void doHistoricalDischargeOutQ(FLYSArtifact artifact,
Object data, String desc, Document theme, boolean visible) {
- logger.debug("doHistoricalDischargeOutQ(): description = " + desc);
-
- // addAxisDataset(series, YAXIS.Q.idx, visible);
+ double value = Double.valueOf(data.toString());
+ addDomainMarker(new StyledValueMarker(value, theme), visible);
}
protected void doHistoricalDischargeOutW(FLYSArtifact artifact,
Object data, String desc, Document theme, boolean visible) {
- logger.debug("doHistoricalDischargeOutW(): description = " + desc);
-
- // addAxisDataset(series, YAXIS.W.idx, visible);
+ double value = Double.valueOf(data.toString());
+ addValueMarker(new StyledValueMarker(value, theme), visible);
}
protected void doHistoricalDischargeCurveOut(FLYSArtifact artifact,
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Oct 29 11:21:56 2012 +0100
@@ -503,11 +503,20 @@
* Add the given vertical marker to the chart.
*/
public void addDomainMarker(Marker marker) {
- if (marker == null) {
- return;
+ addDomainMarker(marker, true);
+ }
+
+
+ /**
+ * Add the given vertical marker to the chart.<b>Note:</b> the marker is
+ * added to the chart only if it is not null and if <i>visible</i> is true.
+ * @param marker The marker that should be added to the chart.
+ * @param visible The visibility of the marker.
+ */
+ public void addDomainMarker(Marker marker, boolean visible) {
+ if (visible && marker != null) {
+ domainMarkers.add(marker);
}
-
- domainMarkers.add(marker);
}
@@ -515,11 +524,20 @@
* Add the given vertical marker to the chart.
*/
public void addValueMarker(Marker marker) {
- if (marker == null) {
- return;
+ addValueMarker(marker, true);
+ }
+
+
+ /**
+ * Add the given horizontal marker to the chart.<b>Note:</b> the marker is
+ * added to the chart only if it is not null and if <i>visible</i> is true.
+ * @param marker The marker that should be added to the chart.
+ * @param visible The visibility of the marker.
+ */
+ public void addValueMarker(Marker marker, boolean visible) {
+ if (visible && marker != null) {
+ valueMarkers.add(marker);
}
-
- valueMarkers.add(marker);
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java Mon Oct 29 11:21:56 2012 +0100
@@ -19,7 +19,7 @@
public StyledValueMarker(double value, Document theme) {
super(value);
- Color color = ThemeUtil.parsePointColor(theme);
+ Color color = ThemeUtil.parseLineColorField(theme);
if(color == null) {
color = Color.BLACK;
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java Mon Oct 29 11:21:56 2012 +0100
@@ -592,7 +592,7 @@
String lineColorStr = getLineColorString(theme);
logger.debug("parseLineColorField: lineColorStr = " +
(lineColorStr == null ? "null" : lineColorStr));
- return parseRGB(lineColorStr);
+ return parseColor(lineColorStr);
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java Mon Oct 29 11:21:56 2012 +0100
@@ -110,13 +110,18 @@
}
public void createWSPLGENFacet() {
+ String river = getRiver();
+ double kms[] = FLYSUtils.getKmRange(artifact);
+
WSPLGENLayerFacet wsplgen = new WSPLGENLayerFacet(
0,
FLOODMAP_WSPLGEN,
- Resources.getMsg(
+ Resources.format(
cc.getMeta(),
I18N_WSPLGEN_RESULT,
- I18N_WSPLGEN_DEFAULT),
+ I18N_WSPLGEN_DEFAULT,
+ river,
+ kms[0], kms[1]),
ComputeType.ADVANCE,
stateId,
hash,
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/resources/messages.properties
--- a/flys-artifacts/src/main/resources/messages.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/resources/messages.properties Mon Oct 29 11:21:56 2012 +0100
@@ -346,7 +346,7 @@
floodmap.wmsbackground = Background Map
floodmap.riveraxis = River Axis
-floodmap.uesk = Floodmap
+floodmap.uesk = Floodmap: {0}-km {1,number,####} - {2,number,####}
floodmap.barriers = Digitized Objects
floodmap.kms = Kilometrage
floodmap.qps = Crosssection Tracks
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/resources/messages_de.properties
--- a/flys-artifacts/src/main/resources/messages_de.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/resources/messages_de.properties Mon Oct 29 11:21:56 2012 +0100
@@ -346,7 +346,7 @@
floodmap.wmsbackground = Hintergrundkarte
floodmap.riveraxis = Flussachse
-floodmap.uesk = \u00dcberschwemmungsfl\u00e4che
+floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####}
floodmap.barriers = Digitalisierte Objekte
floodmap.kms = Kilometrierung
floodmap.qps = Querprofilspuren
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/resources/messages_de_DE.properties
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties Mon Oct 29 11:21:56 2012 +0100
@@ -343,7 +343,7 @@
floodmap.wmsbackground = Hintergrundkarte
floodmap.riveraxis = Flussachse
-floodmap.uesk = \u00dcberschwemmungsfl\u00e4che
+floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####}
floodmap.barriers = Digitalisierte Objekte
floodmap.kms = Kilometrierung
floodmap.qps = Querprofilspuren
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-artifacts/src/main/resources/messages_en.properties
--- a/flys-artifacts/src/main/resources/messages_en.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-artifacts/src/main/resources/messages_en.properties Mon Oct 29 11:21:56 2012 +0100
@@ -347,7 +347,7 @@
floodmap.wmsbackground = Background Map
floodmap.riveraxis = River Axis
-floodmap.uesk = Floodmap
+floodmap.uesk = Floodmap: {0}-km {1,number,####} - {2,number,####}
floodmap.barriers = Digitized Objects
floodmap.kms = Kilometrage
floodmap.qps = Crosssection Tracks
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Oct 29 11:21:56 2012 +0100
@@ -1070,6 +1070,12 @@
String measurement_station_operator();
+ String measurement_station_start_time();
+
+ String measurement_station_url();
+
+ String measurement_station_info_link();
+
String discharge_timeranges();
String discharge_chart();
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Oct 29 11:21:56 2012 +0100
@@ -558,3 +558,6 @@
measurement_station_type = Type of Measurement Station
measurement_station_operator = Operator
+measurement_station_start_time = Observation Start Time
+measurement_station_url = https://flys-intern.intevation.de/MessstellenInfo/
+measurement_station_info_link = Measurement Station Info
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Oct 29 11:21:56 2012 +0100
@@ -556,3 +556,6 @@
measurement_station_type = Typ der Messstelle
measurement_station_operator = Operator
+measurement_station_start_time = Beobachtungsstart
+measurement_station_url = https://flys-intern.intevation.de/MessstellenInfo/
+measurement_station_info_link = Messstelleninfo
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Oct 29 11:21:56 2012 +0100
@@ -557,3 +557,6 @@
measurement_station_type = Type of Measurement Station
measurement_station_operator = Operator
+measurement_station_start_time = Observation Start Time
+measurement_station_url = https://flys-intern.intevation.de/MessstellenInfo/
+measurement_station_info_link = Measurement Station Info
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationTree.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationTree.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MeasurementStationTree.java Mon Oct 29 11:21:56 2012 +0100
@@ -1,8 +1,11 @@
package de.intevation.flys.client.client.ui;
+import java.util.Date;
+
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.DecoratorPanel;
@@ -160,12 +163,13 @@
addMember(label);
}
- /* Long number = gauge.getOfficialNumber(); */
- /* String url = number != null ? */
- /* MSG.gauge_url() + number : */
- /* MSG.gauge_url(); */
- /* Anchor anchor = new Anchor(MSG.gauge_info_link(), url, "_blank"); */
- /* addMember(anchor); */
+ Integer number = station.getID();
+ String url = number != null ?
+ MSG.measurement_station_url() + number :
+ MSG.measurement_station_url();
+ Anchor anchor = new Anchor(MSG.measurement_station_info_link(),
+ url, "_blank");
+ addMember(anchor);
}
}
@@ -195,6 +199,14 @@
grid.setText(2, 1, moperator);
}
+ DateTimeFormat df = DateTimeFormat.getMediumDateFormat();
+
+ Date starttime = station.getStartTime();
+ if (starttime != null) {
+ grid.setText(3, 0, MSG.measurement_station_start_time());
+ grid.setText(3, 1, df.format(starttime));
+ }
+
setWidget(grid);
}
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Mon Oct 29 11:21:56 2012 +0100
@@ -981,7 +981,10 @@
private void removeInfoPanel() {
GWT.log("ParameterList - removeInfoPanel");
- stack.removeSection(InfoPanel.SECTION_ID);
+ SectionStackSection exists = stack.getSection(InfoPanel.SECTION_ID);
+ if (exists != null) {
+ stack.removeSection(InfoPanel.SECTION_ID);
+ }
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java Mon Oct 29 11:21:56 2012 +0100
@@ -191,6 +191,7 @@
field.setAttribute("default", set.getDefaultValue());
field.setAttribute("hints", set.getHints());
field.setAttribute("type", set.getType());
+ field.setAttribute("hidden", String.valueOf(set.isHidden()));
theme.appendChild(field);
}
themes.appendChild(theme);
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/server/RiverInfoServiceImpl.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/RiverInfoServiceImpl.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/RiverInfoServiceImpl.java Mon Oct 29 11:21:56 2012 +0100
@@ -1,7 +1,11 @@
package de.intevation.flys.client.server;
+import java.text.DateFormat;
+import java.text.ParseException;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import java.util.Locale;
import javax.xml.xpath.XPathConstants;
import org.apache.log4j.Logger;
@@ -47,6 +51,9 @@
private static final String XPATH_GAUGES = "/art:river-info/art:gauges/art:gauge";
+ public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance(
+ DateFormat.SHORT, Locale.GERMANY);
+
public RiverInfo getGauges(String river) throws ServerException {
logger.info("RiverInfoServiceImpl.getRiverInfo");
@@ -170,6 +177,19 @@
}
}
+ private Date parseDate(String value) {
+ if (value == null || value.isEmpty()) {
+ return null;
+ }
+ try {
+ return DATE_FORMAT.parse(value);
+ }
+ catch(ParseException e) {
+ logger.error(e, e);
+ return null;
+ }
+ }
+
private List<MeasurementStation> createMeasurementStations(
Document result, String rivername, boolean kmup) {
@@ -208,6 +228,10 @@
ArtifactNamespaceContext.NAMESPACE_URI, "id");
String moperator = stationele.getAttributeNS(
ArtifactNamespaceContext.NAMESPACE_URI, "operator");
+ String mstarttime = stationele.getAttributeNS(
+ ArtifactNamespaceContext.NAMESPACE_URI, "starttime");
+ String mstoptime = stationele.getAttributeNS(
+ ArtifactNamespaceContext.NAMESPACE_URI, "stoptime");
logger.debug("Found measurement station with name " + mname);
@@ -221,7 +245,9 @@
kmup,
riverside,
mtype,
- moperator
+ moperator,
+ parseDate(mstarttime),
+ parseDate(mstoptime)
);
mstations.add(station);
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultMeasurementStation.java
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultMeasurementStation.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultMeasurementStation.java Mon Oct 29 11:21:56 2012 +0100
@@ -1,5 +1,7 @@
package de.intevation.flys.client.shared.model;
+import java.util.Date;
+
/**
* @author <a href="mailto:bjoern.ricks at intevation.de">Björn Ricks</a>
*/
@@ -15,6 +17,8 @@
private Integer id;
private boolean kmup;
private String moperator;
+ private Date starttime;
+ private Date stoptime;
public DefaultMeasurementStation() {
}
@@ -29,7 +33,9 @@
boolean kmup,
String riverside,
String measurementtype,
- String moperator)
+ String moperator,
+ Date starttime,
+ Date stoptime)
{
this.rivername = rivername;
this.name = name;
@@ -41,6 +47,8 @@
this.id = id;
this.kmup = kmup;
this.moperator = moperator;
+ this.starttime = starttime;
+ this.stoptime = stoptime;
}
/**
@@ -120,4 +128,21 @@
public String getOperator() {
return this.moperator;
}
+
+ /**
+ * Returns the start time of the observation at this measurement station
+ */
+ @Override
+ public Date getStartTime() {
+ return this.starttime;
+ }
+
+ /**
+ * Returns the end time of the observation at this measurement station
+ */
+ @Override
+ public Date getStopTime() {
+ return this.stoptime;
+ }
+
}
diff -r 22f03e7b0ed1 -r 2a64d42a75e6 flys-client/src/main/java/de/intevation/flys/client/shared/model/MeasurementStation.java
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/MeasurementStation.java Mon Oct 29 11:21:05 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/MeasurementStation.java Mon Oct 29 11:21:56 2012 +0100
@@ -1,6 +1,7 @@
package de.intevation.flys.client.shared.model;
import java.io.Serializable;
+import java.util.Date;
/**
* @author <a href="mailto:bjoern.ricks at intevation.de">Björn Ricks</a>
@@ -54,4 +55,14 @@
* Returns the operator of the measurement station
*/
String getOperator();
+
+ /**
+ * Returns the start time of the observation at this measurement station
+ */
+ Date getStartTime();
+
+ /**
+ * Returns the end time of the observation at this measurement station
+ */
+ Date getStopTime();
}
More information about the Dive4elements-commits
mailing list