KickJava   Java API By Example, From Geeks To Geeks.

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


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;map&gt; tag.
64
65     @version $Id: map.java,v 1.2 2003/04/27 09:41:34 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 map extends MultiPartElement implements Printable, FocusEvents, MouseEvents, KeyEvents
71 {
72     /**
73         Private initialization routine.
74     */

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

83     public map()
84     {
85     }
86
87     /**
88         Basic constructor.
89         @param element Adds an Element to the element.
90     */

91     public map(Element element)
92     {
93         addElement(element);
94     }
95
96     /**
97         Basic constructor.
98         @param element Adds an Element to the element.
99     */

100     public map(String JavaDoc element)
101     {
102         addElement(element);
103     }
104
105     /**
106         Basic constructor.
107         @param element Adds an Element to the element.
108         @param name sets the name="" attribute
109     */

110     public map(Element element, String JavaDoc name)
111     {
112         addElement(element);
113         setName ( name );
114     }
115
116     /**
117         Basic constructor.
118         @param element Adds an Element to the element.
119         @param name sets the name="" attribute
120     */

121     public map(String JavaDoc element, String JavaDoc name)
122     {
123         addElement(element);
124         setName ( name );
125     }
126
127     /**
128         Sets the name="" attribute
129         @param name the name="" attribute
130     */

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

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

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

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

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

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

193     public map removeElement(String JavaDoc hashcode)
194     {
195         removeElementFromRegistry(hashcode);
196         return(this);
197     }
198
199     /**
200         The onfocus event occurs when an element receives focus either by the
201         pointing device or by tabbing navigation. This attribute may be used
202         with the following elements: LABEL, INPUT, SELECT, TEXTAREA, and
203         BUTTON.
204         
205         @param The script
206     */

207     public void setOnFocus(String JavaDoc script)
208     {
209         addAttribute ( "onfocus", script );
210     }
211
212     /**
213         The onblur event occurs when an element loses focus either by the
214         pointing device or by tabbing navigation. It may be used with the same
215         elements as onfocus.
216         
217         @param The script
218     */

219     public void setOnBlur(String JavaDoc script)
220     {
221         addAttribute ( "onblur", script );
222     }
223
224     /**
225         The onclick event occurs when the pointing device button is clicked
226         over an element. This attribute may be used with most elements.
227         
228         @param The script
229     */

230     public void setOnClick(String JavaDoc script)
231     {
232         addAttribute ( "onclick", script );
233     }
234     /**
235         The ondblclick event occurs when the pointing device button is double
236         clicked over an element. This attribute may be used with most elements.
237
238         @param The script
239     */

240     public void setOnDblClick(String JavaDoc script)
241     {
242         addAttribute ( "ondblclick", script );
243     }
244     /**
245         The onmousedown event occurs when the pointing device button is pressed
246         over an element. This attribute may be used with most elements.
247
248         @param The script
249     */

250     public void setOnMouseDown(String JavaDoc script)
251     {
252         addAttribute ( "onmousedown", script );
253     }
254     /**
255         The onmouseup event occurs when the pointing device button is released
256         over an element. This attribute may be used with most elements.
257
258         @param The script
259     */

260     public void setOnMouseUp(String JavaDoc script)
261     {
262         addAttribute ( "onmouseup", script );
263     }
264     /**
265         The onmouseover event occurs when the pointing device is moved onto an
266         element. This attribute may be used with most elements.
267
268         @param The script
269     */

270     public void setOnMouseOver(String JavaDoc script)
271     {
272         addAttribute ( "onmouseover", script );
273     }
274     /**
275         The onmousemove event occurs when the pointing device is moved while it
276         is over an element. This attribute may be used with most elements.
277
278         @param The script
279     */

280     public void setOnMouseMove(String JavaDoc script)
281     {
282         addAttribute ( "onmousemove", script );
283     }
284     /**
285         The onmouseout event occurs when the pointing device is moved away from
286         an element. This attribute may be used with most elements.
287
288         @param The script
289     */

290     public void setOnMouseOut(String JavaDoc script)
291     {
292         addAttribute ( "onmouseout", script );
293     }
294
295     /**
296         The onkeypress event occurs when a key is pressed and released over an
297         element. This attribute may be used with most elements.
298         
299         @param The script
300     */

301     public void setOnKeyPress(String JavaDoc script)
302     {
303         addAttribute ( "onkeypress", script );
304     }
305
306     /**
307         The onkeydown event occurs when a key is pressed down over an element.
308         This attribute may be used with most elements.
309         
310         @param The script
311     */

312     public void setOnKeyDown(String JavaDoc script)
313     {
314         addAttribute ( "onkeydown", script );
315     }
316
317     /**
318         The onkeyup event occurs when a key is released over an element. This
319         attribute may be used with most elements.
320         
321         @param The script
322     */

323     public void setOnKeyUp(String JavaDoc script)
324     {
325         addAttribute ( "onkeyup", script );
326     }
327 }
328
Popular Tags