KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.lamatek.tags.google;
2
3 import javax.servlet.jsp.tagext.Tag JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6 /**
7  * GoogleMapOverviewTag
8  *
9  * This class represents a <googlemaps:overviewControl> tag. Developers should not extend this
10  * class or override it's methods.
11  *
12  * @author Tom Cole
13  * @version 0.87
14  */

15 public class GoogleMapOverviewTag extends TagSupport JavaDoc {
16
17     int width = 200;
18     int height = 200;
19     int x = 0;
20     int y = 0;
21     boolean placed = false;
22     /**
23      * Overrides doStartTag() from TagSupport. Developers should not override this method.
24      *
25      */

26     public int doStartTag() {
27         Tag JavaDoc tag = this;
28         while (tag.getParent() != null) {
29             if (tag.getParent() instanceof GoogleMapTag) {
30                 ((GoogleMapTag) tag.getParent()).setOverviewControl(this);
31                 return EVAL_PAGE;
32             }
33             tag = tag.getParent();
34         }
35         return EVAL_PAGE;
36     }
37     /**
38      * Returns the desired height (in pixels) for the overview window.
39      *
40      * @return A height in pixels
41      */

42     public int getHeight() {
43         return height;
44     }
45     /**
46      * Sets the desired height (in pixels) for the overview window.
47      *
48      * @param height A height in pixels
49      */

50     public void setHeight(int height) {
51         this.height = height;
52     }
53     /**
54      * Returns the desired width (in pixels) for the overview window.
55      *
56      * @return A width in pixels
57      */

58     public int getWidth() {
59         return width;
60     }
61     /**
62      * Sets the desired width (in pixels) for the overview window.
63      *
64      * @param width A width in pixels
65      */

66     public void setWidth(int width) {
67         this.width = width;
68     }
69     /**
70      * Returns the desired x location (in pixels) for the overview window.
71      *
72      * @return A pixel location
73      */

74     public int getX() {
75         return x;
76     }
77     /**
78      * Sets the desired x location (in pixels) for the overview window.
79      *
80      * @param x The x location for the window
81      */

82     public void setX(int x) {
83         this.x = x;
84         placed = true;
85     }
86     /**
87      * Returns the desired y location (in pixels) for the overview window.
88      *
89      * @return A pixel location
90      */

91     public int getY() {
92         return y;
93     }
94     /**
95      * Sets the desired y location (in pixels) for the overview window.
96      *
97      * @param y The y location for the window
98      */

99     public void setY(int y) {
100         this.y = y;
101         placed = true;
102     }
103     /**
104      * Denotes whether or not the physical location of this overview has been
105      * physically placed, or using defaults.
106      *
107      * @return true if the x and y values have been set, false if they are default.
108      */

109     public boolean wasPlaced() {
110         return placed;
111     }
112 }
113
Popular Tags