1 package com.lamatek.tags.google; 2 3 import java.io.Serializable ; 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 GoogleMapBoxTag extends TagSupport implements Serializable , GoogleMapEventListener { 19 20 String color = "#ff0000"; 21 int weight = 2; 22 float opacity = 0.50f; 23 String pointlist = null; 24 Vector points = null; 25 Vector events = null; 26 29 public int doStartTag() { 30 Tag tag = this; 31 while (tag.getParent() != null) { 32 if (tag.getParent() instanceof GoogleMapTag) { 33 ((GoogleMapTag) tag.getParent()).addBox(this); 34 return SKIP_BODY; 35 } 36 tag = tag.getParent(); 37 } 38 return SKIP_BODY; 39 } 40 45 public void setColor(String color) { 46 this.color = color; 47 } 48 53 public void setWeight(int weight) { 54 this.weight = weight; 55 } 56 61 public float getOpacity() { 62 return opacity; 63 } 64 69 public void setOpacity(float opacity) { 70 this.opacity = opacity; 71 } 72 77 public String getPointlist() { 78 return pointlist; 79 } 80 85 public void setPointlist(String pointlist) { 86 this.pointlist = pointlist; 87 points = new Vector (); 88 String [] p = pointlist.split(","); 89 for (int i = 0; i < p.length; i++) { 90 points.add(p[i].trim()); 91 } 92 } 93 98 public int pointCount() { 99 if (points == null) 100 return 0; 101 else 102 return points.size(); 103 } 104 110 public String getPoint(int p) { 111 if (points == null) 112 return null; 113 else 114 return (String ) points.elementAt(p); 115 } 116 121 public String getColor() { 122 return color; 123 } 124 129 public int getWeight() { 130 return weight; 131 } 132 137 public void addEvent(GoogleMapEventTag event) { 138 if (events == null) 139 events = new Vector (); 140 events.add(event); 141 } 142 148 public Vector getEvents() { 149 return events; 150 } 151 } 152 | Popular Tags |