diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SuperVegZonesTablePanel.java @ 9069:1ffd38826175

access uinfo.vegetationzones+inundation_duration
author gernotbelger
date Tue, 15 May 2018 12:00:26 +0200
parents a5cf8d7bff3c
children
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SuperVegZonesTablePanel.java	Mon May 14 18:24:35 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/SuperVegZonesTablePanel.java	Tue May 15 12:00:26 2018 +0200
@@ -34,8 +34,8 @@
  */
 public abstract class SuperVegZonesTablePanel extends AbstractUIProvider {
     private static final long serialVersionUID = 1L;
-    public static final String tableCellSeparator = "tableCellSeparator";
-    public static final String tableRowSeparator = "tableRowSeparator";
+    public static final String TABLE_CELL_SEPARATOR = "TABLE_CELL_SEPARATOR";
+    public static final String TABLE_ROW_SEPARATOR = "TABLE_ROW_SEPARATOR";
 
     protected static final String datakey = "vegzones";
 
@@ -117,9 +117,9 @@
         for (final Data dataItemContainer : data.getAll()) {
             if (dataItemContainer.getItems() != null) {
                 for (final DataItem dataItem : dataItemContainer.getItems()) {
-                    if (dataItem.getStringValue() != null && dataItem.getStringValue().contains(tableRowSeparator)) {
+                    if (dataItem.getStringValue() != null && dataItem.getStringValue().contains(TABLE_ROW_SEPARATOR)) {
 
-                        final String[] rows = dataItem.getStringValue().split(tableRowSeparator);
+                        final String[] rows = dataItem.getStringValue().split(TABLE_ROW_SEPARATOR);
                         for (final String row : rows) {
                             this.elements.addData(createEntry(row));
                         }
@@ -160,9 +160,9 @@
         final Data str = getData(items, datakey);
         final DataItem[] strItems = str.getItems();
 
-        final String[] entries = strItems[0].getLabel().split(VegetationzonesTablePanel.tableRowSeparator);
+        final String[] entries = strItems[0].getLabel().split(VegetationzonesTablePanel.TABLE_ROW_SEPARATOR);
         for (final String entry : entries) {
-            final String[] vals = entry.split(VegetationzonesTablePanel.tableCellSeparator);
+            final String[] vals = entry.split(VegetationzonesTablePanel.TABLE_CELL_SEPARATOR);
             final Label dateLabel = new Label(vals[0] + " (" + vals[1] + "-" + vals[2] + ")");
             dateLabel.setHeight(20);
             vLayout.addMember(dateLabel);
@@ -178,15 +178,16 @@
     protected static final Data[] getDummyData() {
         final List<Data> data = new ArrayList<Data>();
         String d = "";
-        d = d + "Zonaler Wald" + tableCellSeparator + "0" + tableCellSeparator + "5" + tableRowSeparator;
-        d = d + "Hartholzaue, trocken" + tableCellSeparator + "5" + tableCellSeparator + "40" + tableRowSeparator;
-        d = d + "Hartholzaue, feucht" + tableCellSeparator + "40" + tableCellSeparator + "80" + tableRowSeparator;
-        d = d + "Silberweidenwald" + tableCellSeparator + "80" + tableCellSeparator + "140" + tableRowSeparator;
-        d = d + "Weidengebüsch" + tableCellSeparator + "140" + tableCellSeparator + "200" + tableRowSeparator;
-        d = d + "Uferröhricht" + tableCellSeparator + "200" + tableCellSeparator + "260" + tableRowSeparator;
-        d = d + "Uferpioniere" + tableCellSeparator + "260" + tableCellSeparator + "320" + tableRowSeparator;
-        d = d + "Vegetationslos" + tableCellSeparator + "320" + tableCellSeparator + "365" + tableRowSeparator;
-        d = d + "Wasserfläche" + tableCellSeparator + "365" + tableCellSeparator + "365" + tableRowSeparator;
+        // TODO: move to messages
+        d = d + "Zonaler Wald" + TABLE_CELL_SEPARATOR + "0" + TABLE_CELL_SEPARATOR + "5" + TABLE_ROW_SEPARATOR;
+        d = d + "Hartholzaue, trocken" + TABLE_CELL_SEPARATOR + "5" + TABLE_CELL_SEPARATOR + "40" + TABLE_ROW_SEPARATOR;
+        d = d + "Hartholzaue, feucht" + TABLE_CELL_SEPARATOR + "40" + TABLE_CELL_SEPARATOR + "80" + TABLE_ROW_SEPARATOR;
+        d = d + "Silberweidenwald" + TABLE_CELL_SEPARATOR + "80" + TABLE_CELL_SEPARATOR + "140" + TABLE_ROW_SEPARATOR;
+        d = d + "Weidengebüsch" + TABLE_CELL_SEPARATOR + "140" + TABLE_CELL_SEPARATOR + "200" + TABLE_ROW_SEPARATOR;
+        d = d + "Uferröhricht" + TABLE_CELL_SEPARATOR + "200" + TABLE_CELL_SEPARATOR + "260" + TABLE_ROW_SEPARATOR;
+        d = d + "Uferpioniere" + TABLE_CELL_SEPARATOR + "260" + TABLE_CELL_SEPARATOR + "320" + TABLE_ROW_SEPARATOR;
+        d = d + "Vegetationslos" + TABLE_CELL_SEPARATOR + "320" + TABLE_CELL_SEPARATOR + "365" + TABLE_ROW_SEPARATOR;
+        d = d + "Wasserfläche" + TABLE_CELL_SEPARATOR + "365" + TABLE_CELL_SEPARATOR + "365" + TABLE_ROW_SEPARATOR;
 
         final DataItem item = new DefaultDataItem(datakey, "entryDescription", d); // DATA-key
         data.add(new DefaultData(datakey, null, null, new DataItem[] { item }));
@@ -204,9 +205,9 @@
         String d = "";
         for (final ListGridRecord element : lgr) {
             final Record r = element;
-            d += r.getAttribute("vegzone") + VegetationzonesTablePanel.tableCellSeparator + r.getAttribute("from")
-                    + VegetationzonesTablePanel.tableCellSeparator + r.getAttribute("to");
-            d += VegetationzonesTablePanel.tableRowSeparator;
+            d += r.getAttribute("vegzone") + VegetationzonesTablePanel.TABLE_CELL_SEPARATOR + r.getAttribute("from")
+                    + VegetationzonesTablePanel.TABLE_CELL_SEPARATOR + r.getAttribute("to");
+            d += VegetationzonesTablePanel.TABLE_ROW_SEPARATOR;
         }
 
         final DataItem item = new DefaultDataItem(datakey, null, d); // DATA-key
@@ -216,9 +217,9 @@
 
     public final ListGridRecord createEntry(final String row) {
 
-        if (row.contains(tableCellSeparator)) {
+        if (row.contains(TABLE_CELL_SEPARATOR)) {
 
-            final String[] vals = row.split(tableCellSeparator);
+            final String[] vals = row.split(TABLE_CELL_SEPARATOR);
             if (vals.length == 3) {
                 final String vegzone = vals[0];
                 final String from = vals[1];

http://dive4elements.wald.intevation.org