[Dive4elements-commits] [PATCH] GWT client: Display official lines in helper panels
Wald Commits
scm-commit at wald.intevation.org
Wed Jun 19 15:03:14 CEST 2013
# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1371646985 -7200
# Node ID 19459037b3c72c637bae95246f10841da473a250
# Parent 791c7492b4ee9ae038b7549d19d3a0aee7f832e5
GWT client: Display official lines in helper panels.
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Wed Jun 19 15:03:05 2013 +0200
@@ -1301,5 +1301,7 @@
String WATERBODY();
String FEDSTATE_KM();
+
+ String official_regulation();
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Wed Jun 19 15:03:05 2013 +0200
@@ -681,3 +681,5 @@
SOURCE = Source
WATERBODY = Waterbody
FEDSTATE_KM = Station (Federal State)
+
+official_regulation = official Regulation
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Wed Jun 19 15:03:05 2013 +0200
@@ -680,3 +680,4 @@
SOURCE = Quelle
WATERBODY = Gewässer
FEDSTATE_KM = Landes-Stationierung
+official_regulation = amtl. Festlegung
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Wed Jun 19 15:03:05 2013 +0200
@@ -621,4 +621,4 @@
# Get Feature Info Window
PATH = Path
-
+official_regulation = Official Regulation
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java Wed Jun 19 15:03:05 2013 +0200
@@ -66,7 +66,7 @@
ListGridField type = new ListGridField("type", MESSAGE.type());
type.setType(ListGridFieldType.TEXT);
- type.setWidth("20%");
+ type.setWidth("10%");
final NumberFormat nf = NumberFormat.getDecimalFormat();
@@ -88,9 +88,14 @@
}
}
});
- value.setWidth("20%");
+ value.setWidth("15%");
- setFields(addMax, addMin, select, name, type, value);
+ ListGridField official = new ListGridField("official", MESSAGE.official_regulation());
+ official.setType(ListGridFieldType.TEXT);
+ official.setWidth("25%");
+
+
+ setFields(addMax, addMin, select, name, type, value, official);
}
public void hideIconFields () {
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java Wed Jun 19 15:03:05 2013 +0200
@@ -195,12 +195,16 @@
String value = XMLUtils.xpathString(
node, "@value", ArtifactNamespaceContext.INSTANCE);
+ String official = XMLUtils.xpathString(
+ node, "@official", ArtifactNamespaceContext.INSTANCE);
+
if (name != null && type != null) {
try {
return new WQInfoObjectImpl(
name,
type,
- new Double(value));
+ new Double(value),
+ official != null && official.equalsIgnoreCase("true"));
}
catch (NumberFormatException nfe) {
logger.warn(nfe.getLocalizedMessage());
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java Wed Jun 19 15:03:05 2013 +0200
@@ -21,5 +21,7 @@
String getType();
Double getValue();
+
+ boolean isOfficial();
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObjectImpl.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObjectImpl.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObjectImpl.java Wed Jun 19 15:03:05 2013 +0200
@@ -20,6 +20,8 @@
protected Double value;
+ protected boolean isOfficial;
+
public WQInfoObjectImpl() {
}
@@ -28,26 +30,36 @@
public WQInfoObjectImpl(
String name,
String type,
- Double value)
- {
+ Double value,
+ boolean isOfficial
+ ) {
this.name = name;
this.type = type;
this.value = value;
+ this.isOfficial = isOfficial;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public String getType() {
return type;
}
+ @Override
public Double getValue() {
return value;
}
+
+ @Override
+ public boolean isOfficial() {
+ return isOfficial;
+ }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 791c7492b4ee -r 19459037b3c7 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoRecord.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoRecord.java Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoRecord.java Wed Jun 19 15:03:05 2013 +0200
@@ -33,10 +33,8 @@
setName(info.getName());
setType(info.getType());
- if (info.getValue() != null)
- setValue(info.getValue());
- else
- setValue(info.getValue());
+ setValue(info.getValue());
+ setOfficial(info.isOfficial() ? "X" : "");
}
@@ -68,6 +66,14 @@
return getAttributeAsDouble("value");
}
+ public void setOfficial(String value) {
+ setAttribute("official", value);
+ }
+
+ public String getOfficial() {
+ return getAttributeAsString("official");
+ }
+
public WQInfoObject getWQInfo() {
return wqInfo;
More information about the Dive4elements-commits
mailing list