1 /*
2 * Scope: a generic MVC framework.
3 * Copyright (c) 2000-2002, The Scope team
4 * All rights reserved.
5 *
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * Neither the name "Scope" nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 *
36 * $Id: SwingDummyModelNoMCE.java,v 1.8 2002/09/12 18:26:54 ludovicc Exp $
37 */
38 package test.view.swing;
39
40
41 import java.util.ArrayList;
42 import org.apache.commons.logging.Log;
43 import org.apache.commons.logging.LogFactory;
44
45 /***
46 * <P>
47 *
48 * A model for testing that doesn't fire ModelChangeEvents (MCE) </P>
49 *
50 * @author <A HREF="mailto:smeyfroi@users.sourceforge.net">Steve Meyfroidt</A>
51 * @created 12 September 2002
52 * @version $Revision: 1.8 $ $Date: 2002/09/12 18:26:54 $
53 */
54 public final class SwingDummyModelNoMCE {
55
56 private static final Log LOG = LogFactory.getLog(SwingDummyModelNoMCE.class);
57
58 private String stringProperty = "sp";
59 private String readOnlyStringProperty = "rosp";
60 private boolean booleanProperty = false;
61 private int intProperty = 1;
62
63 private String[] stringIndexedProperty = {"sip0", "sip1"};
64 private ArrayList stringNonIndexedProperty = new ArrayList();
65
66 private SwingDummyModelNoMCE subModel;
67
68 private ArrayList subModels;
69
70
71 /***
72 * Constructor for the SwingDummyModelNoMCE object
73 */
74 public SwingDummyModelNoMCE() {
75 stringNonIndexedProperty.add("snip0");
76 stringNonIndexedProperty.add("snip1");
77 }
78
79
80 /***
81 * Gets the int property
82 *
83 * @return The intProperty value
84 */
85 public int getIntProperty() {
86 return intProperty;
87 }
88
89
90 /***
91 * Gets the string property
92 *
93 * @return The stringProperty value
94 */
95 public String getStringProperty() {
96 return stringProperty;
97 }
98
99
100 /***
101 * Gets the boolean property
102 *
103 * @return The booleanProperty value
104 */
105 public boolean getBooleanProperty() {
106 return booleanProperty;
107 }
108
109
110 /***
111 * Gets the boolean read only property
112 *
113 * @return The booleanReadOnlyProperty value
114 */
115 public boolean getBooleanReadOnlyProperty() {
116 return true;
117 }
118
119
120 /***
121 * Gets the string indexed property
122 *
123 * @return The stringIndexedProperty value
124 */
125 public String[] getStringIndexedProperty() {
126 return stringIndexedProperty;
127 }
128
129
130 /***
131 * Gets the string indexed property
132 *
133 * @param inIndex TODO: Describe the Parameter
134 * @return The stringIndexedProperty value
135 */
136 public String getStringIndexedProperty(int inIndex) {
137 return stringIndexedProperty[inIndex];
138 }
139
140
141 /***
142 * Gets the string non indexed property
143 *
144 * @return The stringNonIndexedProperty value
145 */
146 public ArrayList getStringNonIndexedProperty() {
147 return stringNonIndexedProperty;
148 }
149
150 /***
151 * Gets the string non indexed property
152 *
153 * @param inIndex TODO: Describe the Parameter
154 * @return The stringNonIndexedProperty value
155 */
156 public String getStringNonIndexedProperty(int inIndex) {
157 return (String) getStringNonIndexedProperty().get(inIndex);
158 }
159
160
161 /***
162 * Gets the read only string property
163 *
164 * @return The readOnlyStringProperty value
165 */
166 public String getReadOnlyStringProperty() {
167 return readOnlyStringProperty;
168 }
169
170
171 /***
172 * Gets the sub model
173 *
174 * @return The subModel value
175 */
176 public SwingDummyModelNoMCE getSubModel() {
177 return subModel;
178 }
179
180
181 /***
182 * Gets the sub models
183 *
184 * @return The subModels value
185 */
186 public ArrayList getSubModels() {
187 return subModels;
188 }
189
190
191 /***
192 * Sets the int property
193 *
194 * @param inInt The new intProperty value
195 */
196 public void setIntProperty(int inInt) {
197 intProperty = inInt;
198 }
199
200
201 /***
202 * Sets the string property
203 *
204 * @param inString The new stringProperty value
205 */
206 public void setStringProperty(String inString) {
207 stringProperty = inString;
208 }
209
210
211 /***
212 * Sets the boolean property
213 *
214 * @param inValue The new booleanProperty value
215 */
216 public void setBooleanProperty(boolean inValue) {
217 booleanProperty = inValue;
218 }
219
220
221 /***
222 * Sets the string indexed property
223 *
224 * @param inStrings The new stringIndexedProperty value
225 */
226 public void setStringIndexedProperty(String[] inStrings) {
227 stringIndexedProperty = inStrings;
228 }
229
230
231 /***
232 * Sets the string indexed property
233 *
234 * @param inIndex The new stringIndexedProperty value
235 * @param inString The new stringIndexedProperty value
236 */
237 public void setStringIndexedProperty(int inIndex, String inString) {
238 stringIndexedProperty[inIndex] = inString;
239 }
240
241 /***
242 * Sets the string non indexed property
243 *
244 * @param inList The new stringNonIndexedProperty value
245 */
246 public void setStringNonIndexedProperty(ArrayList inList) {
247 stringNonIndexedProperty = inList;
248 }
249
250
251 /***
252 * Sets the sub model
253 *
254 * @param inModel The new subModel value
255 */
256 public void setSubModel(SwingDummyModelNoMCE inModel) {
257 subModel = inModel;
258 }
259
260
261 /***
262 * Sets the sub models
263 *
264 * @param inList The new subModels value
265 */
266 public void setSubModels(ArrayList inList) {
267 subModels = inList;
268 }
269
270
271 /***
272 * TODO: document the method
273 */
274 public void initSubModels() {
275 subModels = new ArrayList();
276 subModels.add(new SwingDummyModel("a", 1));
277 subModels.add(new SwingDummyModel("b", 2));
278 subModels.add(new SwingDummyModel("c", 3));
279 }
280 }
281
This page was automatically generated by Maven