1 package com.lamatek.tags.google; 2 3 import java.util.StringTokenizer ; 4 import java.util.Vector ; 5 6 import javax.servlet.jsp.tagext.Tag ; 7 import javax.servlet.jsp.tagext.TagSupport ; 8 9 18 public class GoogleMapInsertTag extends TagSupport { 19 20 String id; 21 String point; 22 String url; 23 int baseZoom; 24 int width; 25 int height; 26 Vector maps = null; 27 String mapTypes = null; 28 33 public void setId(String id) { 34 this.id = id; 35 } 36 41 public String getId() { 42 return id; 43 } 44 51 public int getBaseZoom() { 52 return baseZoom; 53 } 54 60 public void setBaseZoom(int baseZoom) { 61 this.baseZoom = baseZoom; 62 } 63 68 public int getHeight() { 69 return height; 70 } 71 76 public void setHeight(int height) { 77 this.height = height; 78 } 79 84 public String getPoint() { 85 return point; 86 } 87 93 public void setPoint(String point) { 94 this.point = point; 95 } 96 101 public String getUrl() { 102 return url; 103 } 104 110 public void setUrl(String url) { 111 this.url = url; 112 } 113 118 public int getWidth() { 119 return width; 120 } 121 126 public void setWidth(int width) { 127 this.width = width; 128 } 129 134 public int doStartTag() { 135 Tag tag = this; 136 while (tag.getParent() != null) { 137 if (tag.getParent() instanceof GoogleMapTag) { 138 ((GoogleMapTag) tag.getParent()).addInsert(this); 139 return SKIP_BODY; 140 } 141 tag = tag.getParent(); 142 } 143 return SKIP_BODY; 144 } 145 152 public void addMapType(String mapType) { 153 if (maps == null) 154 maps = new Vector (); 155 maps.addElement(mapType); 156 } 157 168 public void setMapTypes(String mapTypes) { 169 this.mapTypes = mapTypes; 170 StringTokenizer t = new StringTokenizer (mapTypes, ","); 171 while (t.hasMoreTokens()) { 172 if (this.maps == null) 173 this.maps = new Vector (); 174 String mapType = t.nextToken().trim(); 175 this.maps.addElement(mapType); 176 } 177 } 178 185 public String getMapTypes() { 186 return mapTypes; 187 } 188 193 public int getMapTypeCount() { 194 if (maps == null) 195 return 0; 196 else 197 return maps.size(); 198 } 199 204 public String getMapType(int i) { 205 if (maps == null) 206 return null; 207 else 208 return (String ) maps.elementAt(i); 209 } 210 } 211 | Popular Tags |