changeset 2520:fe67f1345687

Added a MINFOArtifact and improved the DistancePanel. flys-client/trunk@4399 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 14 May 2012 10:29:05 +0000 (2012-05-14)
parents 427df4e81af0
children fe177e7f61d1
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java flys-client/src/main/java/de/intevation/flys/client/server/FLYSArtifactCreator.java flys-client/src/main/java/de/intevation/flys/client/shared/model/MINFOArtifact.java
diffstat 4 files changed, 58 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon May 14 09:52:04 2012 +0000
+++ b/flys-client/ChangeLog	Mon May 14 10:29:05 2012 +0000
@@ -1,3 +1,15 @@
+2012-05-14  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/MINFOArtifact.java:
+	  New Artifact that is used for the MINFO module.
+
+	* src/main/java/de/intevation/flys/client/server/FLYSArtifactCreator.java:
+	  Create new MINFO Artifacts if the Artifact's name is "minfo".
+
+	* src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java:
+	  Use ArtifactDescription.getRiver() to retrieve the name of the selected
+	  river.
+
 2012-05-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java	Mon May 14 09:52:04 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java	Mon May 14 10:29:05 2012 +0000
@@ -637,26 +637,7 @@
 
     protected String getRiverName() {
         ArtifactDescription adescr = artifact.getArtifactDescription();
-        DataList[] data = adescr.getOldData();
-
-        if (data != null && data.length > 0) {
-            for (int i = 0; i < data.length; i++) {
-                DataList dl = data[i];
-
-                if (dl.getState().equals("state.winfo.river")) {
-                    for (int j = 0; j < dl.size(); j++) {
-                        Data d = dl.get(j);
-                        DataItem[] di = d.getItems();
-
-                        if (di != null && di.length == 1) {
-                           return d.getItems()[0].getStringValue();
-                        }
-                    }
-                }
-            }
-        }
-
-        return null;
+        return adescr.getRiver();
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/server/FLYSArtifactCreator.java	Mon May 14 09:52:04 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/FLYSArtifactCreator.java	Mon May 14 10:29:05 2012 +0000
@@ -19,6 +19,7 @@
 import de.intevation.flys.client.shared.model.Artifact;
 import de.intevation.flys.client.shared.model.CalculationMessage;
 import de.intevation.flys.client.shared.model.DefaultArtifact;
+import de.intevation.flys.client.shared.model.MINFOArtifact;
 import de.intevation.flys.client.shared.model.WINFOArtifact;
 import de.intevation.flys.client.shared.model.MapArtifact;
 import de.intevation.flys.client.shared.model.ChartArtifact;
@@ -134,6 +135,10 @@
             logger.debug("+++++ NEW CHART ARTIFACT.");
             return new ChartArtifact(uuid, hash, background, msg);
         }
+        else if (name.length() > 0 && name.equals("minfo")) {
+            logger.debug("+++++ NEW MINFO ARTIFACT.");
+            return new MINFOArtifact(uuid, hash, background, msg);
+        }
 
         return new DefaultArtifact(uuid, hash, background, msg);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/MINFOArtifact.java	Mon May 14 10:29:05 2012 +0000
@@ -0,0 +1,40 @@
+package de.intevation.flys.client.shared.model;
+
+import java.util.List;
+
+
+/**
+ * The WINFO implementation of an Artifact.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class MINFOArtifact extends DefaultArtifact {
+
+    /** The name of this artifact: 'minfo'.*/
+    public static final String NAME = "minfo";
+
+
+    public MINFOArtifact() {
+    }
+
+
+    public  MINFOArtifact(String uuid, String hash) {
+        super(uuid, hash);
+    }
+
+
+    public MINFOArtifact(
+        String                   uuid,
+        String                   hash,
+        boolean                  inBackground,
+        List<CalculationMessage> messages
+    ) {
+        super(uuid, hash, inBackground, messages);
+    }
+
+
+    public String getName() {
+        return NAME;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org