KickJava   Java API By Example, From Geeks To Geeks.

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


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  * GoogleMapIconTag
10  *
11  * This class represents a <googlemaps:icon> tag. Developers should not override this class.
12  *
13  * @author Tom Cole
14  * @version 0.40
15  */

16 public class GoogleMapIconTag extends TagSupport JavaDoc implements Serializable JavaDoc {
17
18     String JavaDoc icon = null;
19     String JavaDoc shadow = null;
20     int iconWidth = 0;
21     int iconHeight = 0;
22     int shadowWidth = 0;
23     int shadowHeight = 0;
24     int anchorX = 0;
25     int anchorY = 0;
26     int infoWindowAnchorX = 0;
27     int infoWindowAnchorY = 0;
28     /**
29      * Overrides doStartTag() from TagSupport. Developers should not override this method.
30      */

31     public int doStartTag() {
32         Tag JavaDoc tag = this;
33         while (tag.getParent() != null) {
34             if (tag.getParent() instanceof GoogleMapMarkerTag) {
35                 ((GoogleMapMarkerTag) tag.getParent()).setIcon(this);
36                 return SKIP_BODY;
37             }
38             else if (tag.getParent() instanceof GoogleMapTrafficTag) {
39                 ((GoogleMapTrafficTag) tag.getParent()).setIcon(this);
40                 return SKIP_BODY;
41             }
42             else if (tag.getParent() instanceof GoogleMapClusterTag) {
43                 ((GoogleMapClusterTag) tag.getParent()).setIcon(this);
44                 return SKIP_BODY;
45             }
46             tag = tag.getParent();
47         }
48         return SKIP_BODY;
49     }
50     /**
51      * Returns the anchor point for the icon's x axis.
52      *
53      * @return The anochor point x axis.
54      */

55     public int getAnchorX() {
56         return anchorX;
57     }
58     /**
59      * Sets the x axis value for the icon's anchor point. This is the point of the icon
60      * that is placed at the specified longitude/latitude of the parent marker's point.
61      *
62      * @param anchorX The x axis value for the anchor point.
63      */

64     public void setAnchorX(int anchorX) {
65         this.anchorX = anchorX;
66     }
67     /**
68      * Returns the anchor point for the icon's y axis.
69      *
70      * @return The anochor point y axis.
71      */

72     public int getAnchorY() {
73         return anchorY;
74     }
75     /**
76      * Sets the y axis value for the icon's anchor point. This is the point of the icon
77      * that is placed at the specified longitude/latitude of the parent marker's point.
78      *
79      * @param anchorY The y axis value for the anchor point.
80      */

81     public void setAnchorY(int anchorY) {
82         this.anchorY = anchorY;
83     }
84     /**
85      * Returns the url of the resource used as the image for this icon. This image
86      * should be 24-bit PNG with transparency for maximum effect.
87      *
88      * @return A url that points to an image.
89      */

90     public String JavaDoc getIcon() {
91         return icon;
92     }
93     /**
94      * Sets the url of the resource to be used as the image for this icon. This resouce
95      * should be 24-bit PNG with transparency for maximum effect.
96      *
97      * @param icon A url that points to an image.
98      */

99     public void setIcon(String JavaDoc icon) {
100         this.icon = icon;
101     }
102     /**
103      * Returns the height (in pixels) that this icon image should be rendered.
104      *
105      * @return An int specifying icon height.
106      */

107     public int getIconHeight() {
108         return iconHeight;
109     }
110     /**
111      * Sets the height (in pixels) that this icon image should be rendered.
112      *
113      * @param iconHeight An int specifying icon height.
114      */

115     public void setIconHeight(int iconHeight) {
116         this.iconHeight = iconHeight;
117     }
118     /**
119      * Returns the width (in pixels) that this icon image should be rendered.
120      *
121      * @return An int specifying icon width.
122      */

123     public int getIconWidth() {
124         return iconWidth;
125     }
126     /**
127      * Sets the width (in pixels) that this icon image should be rendered.
128      *
129      * @param iconWidth An int specifying icon width.
130      */

131     public void setIconWidth(int iconWidth) {
132         this.iconWidth = iconWidth;
133     }
134     /**
135      * Returns the x axis of where an info window will anchor itself to the icon.
136      *
137      * @return An int specifying x axis of info window anchor point.
138      */

139     public int getInfoWindowAnchorX() {
140         return infoWindowAnchorX;
141     }
142     /**
143      * Sets the x axis of where an info window will anchor itself to the icon.
144      *
145      * @param infoWindowAnchorX An int specifying x axis of info window anchor point.
146      */

147     public void setInfoWindowAnchorX(int infoWindowAnchorX) {
148         this.infoWindowAnchorX = infoWindowAnchorX;
149     }
150     /**
151      * Returns the y axis of where an info window will anchor itself to the icon.
152      *
153      * @return An int specifying y axis of info window anchor point.
154      */

155     public int getInfoWindowAnchorY() {
156         return infoWindowAnchorY;
157     }
158     /**
159      * Sets the y axis of where an info window will anchor itself to the icon.
160      *
161      * @param infoWindowAnchorY An int specifying y axis of info window anchor point.
162      */

163     public void setInfoWindowAnchorY(int infoWindowAnchorY) {
164         this.infoWindowAnchorY = infoWindowAnchorY;
165     }
166     /**
167      * Returns the url of the resource used as the image for this icon's shadow. This image
168      * should be 24-bit PNG with transparency for maximum effect.
169      *
170      * @return A url that points to an image.
171      */

172     public String JavaDoc getShadow() {
173         return shadow;
174     }
175     /**
176      * Sets the url of the resource to be used as the image for this icon's shadow. This resouce
177      * should be 24-bit PNG with transparency for maximum effect.
178      *
179      * @param icon A url that points to an image.
180      */

181     public void setShadow(String JavaDoc shadow) {
182         this.shadow = shadow;
183     }
184     /**
185      * Returns the height (in pixels) that this icon's shadow image should be rendered.
186      *
187      * @return An int specifying icon height.
188      */

189     public int getShadowHeight() {
190         return shadowHeight;
191     }
192     /**
193      * Sets the height (in pixels) that this icon's shadow image should be rendered.
194      *
195      * @param shadowHeight An int specifying icon height.
196      */

197     public void setShadowHeight(int shadowHeight) {
198         this.shadowHeight = shadowHeight;
199     }
200     /**
201      * Returns the width (in pixels) that this icon's shadow image should be rendered.
202      *
203      * @return An int specifying icon width.
204      */

205     public int getShadowWidth() {
206         return shadowWidth;
207     }
208     /**
209      * Sets the width (in pixels) that this icon's shadow image should be rendered.
210      *
211      * @param shadowWidth An int specifying icon width.
212      */

213     public void setShadowWidth(int shadowWidth) {
214         this.shadowWidth = shadowWidth;
215     }
216 }
217
Popular Tags