changeset 3878:2e9c6855a1e8

A and B facets of fix analyis are now deactivated by default flys-artifacts/trunk@5513 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Tue, 18 Sep 2012 21:38:19 +0000
parents 00abcd3737f9
children ac49675f9335
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java
diffstat 3 files changed, 43 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 18 18:36:52 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 18 21:38:19 2012 +0000
@@ -1,3 +1,11 @@
+2012-09-18	Christian Lins	<christian.lins@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java:
+	  Cosmetics.
+
+	* src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java:
+	  A and B facets of fix analysis are now deactivated by default (#717).
+
 2012-09-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/extreme/ExtremeCalculation.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java	Tue Sep 18 18:36:52 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixAnalysisCompute.java	Tue Sep 18 21:38:19 2012 +0000
@@ -7,6 +7,8 @@
 import org.apache.log4j.Logger;
 
 import de.intevation.artifactdatabase.state.Facet;
+import de.intevation.artifactdatabase.state.FacetActivity;
+import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.access.FixAnalysisAccess;
@@ -64,6 +66,34 @@
         "[HQ5 - \u221e)"
     };
 
+    static {
+        // Active/deactivate facets.
+        FacetActivity.Registry.getInstance().register(
+            "fixanalysis",
+            new FacetActivity() {
+                @Override
+                public Boolean isInitialActive(
+                    Artifact artifact,
+                    Facet    facet,
+                    String   output
+                ) {
+                    String name = facet.getName();
+
+                    if (name.contains(FacetTypes.FIX_ANALYSIS_EVENTS_DWT)
+                     || name.contains(FacetTypes.FIX_ANALYSIS_EVENTS_LS)
+                     || name.contains(FacetTypes.FIX_ANALYSIS_EVENTS_WQ)
+                     || name.contains(FacetTypes.FIX_REFERENCE_EVENTS_DWT)
+                     || name.contains(FacetTypes.FIX_REFERENCE_EVENTS_LS)
+                     || name.contains(FacetTypes.FIX_REFERENCE_EVENTS_WQ)
+                    ) {
+                        return Boolean.FALSE;
+                    }
+
+                    return Boolean.TRUE;
+                }
+            });
+    }
+
     /**
      * The default constructor that initializes an empty State object.
      */
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java	Tue Sep 18 18:36:52 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java	Tue Sep 18 21:38:19 2012 +0000
@@ -4,17 +4,14 @@
 import java.util.Iterator;
 
 import org.apache.log4j.Logger;
-
 import org.w3c.dom.Element;
 
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
-
 import de.intevation.artifacts.common.utils.XMLUtils;
-
-import de.intevation.flys.artifacts.states.DefaultState;
 import de.intevation.flys.artifacts.math.fitting.Function;
 import de.intevation.flys.artifacts.math.fitting.FunctionFactory;
+import de.intevation.flys.artifacts.states.DefaultState;
 
 /**
  * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
@@ -31,6 +28,7 @@
     public FunctionSelect() {
     }
 
+    @Override
     public String getUIProvider() {
         return "fix.functionselect";
     }
@@ -43,13 +41,13 @@
         CallContext             context)
     {
         FunctionFactory ff = FunctionFactory.getInstance();
-        Collection fc = ff.getFunctions();
+        Collection<Function> fc = ff.getFunctions();
         Element[] functions = new Element[fc.size()];
-        Iterator i = fc.iterator();
+        Iterator<Function> i = fc.iterator();
 
         int j = 0;
         while(i.hasNext()) {
-            Function f = (Function)i.next();
+            Function f = i.next();
             String n = f.getName();
             String d = f.getDescription();
             functions[j] = createItem(ec, new String[] {d, n});

http://dive4elements.wald.intevation.org