1 package com.lamatek.tags.google; 2 3 import javax.servlet.jsp.tagext.BodyTagSupport ; 4 import javax.servlet.jsp.tagext.Tag ; 5 6 import com.lamatek.tags.google.beans.EscapeChars; 7 8 14 public class GoogleMapLabelTag extends BodyTagSupport { 15 16 String point = null; 17 String css_class = null; 18 String style = null; 19 String content = null; 20 boolean html = true; 21 float opacity = 0.5f; 22 int x_offset = 0; 23 int y_offset = 0; 24 27 public int doStartTag() { 28 return EVAL_BODY_BUFFERED; 29 } 30 33 public int doEndTag() { 34 if (content == null) { 35 content = getBodyContent().getString().trim(); 36 if (html) 37 content = EscapeChars.escape(content); 38 } 39 Tag tag = this; 40 while (tag.getParent() != null) { 41 if (tag.getParent() instanceof GoogleMapTag) { 42 ((GoogleMapTag) tag.getParent()).addLabel(this); 43 return EVAL_PAGE; 44 } 45 tag = tag.getParent(); 46 } 47 return EVAL_PAGE; 48 } 49 53 public String getCss_class() { 54 return css_class; 55 } 56 59 public void setCss_class(String css_class) { 60 this.css_class = css_class; 61 } 62 65 public String getPoint() { 66 return point; 67 } 68 72 public void setPoint(String point) { 73 this.point = point; 74 } 75 78 public String getStyle() { 79 return style; 80 } 81 84 public void setStyle(String style) { 85 this.style = style; 86 } 87 90 public String getContent() { 91 return content; 92 } 93 96 public void setContent(String content) { 97 if (html) 98 this.content = EscapeChars.escape(content.trim()); 99 else 100 this.content = content.trim(); 101 } 102 105 public boolean isHtml() { 106 return html; 107 } 108 111 public void setHtml(boolean html) { 112 this.html = html; 113 } 114 117 public float getOpacity() { 118 return opacity; 119 } 120 123 public void setOpacity(float opacity) { 124 this.opacity = opacity; 125 } 126 130 public int getX_offset() { 131 return x_offset; 132 } 133 137 public void setX_offset(int x_offset) { 138 this.x_offset = x_offset; 139 } 140 144 public int getY_offset() { 145 return y_offset; 146 } 147 151 public void setY_offset(int y_offset) { 152 this.y_offset = y_offset; 153 } 154 } 155 | Popular Tags |