Coverage Report - com.buckosoft.PicMan.web.ChainManForm
 
Classes in this File Line Coverage Branch Coverage Complexity
ChainManForm
0%
0/33
0%
0/10
1.217
ChainManForm$Selector
0%
0/3
N/A
1.217
 
 1  
 /******************************************************************************
 2  
  * ChainManForm.java - A bean to wrap ChainMan in a form friendly package
 3  
  * 
 4  
  * PicMan - The BuckoSoft Picture Manager in Java
 5  
  * Copyright(c) 2006 - Dick Balaska
 6  
  * 
 7  
  */
 8  
 package com.buckosoft.PicMan.web;
 9  
 
 10  
 import java.util.List;
 11  
 
 12  
 import com.buckosoft.BSAccount.web.BSAccountUserWebSession;
 13  
 import com.buckosoft.PicMan.domain.Chain;
 14  
 import com.buckosoft.PicMan.domain.DataStrings;
 15  
 
 16  
 /** A bean to wrap ChainMan in a form friendly package
 17  
  * @author Dick Balaska
 18  
  * @since 2006/01/24
 19  
  * @see <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/src/com/buckosoft/PicMan/web/ChainManForm.java">ChainManForm.java</a>
 20  
  */
 21  0
 public class ChainManForm implements DataStrings {
 22  
 
 23  
         private List<Chain>                                        chains;
 24  
         private        BSAccountUserWebSession        userWebSession;
 25  0
         private        boolean                                        flipFlop = false;
 26  
         private        String                                        chainToDelete;
 27  
         private        String                                        newChainName;
 28  0
         private        Chain                                        activeChain = null;
 29  
         private        String                                        setSizeWebTable;
 30  
 
 31  
         private        String                                        contactEngineName;
 32  
         private        List<String>                        engines;
 33  
         
 34  0
         public        BSAccountUserWebSession        getUserWebSession() { return(userWebSession); }
 35  0
         public        void                setUserWebSession(BSAccountUserWebSession us) { userWebSession = us; }
 36  
 
 37  0
         public        List<Chain>                getChains() { return(chains); }
 38  0
         public        void                setChains(List<Chain> chains) { this.chains = chains; }
 39  
 
 40  0
         public        int                        getChainCount() { return(this.chains.size()); }
 41  
 
 42  0
         public        boolean                getFlipFlop() { flipFlop = !flipFlop; return(flipFlop); }
 43  
         
 44  0
         public        String                getNewChainName() { return(newChainName); }
 45  0
         public        void                setNewChainName(String s) { newChainName = s; }
 46  0
         public        String                getChainToDelete() { return(chainToDelete); }
 47  0
         public        void                setChainToDelete(String s) { chainToDelete = s; }
 48  
 
 49  
         public Chain getActiveChain() {
 50  0
                 return activeChain;
 51  
         }
 52  
         public void setActiveChain(Chain activeChain) {
 53  0
                 this.activeChain = activeChain;
 54  0
         }
 55  
         /**
 56  
          * @return Returns the setSizeWebTable.
 57  
          */
 58  
         public String getSetSizeWebTable() {
 59  0
                 return setSizeWebTable;
 60  
         }
 61  
         /**
 62  
          * @param setSizeWebTable The setSizeWebTable to set.
 63  
          */
 64  
         public void setSetSizeWebTable(String setSizeWebTable) {
 65  0
                 this.setSizeWebTable = setSizeWebTable;
 66  0
         }
 67  
 
 68  
         public class Selector {
 69  0
                 Selector(int i, String s) { index = i; name = s; }
 70  
                 private int                index;
 71  
                 private        String        name;
 72  
                 /**
 73  
                  * @return Returns the index.
 74  
                  */
 75  
                 public int getIndex() {
 76  0
                         return index;
 77  
                 }
 78  
                 /**
 79  
                  * @return Returns the name of this Selector.
 80  
                  */
 81  
                 public String getName() {
 82  0
                         return name;
 83  
                 }
 84  
                 
 85  
         }
 86  0
         private        Selector[] picSelectors = {
 87  
                 new Selector(PICSELECTOR_MIX, "Mix"), 
 88  
                 new Selector(PICSELECTOR_SORT, "Sort") 
 89  
         };
 90  
 
 91  
         /**
 92  
          * @return Returns the picSelector.
 93  
          */
 94  
         public Selector[] getPicSelectors() {
 95  0
                 return picSelectors;
 96  
         }
 97  
         
 98  0
         private        Integer[] rateSelectors = {
 99  0
                 9,8,7,6,5,4,3,2,1
 100  
         };
 101  
 
 102  
         /** Get an array of Integers that are the possible rates.
 103  
          * @return Returns the rateSelectors.
 104  
          */
 105  
         public Integer[] getRateSelectors() {
 106  0
                 return rateSelectors;
 107  
         }
 108  
 
 109  
         /** Get the name of the engine to build this chain.  If there is no engine, pick a reasonable default.
 110  
          * @return the contactEngineName or 
 111  
          */
 112  
         public String getContactEngineName() {
 113  0
                 if ((contactEngineName == null || contactEngineName.isEmpty() )
 114  0
                                 && (engines != null && !engines.isEmpty())) {
 115  0
                         return(engines.get(0));
 116  
                 }
 117  0
                 return contactEngineName;
 118  
         }
 119  
         /** Set the name of the engine to use to build the chain. 
 120  
          * @param contactEngineName the contactEngineName to set
 121  
          */
 122  
         public void setContactEngineName(String contactEngineName) {
 123  0
                 this.contactEngineName = contactEngineName;
 124  0
         }
 125  
         /**
 126  
          * @return the engines
 127  
          */
 128  
         public List<String> getEngines() {
 129  0
                 return engines;
 130  
         }
 131  
         /**
 132  
          * @param engines the engines to set
 133  
          */
 134  
         public void setEngines(List<String> engines) {
 135  0
                 this.engines = engines;
 136  0
         }
 137  
         
 138  
 }