KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > form > core > ImageForm


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.webapp.form.core;
17
18 import com.blandware.atleap.webapp.form.ContentImageForm;
19 import org.apache.struts.action.ActionMapping;
20
21 import javax.servlet.http.HttpServletRequest JavaDoc;
22
23 /**
24  * <p>Form bean for content resource with type image
25  * </p>
26  * <p><a HREF="ImageForm.java.htm"><i>View Source</i></a></p>
27  * <p/>
28  *
29  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
30  * @version $Revision: 1.7 $ $Date: 2005/03/26 14:26:22 $
31  * @struts.form name="imageForm"
32  */

33 public class ImageForm extends ContentImageForm {
34
35     protected String JavaDoc scaleWidth = "0";
36     protected String JavaDoc scaleHeight = "0";
37     protected boolean scale = false;
38
39     public String JavaDoc getScaleWidth() {
40         return scaleWidth;
41     }
42
43     /**
44      * @struts.validator type="integer"
45      * @struts.validator-args arg0resource="imageForm.scaleWidth"
46      */

47     public void setScaleWidth(String JavaDoc scaleWidth) {
48         this.scaleWidth = scaleWidth;
49     }
50
51
52     public String JavaDoc getScaleHeight() {
53         return scaleHeight;
54     }
55
56     /**
57      * @struts.validator type="integer"
58      * @struts.validator-args arg0resource="imageForm.scaleHeight"
59      */

60     public void setScaleHeight(String JavaDoc scaleHeight) {
61         this.scaleHeight = scaleHeight;
62     }
63
64     public boolean isScale() {
65         return scale;
66     }
67
68     public void setScale(boolean scale) {
69         this.scale = scale;
70     }
71
72     /**
73      * Resets all properties to their default values
74      *
75      * @param mapping The ActionMapping used to select this instance
76      * @param request The non-http request we are proceeding
77      */

78     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
79         this.scaleWidth = "0";
80         this.scaleHeight = "0";
81         this.scale = false;
82     }
83
84 }
Popular Tags