KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > html > Applet


1 /*
2  * ====================================================================
3  *
4  * The Apache Software License, Version 1.1
5  *
6  * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
7  * reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if
22  * any, must include the following acknowlegement:
23  * "This product includes software developed by the
24  * Apache Software Foundation (http://www.apache.org/)."
25  * Alternately, this acknowlegement may appear in the software itself,
26  * if and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The names "The Jakarta Project", "Jakarta Element Construction Set",
29  * "Jakarta ECS" , and "Apache Software Foundation" must not be used
30  * to endorse or promote products derived
31  * from this software without prior written permission. For written
32  * permission, please contact apache@apache.org.
33  *
34  * 5. Products derived from this software may not be called "Apache",
35  * "Jakarta Element Construction Set" nor "Jakarta ECS" nor may "Apache"
36  * appear in their names without prior written permission of the Apache Group.
37  *
38  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49  * SUCH DAMAGE.
50  * ====================================================================
51  *
52  * This software consists of voluntary contributions made by many
53  * individuals on behalf of the Apache Software Foundation. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  *
57  */

58 package org.apache.ecs.html;
59
60 import org.apache.ecs.*;
61
62 /**
63     This class creates an ObjectElement
64
65     @version $Id: Applet.java,v 1.3 2003/04/27 09:21:59 rdonkin Exp $
66     @author <a HREF="mailto:snagy@servletapi.com">Stephan Nagy</a>
67     @author <a HREF="mailto:jon@clearink.com">Jon S. Stevens</a>
68 */

69 public class Applet extends MultiPartElement implements Printable
70 {
71     /**
72         Private initializer.
73     */

74     {
75         setElementType("applet");
76     }
77
78     /**
79         Default constructor. Creates the &lt;applet/&gt; Element.<br>
80         use set* methods.
81     */

82     public Applet()
83     {
84     }
85
86    /**
87         Determines the base url for this applet.
88         @param url base url for this applet.
89     */

90     public Applet setCodeBase(String JavaDoc url)
91     {
92         addAttribute("codebase",url);
93         return(this);
94     }
95
96     /**
97         Comma seperated archive list.
98         @param url Comma seperate archive list.
99     */

100     public Applet setArchive(String JavaDoc url)
101     {
102         addAttribute("archive",url);
103         return(this);
104     }
105
106     /**
107         Applet class file.
108         @param code Applet class file.
109     */

110     public Applet setCode(String JavaDoc code)
111     {
112         addAttribute("code",code);
113         return(this);
114     }
115
116     /**
117         Suggested height of applet.
118         @param height suggested link height.
119     */

120     public Applet setHeight(String JavaDoc height)
121     {
122         addAttribute("height",height);
123         return(this);
124     }
125
126     /**
127         Suggested height of applet.
128         @param height suggested link height.
129     */

130     public Applet setHeight(int height)
131     {
132         addAttribute("height",Integer.toString(height));
133         return(this);
134     }
135
136     /**
137         Suggested height of applet.
138         @param height suggested link height.
139     */

140     public Applet setHeight(double height)
141     {
142         addAttribute("height",Double.toString(height));
143         return(this);
144     }
145
146     /**
147         Suggested width of applet.
148         @param height suggested link width.
149     */

150     public Applet setWidth(String JavaDoc width)
151     {
152         addAttribute("width",width);
153         return(this);
154     }
155
156     /**
157         Suggested width of applet.
158         @param height suggested link width.
159     */

160     public Applet setWidth(int width)
161     {
162         addAttribute("width",Integer.toString(width));
163         return(this);
164     }
165
166     /**
167         Suggested width of object.
168         @param height suggested link width.
169     */

170     public Applet setWidth(double width)
171     {
172         addAttribute("width",Double.toString(width));
173         return(this);
174     }
175
176     /**
177         Suggested horizontal gutter.
178         @param hspace suggested horizontal gutter.
179     */

180     public Applet setHSpace(String JavaDoc hspace)
181     {
182         addAttribute("hspace",hspace);
183         return(this);
184     }
185
186     /**
187         Suggested horizontal gutter.
188         @param hspace suggested horizontal gutter.
189     */

190     public Applet setHSpace(int hspace)
191     {
192         addAttribute("hspace",Integer.toString(hspace));
193         return(this);
194     }
195
196     /**
197         Suggested horizontal gutter.
198         @param hspace suggested horizontal gutter.
199     */

200     public Applet setHSpace(double hspace)
201     {
202         addAttribute("hspace",Double.toString(hspace));
203         return(this);
204     }
205
206     /**
207         Suggested vertical gutter.
208         @param hspace suggested vertical gutter.
209     */

210     public Applet setVSpace(String JavaDoc vspace)
211     {
212         addAttribute("vspace",vspace);
213         return(this);
214     }
215
216     /**
217         Suggested vertical gutter.
218         @param hspace suggested vertical gutter.
219     */

220     public Applet setVSpace(int vspace)
221     {
222         addAttribute("vspace",Integer.toString(vspace));
223         return(this);
224     }
225
226     /**
227         Suggested vertical gutter.
228         @param hspace suggested vertical gutter.
229     */

230     public Applet setVSpace(double vspace)
231     {
232         addAttribute("vspace",Double.toString(vspace));
233         return(this);
234     }
235
236     /**
237         Set the horizontal or vertical alignment of this applet.<br>
238         Convience variables are in the AlignTypes interface.
239         @param alignment Set the horizontal or vertical alignment of this applet.<br>
240         Convience variables are in the AlignTypes interface.
241     */

242     public Applet setAlign(String JavaDoc alignment)
243     {
244         addAttribute("align",alignment);
245         return(this);
246     }
247
248     /**
249         Set the name of this applet.
250         @param name set the name of this applet.
251     */

252     public Applet setName(String JavaDoc name)
253     {
254         addAttribute("name",name);
255         return(this);
256     }
257
258     /**
259         Serialized applet file.
260         @param object Serialized applet file.
261     */

262     // someone give me a better description of what this does.
263
public Applet setObject(String JavaDoc object)
264     {
265         addAttribute("object",object);
266         return(this);
267     }
268
269     /**
270         Breif description, alternate text for the applet.
271         @param alt alternat text.
272     */

273     public Applet setAlt(String JavaDoc alt)
274     {
275         addAttribute("alt",alt);
276         return(this);
277     }
278     
279     /**
280         Adds an Element to the element.
281         @param hashcode name of element for hash table
282         @param element Adds an Element to the element.
283      */

284     public Applet addElement(String JavaDoc hashcode,Element element)
285     {
286         addElementToRegistry(hashcode,element);
287         return(this);
288     }
289
290     /**
291         Adds an Element to the element.
292         @param hashcode name of element for hash table
293         @param element Adds an Element to the element.
294      */

295     public Applet addElement(String JavaDoc hashcode,String JavaDoc element)
296     {
297         addElementToRegistry(hashcode,element);
298         return(this);
299     }
300     /**
301         Add an element to the element
302         @param element a string representation of the element
303     */

304     public Applet addElement(String JavaDoc element)
305     {
306         addElementToRegistry(element);
307         return(this);
308     }
309
310     /**
311         Add an element to the element
312         @param element an element to add
313     */

314     public Applet addElement(Element element)
315     {
316         addElementToRegistry(element);
317         return(this);
318     }
319     /**
320         Removes an Element from the element.
321         @param hashcode the name of the element to be removed.
322     */

323     public Applet removeElement(String JavaDoc hashcode)
324     {
325         removeElementFromRegistry(hashcode);
326         return(this);
327     }
328 }
329
Popular Tags