diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java @ 1729:2e5ebdeb8af9

Give StaticWKmsArtifacts proper names, and pre-deselect them. flys-artifacts/trunk@3013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 18 Oct 2011 15:00:43 +0000
parents e3b9164a85fe
children f7d890f4855f
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Oct 18 14:25:50 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Oct 18 15:00:43 2011 +0000
@@ -92,21 +92,28 @@
 
             if (parts.length >= 4) {
                 try {
-                    Integer.valueOf(parts[2]);
-                    Integer.valueOf(parts[3]);
+                    int col = Integer.valueOf(parts[2]);
+                    int wst = Integer.valueOf(parts[3]);
+
                     addStringData("col_pos", parts[2]);
                     addStringData("wst_id",  parts[3]);
+
+                    String wkmsName = WKmsFactory.getWKmsName(col, wst);
+
+                    Facet facet = new WKmsFacet(
+                        Resources.getMsg(
+                            callMeta,
+                            wkmsName,
+                            wkmsName));
+
+                    fs.add(facet);
+                    facets.put(state.getID(), fs);
+
                 }
                 catch (Exception e) {}
             }
         }
 
-        Facet facet = new WKmsFacet(Resources.getMsg(callMeta,
-                   "facet.discharge_curves.mainvalues.w",
-                   "facet.discharge_curves.mainvalues.w"));
-        fs.add(facet);
-        facets.put(state.getID(), fs);
-
         spawnState();
         super.setup(identifier, factory, context, callMeta, data);
     }
@@ -205,5 +212,21 @@
             Integer.valueOf(getDataAsString("col_pos")),
             Integer.valueOf(getDataAsString("wst_id")));
     }
+
+
+    /**
+     * Determines Facets initial disposition regarding activity (think of
+     * selection in Client ThemeList GUI). This will be checked one time
+     * when the facet enters a collections describe document.
+     *
+     * @param facetName name of the facet.
+     * @param index     index of the facet.
+     *
+     * @return Always 0. Static Data will enter plots inactive.
+     */
+    public int getInitialFacetActivity(String facetName, int index) {
+        return 0;
+    }
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org