KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lamatek > tags > google > GoogleMapEventTag


1 package com.lamatek.tags.google;
2
3 import java.io.Serializable JavaDoc;
4
5 import javax.servlet.jsp.tagext.Tag JavaDoc;
6 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
7
8 /**
9  * GoogleMapEventTag
10  *
11  * This class represents a <googlemaps:event> tag. Developers should not
12  * override this class.
13  *
14  * @author Tom Cole
15  * @version 0.40
16  */

17 public class GoogleMapEventTag extends TagSupport JavaDoc implements Serializable JavaDoc {
18     
19     String JavaDoc url = null;
20     String JavaDoc action = null;
21     boolean asynchronous = false;
22     /**
23      * Overrides doStartTag() from TagSupport. Developers should not override
24      * this method.
25      */

26     public int doStartTag() {
27         Tag JavaDoc tag = this;
28         while (tag.getParent() != null) {
29             if (tag.getParent() instanceof GoogleMapEventListener) {
30                 ((GoogleMapEventListener) tag.getParent()).addEvent(this);
31                 return SKIP_BODY;
32             }
33             tag = tag.getParent();
34         }
35         return SKIP_BODY;
36     }
37     /**
38      * Returns a url pointing to the Object that is responsible for handling this event.
39      *
40      * @return A URL string.
41      */

42     public String JavaDoc getUrl() {
43         return url;
44     }
45     /**
46      * Sets the url to the Object responsible for handling this event. The Object
47      * this url points to should implement the GoogleMapEventHandler interface.
48      *
49      * @param url The url that points to a GoogleMapEventHandler.
50      */

51     public void setUrl(String JavaDoc url) {
52         this.url = url;
53     }
54     /**
55      * Returns the action name that this event handles. Options vary depending on
56      * the component this is added to. The complete list is:
57      * <ul>
58      * <li>click</li>
59      * <li>dblclick</li>
60      * <li>moveend</li>
61      * <li>zoom</li>
62      * <li>maptypechanged</li>
63      * </ul>
64      *
65      * @return The action name for this event.
66      */

67     public String JavaDoc getAction() {
68         return action;
69     }
70     /**
71      * Sets the action name that this event handles. Options vary depending on
72      * the component this is added to. The complete list is:
73      * <ul>
74      * <li>click</li>
75      * <li>dblclick</li>
76      * <li>moveend</li>
77      * <li>zoom</li>
78      * <li>maptypechanged</li>
79      * <li>dragstart</li>
80      * <li>dragend</li>
81      * </ul>
82      *
83      * @return The action name for this event.
84      */

85     public void setAction(String JavaDoc action) {
86         this.action = action;
87     }
88     /**
89      * Denotes whether or not this event is to be handled asynchronously (through
90      * a GXmlHttp object) or synchronously (through a standard HTTP request.
91      *
92      * Asynchronous events do not affect or update the page, they simply send data
93      * to the GoogleMapEventHandler that is referred to by this event's url. This
94      * default behaviour is handled by the GoogleMapEventHandler if is has been
95      * subclassed properly. These are data only events.
96      *
97      * Synchronous events will reload the page, allowing the developer to add or
98      * remove markers, events, etc. before the map is re-rendered. These are for
99      * dynamic additions/subtractions from a map.
100      *
101      * @returns True if this event is asynchronous, false if it is not.
102      */

103     public boolean isAsynchronous() {
104         return asynchronous;
105     }
106     /**
107      * Sets whether or not this event is to be handled asynchronously (through
108      * a GXmlHttp object) or synchronously (through a standard HTTP request.
109      *
110      * Asynchronous events do not affect or update the page, they simply send data
111      * to the GoogleMapEventHandler that is referred to by this event's url. This
112      * default behaviour is handled by the GoogleMapEventHandler if is has been
113      * subclassed properly. These are data only events.
114      *
115      * Synchronous events will reload the page, allowing the developer to add or
116      * remove markers, events, etc. before the map is re-rendered. These are for
117      * dynamic additions/subtractions from a map.
118      *
119      * @param asynchronous True if this event is asynchronous, false if it is not.
120      */

121     public void setAsynchronous(boolean asynchronous) {
122         this.asynchronous = asynchronous;
123     }
124 }
125
Popular Tags