KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > store > Image


1 /*
2  * Created on Dec 9, 2004
3  */

4 package com.openedit.store;
5
6 /**
7  * @author cburkey
8  *
9  */

10 public class Image extends LinkedFile
11 {
12     protected String JavaDoc fieldPostfix; //1 based
13
protected String JavaDoc fieldId;
14     protected String JavaDoc fieldType;
15     public static final String JavaDoc TYPE_ORIGINAL = "original";
16     public static final String JavaDoc TYPE_MEDIUM = "medium";
17     public static final String JavaDoc TYPE_THUMBNAIL = "thumb";
18     
19     protected int fieldWidth;
20     protected boolean isOriginal;
21     /**
22      *
23      */

24     public Image(String JavaDoc inDesc, int inWidth, String JavaDoc inPostfix)
25     {
26         setDescription(inDesc);
27         setWidth(inWidth);
28         setPostfix(inPostfix);
29     }
30     /**
31      *
32      */

33     public Image()
34     {
35     }
36     public String JavaDoc getPostfix()
37     {
38         if (fieldPostfix == null)
39             fieldPostfix = "";
40         
41         return fieldPostfix;
42     }
43     public void setPostfix(String JavaDoc inPostfix)
44     {
45         fieldPostfix = inPostfix;
46     }
47     public int getWidth()
48     {
49         return fieldWidth;
50     }
51     public void setWidth(int inWidth)
52     {
53         fieldWidth = inWidth;
54     }
55     public boolean isOriginal()
56     {
57         return isOriginal;
58     }
59     public void setOriginal(boolean inIsOriginal)
60     {
61         isOriginal = inIsOriginal;
62     }
63     public String JavaDoc getId()
64     {
65         return fieldId;
66     }
67     public void setId(String JavaDoc inId)
68     {
69         fieldId = inId;
70     }
71     public String JavaDoc getType()
72     {
73         return fieldType;
74     }
75     public void setType(String JavaDoc inType)
76     {
77         fieldType = inType;
78     }
79     public String JavaDoc buildLink(String JavaDoc inId)
80     {
81         return getType() + "/" + inId + "-" + getPostfix() + ".jpg";
82     }
83
84     
85 }
86
Popular Tags