View Javadoc
1   /******************************************************************************
2    * PosterSetupForm.java - The backing form to edit PicMan's Poster setup
3    * 
4    * PicMan - The BuckoSoft Picture Manager in Java
5    * Copyright(c) 2012 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.PicMan.web;
9   
10  import java.util.List;
11  
12  import org.apache.commons.logging.Log;
13  import org.apache.commons.logging.LogFactory;
14  
15  import com.buckosoft.BSAccount.web.BSAccountUserWebSession;
16  import com.buckosoft.PicMan.business.PicManFacade;
17  import com.buckosoft.PicMan.domain.Poster;
18  import com.buckosoft.PicMan.domain.Set;
19  
20  /** The backing form to edit PicMan's Poster setup
21   * @author Dick Balaska
22   * @since 2012/07/21
23   * @see <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/src/com/buckosoft/PicMan/web/PosterSetupForm.java">PosterSetupForm.java</a>
24   */
25  public class PosterSetupForm {
26      protected final Log logger = LogFactory.getLog(getClass());
27  
28      private	BSAccountUserWebSession	userWebSession;
29  	private	Poster			poster;
30  	private	String			masterPic;
31  	private	int				posterHeight;
32  	private	String			posterOutputFile;
33  
34  //	private	String			posterSetName;
35  	private	int				posterSid;
36  	private	List<Set>		sets;
37  	private	boolean			startBuilding;
38  	private	boolean			calibrationSheet;
39  	private	boolean			makeBackups = true;
40  	private	String			posterName = "New Poster";
41  	private	List<Poster>	posters;
42  
43  	private	String			posterEngineName;
44  	private	List<MosaicNameAndMid>	mosaics;
45  	private	String			posterSelectName = "";
46  
47  	private	String			posterEngineConfig;
48  	private	String			posterConfigs;
49  
50  	@SuppressWarnings("unused")
51  	private PicManFacade pmf;
52  
53  	/** Set the reference to the PicMan API.
54  	 * @param pmf The PicManFacade
55  	 */
56  	public void setPicMan(PicManFacade pmf) { this.pmf = pmf; }
57  	
58  	public	BSAccountUserWebSession	getUserWebSession() { return(userWebSession); }
59  	public	void		setUserWebSession(BSAccountUserWebSession us) { userWebSession = us; }
60  
61  	
62  	/**
63  	 * @return the masterPic
64  	 */
65  	public String getMasterPic() {
66  		return masterPic;
67  	}
68  	/**
69  	 * @param masterPic the masterPic to set
70  	 */
71  	public void setMasterPic(String masterPic) {
72  		this.masterPic = masterPic;
73  	}
74  	/**
75  	 * @return the poster
76  	 */
77  	public Poster getPoster() {
78  		return poster;
79  	}
80  	/**
81  	 * @param poster the poster to set
82  	 */
83  	public void setPoster(Poster poster) {
84  		this.poster = poster;
85  	}
86  	
87  	/**
88  	 * @return the posterSelectName
89  	 */
90  	public String getPosterSelectName() {
91  		return posterSelectName;
92  	}
93  	/**
94  	 * @param posterSelectName the posterSelectName to set
95  	 */
96  	public void setPosterSelectName(String posterSelectName) {
97  		this.posterSelectName = posterSelectName;
98  	}
99  	/**
100 	 * @return the posterName
101 	 */
102 	public String getPosterName() {
103 		return posterName;
104 	}
105 	/**
106 	 * @param posterName the posterName to set
107 	 */
108 	public void setPosterName(String posterName) {
109 		this.posterName = posterName;
110 	}
111 	
112 	/**
113 	 * @return the posters
114 	 */
115 	public List<Poster> getPosters() {
116 		return posters;
117 	}
118 	/**
119 	 * @param posters the posters to set
120 	 */
121 	public void setPosters(List<Poster> posters) {
122 		this.posters = posters;
123 	}
124 	
125 	/**
126 	 * @return the posterEngineName
127 	 */
128 	public String getPosterEngineName() {
129 		return posterEngineName;
130 	}
131 	/**
132 	 * @param posterEngineName the posterEngineName to set
133 	 */
134 	public void setPosterEngineName(String posterEngineName) {
135 		this.posterEngineName = posterEngineName;
136 	}
137 	/**
138 	 * @return the posterHeight
139 	 */
140 	public int getPosterHeight() {
141 		return posterHeight;
142 	}
143 	/**
144 	 * @param posterHeight the posterHeight to set
145 	 */
146 	public void setPosterHeight(int posterHeight) {
147 		this.posterHeight = posterHeight;
148 	}
149 
150 	/** Where to write the poster output
151 	 * @return the posterOutputFile
152 	 */
153 	public String getPosterOutputFile() {
154 		return posterOutputFile;
155 	}
156 	/**
157 	 * @param posterOutputFile the posterOutputFile to set
158 	 */
159 	public void setPosterOutputFile(String posterOutputFile) {
160 		this.posterOutputFile = posterOutputFile;
161 	}
162 	/**
163 	 * @return the startBuilding
164 	 */
165 	public boolean isStartBuilding() {
166 		return startBuilding;
167 	}
168 	/**
169 	 * @param startBuilding the startBuilding to set
170 	 */
171 	public void setStartBuilding(boolean startBuilding) {
172 		this.startBuilding = startBuilding;
173 	}
174 	/**
175 	 * @return the calibrationSheet
176 	 */
177 	public boolean isCalibrationSheet() {
178 		return calibrationSheet;
179 	}
180 	/**
181 	 * @param calibrationSheet the calibrationSheet to set
182 	 */
183 	public void setCalibrationSheet(boolean calibrationSheet) {
184 		this.calibrationSheet = calibrationSheet;
185 	}
186 
187 	/** Should we save the poster output jpeg before overwriting it with a new file?
188 	 * @return the makeBackups
189 	 */
190 	public boolean isMakeBackups() {
191 		return makeBackups;
192 	}
193 
194 	/** Should we save the poster output jpeg before overwriting it with a new file?
195 	 * @param makeBackups the makeBackups to set
196 	 */
197 	public void setMakeBackups(boolean makeBackups) {
198 		this.makeBackups = makeBackups;
199 	}
200 	/**
201 	 * @return the posterPid
202 	 */
203 	public int getPosterSid() {
204 		return posterSid;
205 	}
206 	/**
207 	 * @param posterSid the posterSid to set
208 	 */
209 	public void setPosterSid(int posterSid) {
210 		this.posterSid = posterSid;
211 	}
212 	/**
213 	 * @return the sets
214 	 */
215 	public List<Set> getSets() {
216 		return sets;
217 	}
218 	/**
219 	 * @param sets the sets to set
220 	 */
221 	public void setSets(List<Set> sets) {
222 		this.sets = sets;
223 	}
224 
225 	/**
226 	 * @return the posterEngineConfig
227 	 */
228 	public String getPosterEngineConfig() {
229 		return posterEngineConfig;
230 	}
231 
232 	/**
233 	 * @param posterEngineConfig the posterEngineConfig to set
234 	 */
235 	public void setPosterEngineConfig(String posterEngineConfig) {
236 		this.posterEngineConfig = posterEngineConfig;
237 	}
238 
239 	/**
240 	 * @return the posterConfigs
241 	 */
242 	public String getPosterConfigs() {
243 		return posterConfigs;
244 	}
245 
246 	/**
247 	 * @param posterConfigs the posterConfigs to set
248 	 */
249 	public void setPosterConfigs(String posterConfigs) {
250 		this.posterConfigs = posterConfigs;
251 	}
252 
253 	public class MosaicNameAndMid implements Comparable<MosaicNameAndMid> {
254 		private int		mid;
255 		private String	name;
256 		/**
257 		 * @return the mid
258 		 */
259 		public int getMid() {
260 			return mid;
261 		}
262 		/**
263 		 * @param mid the mid to set
264 		 */
265 		public void setMid(int mid) {
266 			this.mid = mid;
267 		}
268 		/**
269 		 * @return the name
270 		 */
271 		public String getName() {
272 			return name;
273 		}
274 		/**
275 		 * @param name the name to set
276 		 */
277 		public void setName(String name) {
278 			this.name = name;
279 		}
280 
281 		public int compareTo(MosaicNameAndMid arg0) {
282 			return(this.name.compareToIgnoreCase(arg0.name));
283 		}		
284 	}
285 
286 	/**
287 	 * @return the mosaics
288 	 */
289 	public List<MosaicNameAndMid> getMosaics() {
290 		return mosaics;
291 	}
292 
293 	/**
294 	 * @param mosaics the mosaics to set
295 	 */
296 	public void setMosaics(List<MosaicNameAndMid> mosaics) {
297 		this.mosaics = mosaics;
298 	}
299 }