KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > xhtml > legend


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.xhtml;
59
60 import org.apache.ecs.*;
61
62 /**
63     This class creates a &lt;legend&gt; tag.
64
65     @version $Id: legend.java,v 1.2 2003/04/27 09:39:11 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     @author <a HREF="mailto:bojan@binarix.com">Bojan Smojver</a>
69 */

70 public class legend extends MultiPartElement implements Printable, MouseEvents, KeyEvents
71 {
72     /**
73         private initializer.
74     */

75     {
76         setElementType("legend");
77         setCase(LOWERCASE);
78         setAttributeQuote(true);
79     }
80
81     /**
82         Basic constructor. Use set* methods.
83     */

84     public legend()
85     {
86     }
87
88     /**
89         Basic Constructor use set* methods.
90         @param element sets the value
91     */

92     public legend(String JavaDoc value)
93     {
94         addElement(value);
95     }
96
97     /**
98         Basic Constructor use set* methods.
99         @param element sets the value
100     */

101     public legend(Element value)
102     {
103         addElement(value);
104     }
105
106     /**
107         Basic Constructor use set* methods.
108         @param element sets the value
109         @param accesskey sets the accesskey="" attribute.
110     */

111     public legend(String JavaDoc value, String JavaDoc accesskey)
112     {
113         addElement(value);
114         setAccessKey(accesskey);
115     }
116
117     /**
118         Basic Constructor use set* methods.
119         @param element sets the value
120         @param accesskey sets the accesskey="" attribute.
121     */

122     public legend(Element value, String JavaDoc accesskey)
123     {
124         addElement(value);
125         setAccessKey(accesskey);
126     }
127
128     /**
129         Sets the accesskey="" attribute.
130         @param accesskey sets the accesskey="" attribute.
131     */

132     public legend setAccessKey(String JavaDoc accesskey)
133     {
134         addAttribute("accesskey",accesskey);
135         return(this);
136     }
137
138     /**
139         Sets the lang="" and xml:lang="" attributes
140         @param lang the lang="" and xml:lang="" attributes
141     */

142     public Element setLang(String JavaDoc lang)
143     {
144         addAttribute("lang",lang);
145         addAttribute("xml:lang",lang);
146         return this;
147     }
148
149     /**
150         Adds an Element to the element.
151         @param hashcode name of element for hash table
152         @param element Adds an Element to the element.
153      */

154     public legend addElement(String JavaDoc hashcode,Element element)
155     {
156         addElementToRegistry(hashcode,element);
157         return(this);
158     }
159
160     /**
161         Adds an Element to the element.
162         @param hashcode name of element for hash table
163         @param element Adds an Element to the element.
164      */

165     public legend addElement(String JavaDoc hashcode,String JavaDoc element)
166     {
167         addElementToRegistry(hashcode,element);
168         return(this);
169     }
170
171     /**
172         Adds an Element to the element.
173         @param element Adds an Element to the element.
174      */

175     public legend addElement(Element element)
176     {
177         addElementToRegistry(element);
178         return(this);
179     }
180
181     /**
182         Adds an Element to the element.
183         @param element Adds an Element to the element.
184      */

185     public legend addElement(String JavaDoc element)
186     {
187         addElementToRegistry(element);
188         return(this);
189     }
190     /**
191         Removes an Element from the element.
192         @param hashcode the name of the element to be removed.
193     */

194     public legend removeElement(String JavaDoc hashcode)
195     {
196         removeElementFromRegistry(hashcode);
197         return(this);
198     }
199
200     /**
201         The onclick event occurs when the pointing device button is clicked
202         over an element. This attribute may be used with most elements.
203         
204         @param The script
205     */

206     public void setOnClick(String JavaDoc script)
207     {
208         addAttribute ( "onclick", script );
209     }
210     /**
211         The ondblclick event occurs when the pointing device button is double
212         clicked over an element. This attribute may be used with most elements.
213
214         @param The script
215     */

216     public void setOnDblClick(String JavaDoc script)
217     {
218         addAttribute ( "ondblclick", script );
219     }
220     /**
221         The onmousedown event occurs when the pointing device button is pressed
222         over an element. This attribute may be used with most elements.
223
224         @param The script
225     */

226     public void setOnMouseDown(String JavaDoc script)
227     {
228         addAttribute ( "onmousedown", script );
229     }
230     /**
231         The onmouseup event occurs when the pointing device button is released
232         over an element. This attribute may be used with most elements.
233
234         @param The script
235     */

236     public void setOnMouseUp(String JavaDoc script)
237     {
238         addAttribute ( "onmouseup", script );
239     }
240     /**
241         The onmouseover event occurs when the pointing device is moved onto an
242         element. This attribute may be used with most elements.
243
244         @param The script
245     */

246     public void setOnMouseOver(String JavaDoc script)
247     {
248         addAttribute ( "onmouseover", script );
249     }
250     /**
251         The onmousemove event occurs when the pointing device is moved while it
252         is over an element. This attribute may be used with most elements.
253
254         @param The script
255     */

256     public void setOnMouseMove(String JavaDoc script)
257     {
258         addAttribute ( "onmousemove", script );
259     }
260     /**
261         The onmouseout event occurs when the pointing device is moved away from
262         an element. This attribute may be used with most elements.
263
264         @param The script
265     */

266     public void setOnMouseOut(String JavaDoc script)
267     {
268         addAttribute ( "onmouseout", script );
269     }
270
271     /**
272         The onkeypress event occurs when a key is pressed and released over an
273         element. This attribute may be used with most elements.
274         
275         @param The script
276     */

277     public void setOnKeyPress(String JavaDoc script)
278     {
279         addAttribute ( "onkeypress", script );
280     }
281
282     /**
283         The onkeydown event occurs when a key is pressed down over an element.
284         This attribute may be used with most elements.
285         
286         @param The script
287     */

288     public void setOnKeyDown(String JavaDoc script)
289     {
290         addAttribute ( "onkeydown", script );
291     }
292
293     /**
294         The onkeyup event occurs when a key is released over an element. This
295         attribute may be used with most elements.
296         
297         @param The script
298     */

299     public void setOnKeyUp(String JavaDoc script)
300     {
301         addAttribute ( "onkeyup", script );
302     }
303 }
304
Popular Tags