1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class img extends SinglePartElement implements Printable, MouseEvents, KeyEvents 71 { 72 75 76 { 77 setElementType("img"); 78 setCase(LOWERCASE); 79 setAttributeQuote(true); 80 setBeginEndModifier('/'); 81 } 82 83 86 public img() 87 { 88 } 89 90 95 public img(String src) 96 { 97 setSrc(src); 98 } 99 100 106 public img(String src, int border) 107 { 108 setSrc(src); 109 setBorder(border); 110 } 111 112 118 public img(String src, String name) 119 { 120 setSrc(src); 121 setName(name); 122 } 123 124 131 public img(String src, String name, int border) 132 { 133 setSrc(src); 134 setName(name); 135 setBorder(border); 136 } 137 138 142 public img setSrc(String src) 143 { 144 addAttribute("src",src); 145 return this; 146 } 147 148 152 public img setBorder(int border) 153 { 154 addAttribute("border",Integer.toString(border)); 155 return this; 156 } 157 158 162 public img setName(String name) 163 { 164 addAttribute("name",name); 165 return this; 166 } 167 168 172 public img setHeight(String height) 173 { 174 addAttribute("height",height); 175 return this; 176 } 177 178 182 public img setHeight(int height) 183 { 184 addAttribute("height",Integer.toString(height)); 185 return this; 186 } 187 188 192 public img setWidth(String width) 193 { 194 addAttribute("width",width); 195 return this; 196 } 197 198 202 public img setWidth(int width) 203 { 204 addAttribute("width",Integer.toString(width)); 205 return this; 206 } 207 208 212 public img setAlt(String alt) 213 { 214 addAttribute("alt",alt); 215 return this; 216 } 217 218 222 public img setIsMap(boolean ismap) 223 { 224 if(ismap == true) 225 addAttribute("ismap","ismap"); 226 else 227 removeAttribute("ismap"); 228 229 return this; 230 } 231 232 236 public img setUseMap(String usemap) 237 { 238 addAttribute("usemap",usemap); 239 return this; 240 } 241 242 246 public img setAlign(String align) 247 { 248 addAttribute("align",align); 249 return this; 250 } 251 252 256 public img setHspace(String hspace) 257 { 258 addAttribute("hspace",hspace); 259 return this; 260 } 261 262 266 public img setHspace(int hspace) 267 { 268 addAttribute("hspace",Integer.toString(hspace)); 269 return this; 270 } 271 272 276 public img setVspace(String vspace) 277 { 278 addAttribute("vspace",vspace); 279 return this; 280 } 281 282 286 public img setVspace(int vspace) 287 { 288 addAttribute("vspace",Integer.toString(vspace)); 289 return this; 290 } 291 292 296 public Element setLang(String lang) 297 { 298 addAttribute("lang",lang); 299 addAttribute("xml:lang",lang); 300 return this; 301 } 302 303 308 public img addElement(String hashcode,Element element) 309 { 310 addElementToRegistry(hashcode,element); 311 return(this); 312 } 313 314 319 public img addElement(String hashcode,String element) 320 { 321 addElementToRegistry(hashcode,element); 322 return(this); 323 } 324 325 329 public img addElement(Element element) 330 { 331 addElementToRegistry(element); 332 return(this); 333 } 334 335 339 public img addElement(String element) 340 { 341 addElementToRegistry(element); 342 return(this); 343 } 344 348 public img removeElement(String hashcode) 349 { 350 removeElementFromRegistry(hashcode); 351 return(this); 352 } 353 354 360 public void setOnClick(String script) 361 { 362 addAttribute ( "onclick", script ); 363 } 364 370 public void setOnDblClick(String script) 371 { 372 addAttribute ( "ondblclick", script ); 373 } 374 380 public void setOnMouseDown(String script) 381 { 382 addAttribute ( "onmousedown", script ); 383 } 384 390 public void setOnMouseUp(String script) 391 { 392 addAttribute ( "onmouseup", script ); 393 } 394 400 public void setOnMouseOver(String script) 401 { 402 addAttribute ( "onmouseover", script ); 403 } 404 410 public void setOnMouseMove(String script) 411 { 412 addAttribute ( "onmousemove", script ); 413 } 414 420 public void setOnMouseOut(String script) 421 { 422 addAttribute ( "onmouseout", script ); 423 } 424 425 431 public void setOnKeyPress(String script) 432 { 433 addAttribute ( "onkeypress", script ); 434 } 435 436 442 public void setOnKeyDown(String script) 443 { 444 addAttribute ( "onkeydown", script ); 445 } 446 447 453 public void setOnKeyUp(String script) 454 { 455 addAttribute ( "onkeyup", script ); 456 } 457 } 458 | Popular Tags |