| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
package com.buckosoft.PicMan.domain; |
| 9 | |
|
| 10 | |
import java.io.Serializable; |
| 11 | |
import java.util.Iterator; |
| 12 | |
import java.util.LinkedList; |
| 13 | |
import java.util.List; |
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | 0 | public class Chain implements Serializable, DataStrings { |
| 21 | |
private static final long serialVersionUID = 1L; |
| 22 | |
|
| 23 | 0 | private int cid = -1; |
| 24 | |
private String name; |
| 25 | 0 | private String shortName = ""; |
| 26 | 0 | private String contactPrefix = ""; |
| 27 | 0 | private String description = ""; |
| 28 | 0 | private boolean active = false; |
| 29 | 0 | private String engine = ""; |
| 30 | 0 | private String contactDirectory = ""; |
| 31 | 0 | private int contactCount = 4; |
| 32 | 0 | private int contactWidth = 640; |
| 33 | 0 | private int contactHeight = 480; |
| 34 | 0 | private int picSelector = PICSELECTOR_SORT; |
| 35 | 0 | private int ratingMin = 1; |
| 36 | 0 | private int ratingMax = 9; |
| 37 | 0 | private boolean showUnusedSets = true; |
| 38 | |
|
| 39 | 0 | private LinkedList<SetSize> setSizes = new LinkedList<SetSize>(); |
| 40 | |
|
| 41 | 0 | public void setName(String name) { this.name = name; } |
| 42 | 0 | public String getName() { return(name); } |
| 43 | |
|
| 44 | 0 | public void setDescription(String desc) { this.description = desc; } |
| 45 | 0 | public String getDescription() { return(description); } |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
public int getCid() { |
| 52 | 0 | return cid; |
| 53 | |
} |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
public void setCid(int cid) { |
| 58 | 0 | this.cid = cid; |
| 59 | 0 | } |
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
|
| 64 | |
public String getShortName() { |
| 65 | 0 | return shortName; |
| 66 | |
} |
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
public void setShortName(String shortName) { |
| 71 | 0 | this.shortName = shortName; |
| 72 | 0 | } |
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
public boolean isActive() { |
| 78 | 0 | return active; |
| 79 | |
} |
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
public void setActive(boolean active) { |
| 84 | 0 | this.active = active; |
| 85 | 0 | } |
| 86 | |
|
| 87 | 0 | public String getContactPrefix() { return(contactPrefix); } |
| 88 | 0 | public void setContactPrefix(String contactPrefix) { this.contactPrefix = contactPrefix; } |
| 89 | |
|
| 90 | |
|
| 91 | |
public int getContactCount() { |
| 92 | 0 | return contactCount; |
| 93 | |
} |
| 94 | |
public void setContactCount(int contactCount) { |
| 95 | 0 | this.contactCount = contactCount; |
| 96 | 0 | } |
| 97 | |
public String getContactDirectory() { |
| 98 | 0 | return contactDirectory; |
| 99 | |
} |
| 100 | |
public void setContactDirectory(String contactDirectory) { |
| 101 | 0 | this.contactDirectory = contactDirectory; |
| 102 | 0 | } |
| 103 | |
public int getContactHeight() { |
| 104 | 0 | return contactHeight; |
| 105 | |
} |
| 106 | |
public void setContactHeight(int contactHeight) { |
| 107 | 0 | this.contactHeight = contactHeight; |
| 108 | 0 | } |
| 109 | |
public int getContactWidth() { |
| 110 | 0 | return contactWidth; |
| 111 | |
} |
| 112 | |
public void setContactWidth(int contactWidth) { |
| 113 | 0 | this.contactWidth = contactWidth; |
| 114 | 0 | } |
| 115 | |
public String getEngine() { |
| 116 | 0 | return engine; |
| 117 | |
} |
| 118 | |
public void setEngine(String engine) { |
| 119 | 0 | this.engine = engine; |
| 120 | 0 | } |
| 121 | |
public LinkedList<SetSize> getSetSizes() { |
| 122 | 0 | return setSizes; |
| 123 | |
} |
| 124 | |
|
| 125 | |
public void addSetSize(SetSize ss) { |
| 126 | 0 | setSizes.add(ss); |
| 127 | 0 | } |
| 128 | |
public void setSetSizes(LinkedList<SetSize> setSizes) { |
| 129 | 0 | this.setSizes = setSizes; |
| 130 | 0 | } |
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
public List<String> getSetNames() { |
| 136 | 0 | LinkedList<String> theList = new LinkedList<String>(); |
| 137 | 0 | Iterator<SetSize> iter = this.setSizes.iterator(); |
| 138 | 0 | while (iter.hasNext()) { |
| 139 | 0 | SetSize ss = (SetSize)iter.next(); |
| 140 | 0 | boolean match = false; |
| 141 | 0 | Iterator<String> iterThe = theList.iterator(); |
| 142 | 0 | while (iterThe.hasNext()) { |
| 143 | 0 | String s = (String)iterThe.next(); |
| 144 | 0 | if (s.equals(ss.getSetName())) { |
| 145 | 0 | match = true; |
| 146 | 0 | break; |
| 147 | |
} |
| 148 | 0 | } |
| 149 | 0 | if (match == false) { |
| 150 | 0 | theList.add(ss.getSetName()); |
| 151 | |
} |
| 152 | 0 | } |
| 153 | 0 | return(theList); |
| 154 | |
} |
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
public boolean hasSetSize(String setName, int size) { |
| 160 | 0 | Iterator<SetSize> iter = this.setSizes.iterator(); |
| 161 | 0 | while (iter.hasNext()) { |
| 162 | 0 | SetSize ss = (SetSize)iter.next(); |
| 163 | 0 | if (ss.getSetName().equals(setName) && ss.getSize() == size) |
| 164 | 0 | return(true); |
| 165 | 0 | } |
| 166 | 0 | return(false); |
| 167 | |
} |
| 168 | |
|
| 169 | |
|
| 170 | |
|
| 171 | |
|
| 172 | |
public int getPicSelector() { |
| 173 | 0 | return picSelector; |
| 174 | |
} |
| 175 | |
|
| 176 | |
|
| 177 | |
|
| 178 | |
|
| 179 | |
public void setPicSelector(int picSelector) { |
| 180 | 0 | this.picSelector = picSelector; |
| 181 | 0 | } |
| 182 | |
|
| 183 | |
|
| 184 | |
|
| 185 | |
|
| 186 | |
public int getRatingMax() { |
| 187 | 0 | return ratingMax; |
| 188 | |
} |
| 189 | |
|
| 190 | |
|
| 191 | |
|
| 192 | |
|
| 193 | |
public void setRatingMax(int ratingMax) { |
| 194 | 0 | this.ratingMax = ratingMax; |
| 195 | 0 | } |
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
public int getRatingMin() { |
| 201 | 0 | return ratingMin; |
| 202 | |
} |
| 203 | |
|
| 204 | |
|
| 205 | |
|
| 206 | |
|
| 207 | |
public void setRatingMin(int ratingMin) { |
| 208 | 0 | this.ratingMin = ratingMin; |
| 209 | 0 | } |
| 210 | |
|
| 211 | |
|
| 212 | |
|
| 213 | |
|
| 214 | |
public boolean isShowUnusedSets() { |
| 215 | 0 | return showUnusedSets; |
| 216 | |
} |
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
public void setShowUnusedSets(boolean showUnusedSets) { |
| 221 | 0 | this.showUnusedSets = showUnusedSets; |
| 222 | 0 | } |
| 223 | |
|
| 224 | |
|
| 225 | |
} |