1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class area extends SinglePartElement implements Printable, FocusEvents, MouseEvents, KeyEvents 71 { 72 public static final String DEFAULT = "default"; 73 74 public static final String rect = "rect"; 75 public static final String circle = "circle"; 76 public static final String poly = "poly"; 77 78 81 { 82 setElementType("area"); 83 setCase(LOWERCASE); 84 setAttributeQuote(true); 85 setBeginEndModifier('/'); 86 setNoHref(true); 87 } 88 89 93 public area() 94 { 95 } 96 97 103 public area(String shape) 104 { 105 setShape(shape); 106 } 107 108 115 public area(String shape, String coords) 116 { 117 setShape(shape); 118 setCoords(coords); 119 } 120 121 128 public area(String shape, int[] coords) 129 { 130 setShape(shape); 131 setCoords(coords); 132 } 133 134 142 public area(String shape, String coords, String href) 143 { 144 setShape(shape); 145 setCoords(coords); 146 setHref(href); 147 } 148 149 157 public area(String shape, int[] coords, String href) 158 { 159 setShape(shape); 160 setCoords(coords); 161 setHref(href); 162 } 163 164 168 public area setShape(String shape) 169 { 170 addAttribute("shape",shape); 171 return this; 172 } 173 174 178 public area setCoords(String coords) 179 { 180 addAttribute("coords",coords); 181 return this; 182 } 183 184 188 public area setCoords(int[] coords) 189 { 190 addAttribute("coords", coords[0] + "," + coords[1] + "," + 191 coords[2] + "," + coords[3]); 192 return this; 193 } 194 195 199 public area setHref(String href) 200 { 201 addAttribute("href",href); 202 setNoHref(false); 203 return this; 204 } 205 206 210 public area setAlt(String alt) 211 { 212 addAttribute("alt",alt); 213 return this; 214 } 215 216 220 public area setTabindex(String index) 221 { 222 addAttribute("tabindex",index); 223 return this; 224 } 225 226 230 public area setTabindex(int index) 231 { 232 setTabindex(Integer.toString(index)); 233 return this; 234 } 235 236 240 public area setNoHref(boolean href) 241 { 242 if ( href == true ) 243 addAttribute("nohref", "nohref"); 244 else 245 removeAttribute("nohref"); 246 247 return(this); 248 } 249 250 254 public Element setLang(String lang) 255 { 256 addAttribute("lang",lang); 257 addAttribute("xml:lang",lang); 258 return this; 259 } 260 261 266 public area addElement(String hashcode,Element element) 267 { 268 addElementToRegistry(hashcode,element); 269 return(this); 270 } 271 272 277 public area addElement(String hashcode,String element) 278 { 279 addElementToRegistry(hashcode,element); 280 return(this); 281 } 282 283 287 public area addElement(String element) 288 { 289 addElementToRegistry(element); 290 return(this); 291 } 292 293 297 public area addElement(Element element) 298 { 299 addElementToRegistry(element); 300 return(this); 301 } 302 306 public area removeElement(String hashcode) 307 { 308 removeElementFromRegistry(hashcode); 309 return(this); 310 } 311 312 320 public void setOnFocus(String script) 321 { 322 addAttribute ( "onfocus", script ); 323 } 324 325 332 public void setOnBlur(String script) 333 { 334 addAttribute ( "onblur", script ); 335 } 336 337 343 public void setOnClick(String script) 344 { 345 addAttribute ( "onclick", script ); 346 } 347 353 public void setOnDblClick(String script) 354 { 355 addAttribute ( "ondblclick", script ); 356 } 357 363 public void setOnMouseDown(String script) 364 { 365 addAttribute ( "onmousedown", script ); 366 } 367 373 public void setOnMouseUp(String script) 374 { 375 addAttribute ( "onmouseup", script ); 376 } 377 383 public void setOnMouseOver(String script) 384 { 385 addAttribute ( "onmouseover", script ); 386 } 387 393 public void setOnMouseMove(String script) 394 { 395 addAttribute ( "onmousemove", script ); 396 } 397 403 public void setOnMouseOut(String script) 404 { 405 addAttribute ( "onmouseout", script ); 406 } 407 408 414 public void setOnKeyPress(String script) 415 { 416 addAttribute ( "onkeypress", script ); 417 } 418 419 425 public void setOnKeyDown(String script) 426 { 427 addAttribute ( "onkeydown", script ); 428 } 429 430 436 public void setOnKeyUp(String script) 437 { 438 addAttribute ( "onkeyup", script ); 439 } 440 } 441 | Popular Tags |