KickJava   Java API By Example, From Geeks To Geeks.

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


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  * GoogleMapZoomControlTag
10  *
11  * This class represents a <googlemaps;zoomControl> tag. Developers should not subclass or override this
12  * class or it's methods.
13  *
14  * @author Tom Cole
15  * @version 0.40
16  */

17 public class GoogleMapZoomControlTag extends TagSupport JavaDoc implements Serializable JavaDoc {
18
19     boolean enable = false;
20     String JavaDoc size = "small";
21     
22     public int doEndTag() {
23         Tag JavaDoc tag = this;
24         while (tag.getParent() != null) {
25             if (tag.getParent() instanceof GoogleMapTag) {
26                 ((GoogleMapTag) tag.getParent()).setZoomControl(this);
27                 return EVAL_PAGE;
28             }
29             tag = tag.getParent();
30         }
31         return EVAL_PAGE;
32     }
33     /**
34      * Denotes whether or not the map will allow the user to pan the map.
35      *
36      * @return True if users can pan the map, false if not.
37      */

38     public boolean isEnable() {
39         return enable;
40     }
41     /**
42      * Sets whether or not users should be allowed to pan the map. If set to
43      * false, users can only see the section of map currently displayed.
44      *
45      * @param enable True to let users pan, false otherwise.
46      */

47     public void setEnable(boolean enable) {
48         this.enable = enable;
49     }
50     /**
51      * Returns the expected size of this control. 'small' means zoom in (+) and out (-) buttons
52      * only, 'large' includes a slider control as well.
53      *
54      * @return The current size description.
55      */

56     public String JavaDoc getSize() {
57         return size;
58     }
59     /**
60      * Sets the control size. 'small' means zoom in (+) and out (-) buttons
61      * only, 'large' includes a slider control as well.
62      *
63      * @param size 'small' for buttons only, 'large' for a slider.
64      */

65     public void setSize(String JavaDoc size) {
66         this.size = size;
67     }
68 }
69
Popular Tags