changeset 1079:ef756e166154

Improved implementation of MainValueArtifact#MainValueFacet . flys-artifacts/trunk@2576 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 25 Aug 2011 10:42:23 +0000
parents 048517d67215
children fa01c3602f66
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
diffstat 2 files changed, 25 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Aug 25 10:38:45 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Aug 25 10:42:23 2011 +0000
@@ -1,3 +1,9 @@
+2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
+	  (MainValueFacet):
+	  Improved and straightened implementation, added code-Annotations and Todos.
+
 2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Thu Aug 25 10:38:45 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Thu Aug 25 10:42:23 2011 +0000
@@ -140,44 +140,26 @@
     }
 
 
-    /* FACET IMPLEMENTATION  */
-    class MainValuesFacet extends DefaultFacet {
+    /* FACET IMPLEMENTATION */
+    // TODO evaluate whether DefaultFacet can do.
+    static class MainValuesFacet
+    extends      DefaultFacet
+    implements   FacetTypes {
 
-        public MainValuesFacet()
-        {
-        description = "facet.mainvalues";
-        name = "facet.mainvalues";
-        index = 0;
+        public MainValuesFacet() {
+            description = "facet.discharge_curves.mainvalues.description";
+            name = COMPUTED_DISCHARGE_MAINVALUES;
+            //Resources.getMsg(meta, I18N_DESCRIPTION, I18N_DESCRIPTION));
+            index = 0;
         }
 
-        // TODO implement; what is index used for?
-        /**
-         * Returns the index of this facet.
-         *
-         * @return the index of this facet.
-         */
-        public int getIndex() {
-            return 0;
-        }
- 
- 
-        /**
-         * Returns the name of this facet.
-         *
-         * @return the name of this facet.
-         */
-        public String getName() {
-            // TODO define, static
-            // TODO remove, is part of DefaultFacet.
-            return "facet.mainvalue";
-        }
- 
- 
+
         /**
          * Returns the description of this facet.
          *
          * @return the description of this facet.
          */
+        @Override
         public String getDescription() {
             // TODO remove, is part of DefaultFacet.
             return "facet.mainvalues";
@@ -187,20 +169,23 @@
         /**
          * Returns the data this facet requires.
          *
-         * @param artifact The owner artifact.
-         * @param context The CallContext.
+         * @param artifact the owner artifact.
+         * @param context  the CallContext (ignored).
          *
          * @return the data.
          */
+        @Override
         public Object getData(Artifact artifact, CallContext context) {
-            return null;
+            MainValuesArtifact mvArtifact = (MainValuesArtifact) artifact;
+            return mvArtifact.getMainValues();
         }
  
 
         /**
          * Create a deep copy of this Facet.
          * @return a deep copy.
-         */ 
+         */
+        @Override
         public MainValuesFacet deepCopy() {
             MainValuesFacet copy = new MainValuesFacet();
             copy.set(this);

http://dive4elements.wald.intevation.org