KickJava   Java API By Example, From Geeks To Geeks.

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


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  * GoogleMapScaleControlTag
10  *
11  * This class represents a <googlemaps;scaleControl> 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 GoogleMapScaleControlTag extends TagSupport JavaDoc implements Serializable JavaDoc {
18
19     boolean enable = false;
20     /**
21      * Overrides doEndTag() from TagSupport. Developers should not override this method.
22      */

23     public int doEndTag() {
24         Tag JavaDoc tag = this;
25         while (tag.getParent() != null) {
26             if (tag.getParent() instanceof GoogleMapTag) {
27                 ((GoogleMapTag) tag.getParent()).setScaleControl(this);
28                 return EVAL_PAGE;
29             }
30             tag = tag.getParent();
31         }
32         return EVAL_PAGE;
33     }
34     /**
35      * Denotes whether or not the map will allow the user to pan the map.
36      *
37      * @return True if users can pan the map, false if not.
38      */

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

48     public void setEnable(boolean enable) {
49         this.enable = enable;
50     }
51 }
52
Popular Tags