View Javadoc
1   /******************************************************************************
2    * MetaSetForm.java - A bean to wrap MetaSet 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.MetaSet;
14  import com.buckosoft.PicMan.domain.Set;
15  
16  /** Wrap a MetaSet in a Spring form friendly package
17   * @author Dick Balaska
18   * @since 2006/07/04
19   */
20  public class MetaSetForm {
21  	private	MetaSet			metaSet;
22  	private	int				maxRules;
23  	private	Set				set;
24  	private	List<Set>		sets;
25  	private	BSAccountUserWebSession	userWebSession;
26  	private	boolean			flipFlop = false;
27  
28  	public	BSAccountUserWebSession	getUserWebSession() { return(userWebSession); }
29  	public	void		setUserWebSession(BSAccountUserWebSession us) { userWebSession = us; }
30  
31  	public	boolean		getFlipFlop() { flipFlop = !flipFlop; return(flipFlop); }
32  
33  	public class RateOp {
34  		private	int	value;
35  		private	String	name;
36  		RateOp(int v, String n) {
37  			value = v;
38  			name = n;
39  		}
40  		/**
41  		 * @return the name
42  		 */
43  		public String getName() {
44  			return name;
45  		}
46  		/**
47  		 * @return the value
48  		 */
49  		public int getValue() {
50  			return value;
51  		}
52  
53  	}
54  	private	RateOp[]	rateOps =  {new RateOp(0, ""), new RateOp(1, "<"), 
55  			new RateOp(2, ">"), new RateOp(3, "=="), new RateOp(4, "!=")};
56  	
57  	private	Integer[] rateSelectors = {
58  			9,8,7,6,5,4,3,2,1
59  		};
60  
61  	/**
62  	 * @return Returns the rateSelectors.
63  	 */
64  	public Integer[] getRateSelectors() {
65  		return rateSelectors;
66  	}
67  	
68  	/**
69  	 * @return Returns the metaSet.
70  	 */
71  	public MetaSet getMetaSet() {
72  		return metaSet;
73  	}
74  
75  	/**
76  	 * @param metaSet The metaSet to set.
77  	 */
78  	public void setMetaSet(MetaSet metaSet) {
79  		this.metaSet = metaSet;
80  	}
81  	/**
82  	 * @return Returns the set.
83  	 */
84  	public Set getSet() {
85  		return set;
86  	}
87  	/**
88  	 * @param set The set to set.
89  	 */
90  	public void setSet(Set set) {
91  		this.set = set;
92  	}
93  	/**
94  	 * @return the sets
95  	 */
96  	public List<Set> getSets() {
97  		return sets;
98  	}
99  	/**
100 	 * @param sets the sets to set
101 	 */
102 	public void setSets(List<Set> sets) {
103 		this.sets = sets;
104 	}
105 	/**
106 	 * @return the rateOps
107 	 */
108 	public RateOp[] getRateOps() {
109 		return rateOps;
110 	}
111 	/** Get the maximum number of rules in a MetaSet.
112 	 * @return the maxRules
113 	 */
114 	public int getMaxRules() {
115 		return maxRules;
116 	}
117 	/** Set the maximum number of rules in a MetaSet.
118 	 * @param maxRules the maxRules to set
119 	 */
120 	public void setMaxRules(int maxRules) {
121 		this.maxRules = maxRules;
122 	}
123 
124 }