01: /*
02: * Created on Dec 9, 2004
03: */
04: package org.openedit.store;
05:
06: /**
07: * @author cburkey
08: *
09: */
10: public class Image extends LinkedFile {
11: protected String fieldPostfix; //1 based
12: protected String fieldId;
13: protected String fieldType;
14: public static final String TYPE_ORIGINAL = "original";
15: public static final String TYPE_MEDIUM = "medium";
16: public static final String TYPE_THUMBNAIL = "thumb";
17:
18: protected int fieldWidth;
19: protected boolean isOriginal;
20:
21: /**
22: *
23: */
24: public Image(String inDesc, int inWidth, String inPostfix) {
25: setDescription(inDesc);
26: setWidth(inWidth);
27: setPostfix(inPostfix);
28: }
29:
30: /**
31: *
32: */
33: public Image() {
34: }
35:
36: public String getPostfix() {
37: if (fieldPostfix == null)
38: fieldPostfix = "";
39:
40: return fieldPostfix;
41: }
42:
43: public void setPostfix(String inPostfix) {
44: fieldPostfix = inPostfix;
45: }
46:
47: public int getWidth() {
48: return fieldWidth;
49: }
50:
51: public void setWidth(int inWidth) {
52: fieldWidth = inWidth;
53: }
54:
55: public boolean isOriginal() {
56: return isOriginal;
57: }
58:
59: public void setOriginal(boolean inIsOriginal) {
60: isOriginal = inIsOriginal;
61: }
62:
63: public String getId() {
64: return fieldId;
65: }
66:
67: public void setId(String inId) {
68: fieldId = inId;
69: }
70:
71: public String getType() {
72: return fieldType;
73: }
74:
75: public void setType(String inType) {
76: fieldType = inType;
77: }
78:
79: public String buildLink(String inId) {
80: return getType() + "/" + inId + "-" + getPostfix() + ".jpg";
81: }
82:
83: }
|