View Javadoc
1   /******************************************************************************
2    * Poster.java - Define A poster and how to build it.
3    * 
4    * PicMan - The BuckoSoft Picture Manager in Java
5    * Copyright(c) 2012 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.PicMan.domain;
9   
10  import java.util.HashMap;
11  
12  /** Define A poster and how to build it.
13   * @author Dick Balaska
14   * @since 2012/07/21
15   * @see <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/src/com/buckosoft/PicMan/domain/Poster.java">Poster.java</a>
16   */
17  public class Poster  implements Comparable<Poster> {
18  	private	int		pid;
19  	private	String	name;
20  	private	int		masterMid;
21  	private	String	outputPath;
22  
23  	private	HashMap<String, String>	config = new HashMap<String, String>();
24  
25  	/** Return a reference to the poster config map.
26  	 * These are stored key = param name, value = String value
27  	 * Known keys are: dpi, paperWidth, paperHeight, multiplier, projectWidth, projectHeight
28  	 * @return the engineConfig
29  	 */
30  	public HashMap<String, String> getConfig() {
31  		return config;
32  	}
33  
34  	/** Set the map of config parameters.
35  	 * @param config the config to set
36  	 */
37  	public void setConfig(HashMap<String, String> config) {
38  		this.config = config;
39  	}
40  
41  	/**
42  	 * @return the dpi
43  	 */
44  	public int getDpi() {
45  		try {
46  		if (this.config.containsKey("dpi"))
47  			return(Integer.parseInt(this.config.get("dpi")));
48  		} catch(Exception e) {}
49  		return 0;
50  	}
51  
52  	/**
53  	 * @param dpi the dpi to set
54  	 */
55  	public void setDpi(int dpi) {
56  		this.config.put("dpi", "" + dpi);
57  	}
58  
59  	/**
60  	 * @return the paperWidth
61  	 */
62  	public double getPaperWidth() {
63  		try {
64  		if (this.config.containsKey("paperWidth"))
65  			return(Double.parseDouble(this.config.get("paperWidth")));
66  		} catch(Exception e) {}
67  		return 0.0;
68  	}
69  
70  	/**
71  	 * @param paperWidth the paperWidth to set
72  	 */
73  	public void setPaperWidth(double paperWidth) {
74  		this.config.put("paperWidth", "" + paperWidth);
75  	}
76  
77  	/**
78  	 * @return the paperHeight
79  	 */
80  	public double getPaperHeight() {
81  		try {
82  		if (this.config.containsKey("paperHeight"))
83  			return(Double.parseDouble(this.config.get("paperHeight")));
84  		} catch(Exception e) {}
85  		return 0.0;
86  	}
87  
88  	/**
89  	 * @param paperHeight the paperHeight to set
90  	 */
91  	public void setPaperHeight(double paperHeight) {
92  		this.config.put("paperHeight", "" + paperHeight);
93  	}
94  
95  	/**
96  	 * @return the multiplier
97  	 */
98  	public double getMultiplier() {
99  		try {
100 		if (this.config.containsKey("multiplier"))
101 			return(Double.parseDouble(this.config.get("multiplier")));
102 		} catch(Exception e) {}
103 		return 0.0;
104 	}
105 
106 	/**
107 	 * @param multiplier the multiplier to set
108 	 */
109 	public void setMultiplier(double multiplier) {
110 		this.config.put("multiplier", "" + multiplier);
111 	}
112 
113 	/**
114 	 * @return the projectWidth
115 	 */
116 	public double getProjectWidth() {
117 		try {
118 		if (this.config.containsKey("projectWidth"))
119 			return(Double.parseDouble(this.config.get("projectWidth")));
120 		} catch(Exception e) {}
121 		return 0.0;
122 	}
123 
124 	/**
125 	 * @param projectWidth the projectWidth to set
126 	 */
127 	public void setProjectWidth(double projectWidth) {
128 		this.config.put("projectWidth", "" + projectWidth);
129 	}
130 
131 	/**
132 	 * @return the projectHeight
133 	 */
134 	public double getProjectHeight() {
135 		try {
136 		if (this.config.containsKey("projectHeight"))
137 			return(Double.parseDouble(this.config.get("projectHeight")));
138 		} catch(Exception e) {}
139 		return 0.0;
140 	}
141 
142 	/**
143 	 * @param projectHeight the projectHeight to set
144 	 */
145 	public void setProjectHeight(double projectHeight) {
146 		this.config.put("projectHeight", "" + projectHeight);
147 	}
148 
149 	public int compareTo(Poster arg0) {
150 		return(this.name.compareToIgnoreCase(arg0.name));
151 	}
152 	
153 	
154 	/**
155 	 * @return the left overSpray
156 	 */
157 	public int getOverSprayL() {
158 		if (this.config.containsKey("overSprayL"))
159 			return(Integer.parseInt(this.config.get("overSprayL")));
160 		return(0);
161 	}
162 
163 	/**
164 	 * @param overSprayL the amount of left overSpray to set
165 	 */
166 	public void setOverSprayL(int overSprayL) {
167 		this.config.put("overSprayL", "" + overSprayL);
168 	}
169 
170 	/**
171 	 * @return the overSprayT
172 	 */
173 	public int getOverSprayT() {
174 		if (this.config.containsKey("overSprayT"))
175 			return(Integer.parseInt(this.config.get("overSprayT")));
176 		return(0);
177 	}
178 
179 	/**
180 	 * @param overSprayT the amount of top overSpray to set
181 	 */
182 	public void setOverSprayT(int overSprayT) {
183 		this.config.put("overSprayT", "" + overSprayT);
184 	}
185 
186 	/**
187 	 * @return the right overSpray
188 	 */
189 	public int getOverSprayR() {
190 		if (this.config.containsKey("overSprayR"))
191 			return(Integer.parseInt(this.config.get("overSprayR")));
192 		return(0);
193 	}
194 
195 	/**
196 	 * @param overSprayR the amount of right overSpray to set
197 	 */
198 	public void setOverSprayR(int overSprayR) {
199 		this.config.put("overSprayR", "" + overSprayR);
200 	}
201 
202 	/**
203 	 * @return the overSprayB
204 	 */
205 	public int getOverSprayB() {
206 		if (this.config.containsKey("overSprayB"))
207 			return(Integer.parseInt(this.config.get("overSprayB")));
208 		return(0);
209 	}
210 
211 	/**
212 	 * @param overSprayB the amount of bottom overSpray to set
213 	 */
214 	public void setOverSprayB(int overSprayB) {
215 		this.config.put("overSprayB", "" + overSprayB);
216 	}
217 
218 	/**
219 	 * @return the marginL
220 	 */
221 	public int getMarginL() {
222 		if (this.config.containsKey("marginL"))
223 			return(Integer.parseInt(this.config.get("marginL")));
224 		return(0);
225 	}
226 
227 	/**
228 	 * @param marginL the marginL to set
229 	 */
230 	public void setMarginL(int marginL) {
231 		this.config.put("marginL", "" + marginL);
232 	}
233 
234 	/**
235 	 * @return the marginR
236 	 */
237 	public int getMarginR() {
238 		if (this.config.containsKey("marginR"))
239 			return(Integer.parseInt(this.config.get("marginR")));
240 		return(0);
241 	}
242 
243 	/**
244 	 * @param marginR the marginR to set
245 	 */
246 	public void setMarginR(int marginR) {
247 		this.config.put("marginR", "" + marginR);
248 	}
249 
250 	/**
251 	 * @return the marginT
252 	 */
253 	public int getMarginT() {
254 		if (this.config.containsKey("marginT"))
255 			return(Integer.parseInt(this.config.get("marginT")));
256 		return(0);
257 	}
258 
259 	/**
260 	 * @param marginT the marginT to set
261 	 */
262 	public void setMarginT(int marginT) {
263 		this.config.put("marginT", "" + marginT);
264 	}
265 
266 	/**
267 	 * @return the marginB
268 	 */
269 	public int getMarginB() {
270 		if (this.config.containsKey("marginB"))
271 			return(Integer.parseInt(this.config.get("marginB")));
272 		return(0);
273 	}
274 
275 	/**
276 	 * @param marginB the marginB to set
277 	 */
278 	public void setMarginB(int marginB) {
279 		this.config.put("marginB", "" + marginB);
280 	}
281 
282 	/**
283 	 * @return the pid
284 	 */
285 	public int getPid() {
286 		return pid;
287 	}
288 	/**
289 	 * @param pid the pid to set
290 	 */
291 	public void setPid(int pid) {
292 		this.pid = pid;
293 	}
294 
295 	/**
296 	 * @return the name
297 	 */
298 	public String getName() {
299 		return name;
300 	}
301 	/**
302 	 * @param name the name to set
303 	 */
304 	public void setName(String name) {
305 		this.name = name;
306 	}
307 
308 	/**
309 	 * @return the masterMid
310 	 */
311 	public int getMasterMid() {
312 		return masterMid;
313 	}
314 	/**
315 	 * @param masterMid the masterMid to set
316 	 */
317 	public void setMasterMid(int masterMid) {
318 		this.masterMid = masterMid;
319 	}
320 
321 	/**
322 	 * @return the outputPath
323 	 */
324 	public String getOutputPath() {
325 		return outputPath;
326 	}
327 	/**
328 	 * @param outputPath the outputPath to set
329 	 */
330 	public void setOutputPath(String outputPath) {
331 		this.outputPath = outputPath;
332 	}
333 
334 	
335 }