package org.intermine.web.struts;

/* 
 * Copyright (C) 2002-2007 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.HashMap;
import java.util.Map;

import org.intermine.web.logic.SortableMap;
import org.intermine.web.logic.bag.InterMineBag;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author Julie Sullivan
 */
public class EnrichmentWidgetForm extends ActionForm
{

        private String controller, title, link, description, filterLabel, label;
        private String errorCorrection, filter;
        private String filters;
        private InterMineBag bag;
        private String bagName;
        private Double max;
        private Map pvalues, totals, labelToId;
        /**
         * Constructor
         */
        public EnrichmentWidgetForm() {
            initialise();
        }
        
        /**
         * Initialiser
         */
       public void initialise() {
           controller = "";
           title  = "";
           link = "";
           description = "";
           filterLabel = "";
           label = "";
           errorCorrection = "Bonferroni";
           filter = "";
           filters = "";
           bag = null;
           bagName = "";
           max = new Double(0.10);
           pvalues = new SortableMap();
           totals = new HashMap();
           labelToId = new HashMap();
        }
       
        /**
         * @return the controller
         */
        public String getController() {
            return controller;
        }


        /**
         * @param controller the controller to set
         */
        public void setController(String controller) {
            this.controller = controller;
        }


        /**
         * @return the description
         */
        public String getDescription() {
            return description;
        }


        /**
         * @param description the description to set
         */
        public void setDescription(String description) {
            this.description = description;
        }


        /**
         * @return the errorCorrection
         */
        public String getErrorCorrection() {
            return errorCorrection;
        }


        /**
         * @param errorCorrection the errorCorrection to set
         */
        public void setErrorCorrection(String errorCorrection) {
            this.errorCorrection = errorCorrection;
        }


        /**
         * @return the filterLabel
         */
        public String getFilterLabel() {
            return filterLabel;
        }


        /**
         * @param filterLabel the filterLabel to set
         */
        public void setFilterLabel(String filterLabel) {
            this.filterLabel = filterLabel;
        }

        /**
         * @return the bag
         */
        public InterMineBag getBag() {
            return bag;
        }


        /**
         * @param bag the bag to set
         */
        public void setBag(InterMineBag bag) {
            this.bag = bag;
        }

        /**
         * @return the link
         */
        public String getLink() {
            return link;
        }


        /**
         * @param link the link to set
         */
        public void setLink(String link) {
            this.link = link;
        }


        /**
         * @return the max
         */
        public Double getMax() {
            return max;
        }


        /**
         * @param max the max to set
         */
        public void setMax(Double max) {
            this.max = max;
        }


        /**
         * @return the title
         */
        public String getTitle() {
            return title;
        }


        /**
         * @param title the title to set
         */
        public void setTitle(String title) {
            this.title = title;
        }

        /**
         * @return the bagName
         */
        public String getBagName() {
            return bagName;
        }


        /**
         * @param bagName the bagName to set
         */
        public void setBagName(String bagName) {
            this.bagName = bagName;
        }

        /**
         * @return the bagType
         */
        public String getBagType() {
            return bag.getType();
        }

        /**
         * @return the label
         */
        public String getLabel() {
            return label;
        }

        /**
         * @param label the label to set
         */
        public void setLabel(String label) {
            this.label = label;
        }


        /**
         * @return the filter
         */
        public String getFilter() {
            return filter;
        }


        /**
         * @param filter the filter to set
         */
        public void setFilter(String filter) {
            this.filter = filter;
        }


        /**
         * @return the filters
         */
        public String getFilters() {
            return filters;
        }


        /**
         * @param filters the filters to set
         */
        public void setFilters(String filters) {
            this.filters = filters;
        }


        @Override
        public void reset(ActionMapping mapping, HttpServletRequest request) {

            super.reset(mapping, request);
            initialise();
        }

        /**
         * @return the pvalues
         */
        public Map getPvalues() {
            return pvalues;
        }

        /**
         * @param pvalues the pvalues to set
         */
        public void setPvalues(Map pvalues) {
            this.pvalues = pvalues;
        }


        /**
         * @return the labelToId
         */
        public Map getLabelToId() {
            return labelToId;
        }

        /**
         * @param labelToId the labelToId to set
         */
        public void setLabelToId(Map labelToId) {
            this.labelToId = labelToId;
        }

        
        /**
         * @return the totals
         */
        public Map getTotals() {
            return totals;
        }

        /**
         * @param totals the totals to set
         */
        public void setTotals(Map totals) {
            this.totals = totals;
        }
       
}

@@ -331,100 +331,8 @@
 */%0A%0A
-import java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.intermine.web.logic.SortableMap;
 %0Aimp
@@ -869,55 +869,8 @@
 ax;%0A
-        private Map pvalues, totals, labelToId;
 %0A   
@@ -1413,121 +1413,8 @@
 0);%0A
-           pvalues = new SortableMap();%0A           totals = new HashMap();%0A           labelToId = new HashMap();%0A
     
@@ -2604,32 +2604,53 @@
 %7D%0A%0A%0A        /**%0A
+        /**%0A%0A       %0A
          * @para
@@ -5375,904 +5375,7 @@
    %7D
-%0A%0A        /**%0A         * @return the pvalues%0A         */%0A        public Map getPvalues() %7B%0A            return pvalues;%0A        %7D%0A%0A        /**%0A         * @param pvalues the pvalues to set%0A         */%0A        public void setPvalues(Map pvalues) %7B%0A            this.pvalues = pvalues;%0A        %7D%0A%0A%0A        /**%0A         * @return the labelToId%0A         */%0A        public Map getLabelToId() %7B%0A            return labelToId;%0A        %7D%0A%0A        /**%0A         * @param labelToId the labelToId to set%0A         */%0A        public void setLabelToId(Map labelToId) %7B%0A            this.labelToId = labelToId;%0A        %7D%0A%0A        %0A        /**%0A         * @return the totals%0A         */%0A        public Map getTotals() %7B%0A            return totals;%0A        %7D%0A%0A        /**%0A         * @param totals the totals to set%0A         */%0A        public void setTotals(Map totals) %7B%0A            this.totals = totals;%0A        %7D%0A       
 %0A%7D%0A

remove widget results from form