View Javadoc
1   /******************************************************************************
2    * Pic.java - Define one pic.
3    * 
4    * PicMan - The BuckoSoft Picture Manager in Java
5    * Copyright(c) 2005 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.PicMan.domain;
9   
10  import java.util.Date;
11  
12  /** Define one pic.
13   * @author Dick Balaska
14   * @since 2005/08/01
15   */
16  public class Pic {
17  	private	int		pid = -1;
18  	private	String	name;
19  	private int		width;
20  	private	int		height;
21  	private	int		rid = -1;
22  	private	String	location;
23  	private	Date	date = new Date(0);
24  	private	boolean	importPic = false;
25  	private	int		cacheDir;
26  	private	long	md5;
27  	
28  	/** Bean constructor */
29  	public Pic() {}
30  
31  	/** Create a Pic with this importPic attribute and name
32  	 * @param importPic true if this is an importPic.
33  	 * @param name The filename of the pic to be imported
34  	 */
35  	public Pic(boolean importPic, String name){
36  		this.importPic = importPic;
37  		this.name = name;
38  	}
39  
40  	/** Set the Picture Id
41  	 * @param pid
42  	 */
43  	public	void	setPid(int pid) { this.pid = pid; }
44  	public	int		getPid() { return(pid); }
45  
46  	public	void	setName(String name) { this.name = name; }
47  	public	String	getName() { return(name); }
48  	public	void	setWidth(int width) { this.width = width; }
49  	public	int		getWidth() { return(width); }
50  	public	void	setHeight(int height) { this.height = height; }
51  	public	int		getHeight() { return(height); }
52  
53  	/** Set the relative directory of this pic
54  	 * @param location
55  	 */
56  	public	void	setLocation(String location) {
57  		this.location = location;
58  	}
59  
60  	/** Get the relative directory of this pic
61  	 * @return the subdirectory we live under
62  	 */
63  	public	String	getLocation() { 
64  		return(location); 
65  	}
66  //	public	void		setDate(Date date) { this.date = date; }
67  	public	Date	getDate() { return(date); }
68  //	public	void	updateSizes() {}
69  
70  	/** Get the Root id for where this pic is stored
71  	 * @return the rid
72  	 */
73  	public int getRid() {
74  		return rid;
75  	}
76  	/** Set the Root id for where this pic is stored
77  	 * @param rid the rid to set
78  	 */
79  	public void setRid(int rid) {
80  		this.rid = rid;
81  	}
82  	/**
83  	 * @return the importPic
84  	 */
85  	public boolean isImportPic() {
86  		return importPic;
87  	}
88  	/** If this is an importPic, then set this flag
89  	 * @param importPic the importPic to set
90  	 */
91  	public void setImportPic(boolean importPic) {
92  		this.importPic = importPic;
93  	}
94  	/** Fetch the cache subdirectory that this pic was written to.
95  	 * @return the cacheDir
96  	 */
97  	public int getCacheDir() {
98  		return cacheDir;
99  	}
100 	/** Set which cache subdirectory this pic is written to.
101 	 * @param cacheDir the cacheDir to set
102 	 */
103 	public void setCacheDir(int cacheDir) {
104 		this.cacheDir = cacheDir;
105 	}
106 	/** Get the md5 checksum for this pic
107 	 * @return the md5
108 	 */
109 	public long getMd5() {
110 		return md5;
111 	}
112 	/** Set the md5 checksum for this pic
113 	 * @param md5 the md5 to set
114 	 */
115 	public void setMd5(long md5) {
116 		this.md5 = md5;
117 	}
118 
119 }