1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class ObjectElement extends MultiPartElement implements Printable, MouseEvents, KeyEvents 70 { 71 74 { 75 setElementType("object"); 76 } 77 78 82 public ObjectElement() 83 { 84 } 85 86 90 public ObjectElement setDeclare(boolean declare) 91 { 92 if(declare) 93 addAttribute("declare",NO_ATTRIBUTE_VALUE); 94 else 95 removeAttribute("declare"); 96 return(this); 97 } 98 99 103 public ObjectElement setClassId(String url) 104 { 105 addAttribute("classid",url); 106 return(this); 107 } 108 109 113 public ObjectElement setCodeType(String codetype) 114 { 115 addAttribute("codetype",codetype); 116 return(this); 117 } 118 119 123 public ObjectElement setCodeBase(String url) 124 { 125 addAttribute("codebase",url); 126 return(this); 127 } 128 129 133 public ObjectElement setData(String url) 134 { 135 addAttribute("data",url); 136 return(this); 137 } 138 139 144 public ObjectElement setType(String type) 145 { 146 addAttribute("type",type); 147 return(this); 148 } 149 150 154 public ObjectElement setArchive(String url) 156 { 157 addAttribute("archive",url); 158 return(this); 159 } 160 161 165 public ObjectElement setStandBy(String cdata) 166 { 167 addAttribute("standby",cdata); 168 return(this); 169 } 170 171 175 public ObjectElement setBorder(String border) 176 { 177 addAttribute("border",border); 178 return(this); 179 } 180 181 185 public ObjectElement setBorder(int border) 186 { 187 addAttribute("border",Integer.toString(border)); 188 return(this); 189 } 190 191 195 public ObjectElement setBorder(double border) 196 { 197 addAttribute("border",Double.toString(border)); 198 return(this); 199 } 200 201 205 public ObjectElement setHeight(String height) 206 { 207 addAttribute("height",height); 208 return(this); 209 } 210 211 215 public ObjectElement setHeight(int height) 216 { 217 addAttribute("height",Integer.toString(height)); 218 return(this); 219 } 220 221 225 public ObjectElement setHeight(double height) 226 { 227 addAttribute("height",Double.toString(height)); 228 return(this); 229 } 230 231 235 public ObjectElement setWidth(String width) 236 { 237 addAttribute("width",width); 238 return(this); 239 } 240 241 245 public ObjectElement setWidth(int width) 246 { 247 addAttribute("width",Integer.toString(width)); 248 return(this); 249 } 250 251 255 public ObjectElement setWidth(double width) 256 { 257 addAttribute("width",Double.toString(width)); 258 return(this); 259 } 260 261 265 public ObjectElement setHSpace(String hspace) 266 { 267 addAttribute("hspace",hspace); 268 return(this); 269 } 270 271 275 public ObjectElement setHSpace(int hspace) 276 { 277 addAttribute("hspace",Integer.toString(hspace)); 278 return(this); 279 } 280 281 285 public ObjectElement setHSpace(double hspace) 286 { 287 addAttribute("hspace",Double.toString(hspace)); 288 return(this); 289 } 290 291 295 public ObjectElement setVSpace(String vspace) 296 { 297 addAttribute("vspace",vspace); 298 return(this); 299 } 300 301 305 public ObjectElement setVSpace(int vspace) 306 { 307 addAttribute("vspace",Integer.toString(vspace)); 308 return(this); 309 } 310 311 315 public ObjectElement setVSpace(double vspace) 316 { 317 addAttribute("vspace",Double.toString(vspace)); 318 return(this); 319 } 320 321 327 public ObjectElement setAlign(String alignment) 328 { 329 addAttribute("align",alignment); 330 return(this); 331 } 332 333 337 public ObjectElement setUseMap(String url) 338 { 339 addAttribute("usemap",url); 340 return(this); 341 } 342 343 347 public ObjectElement setShapes(boolean shape) 348 { 349 if(shape) 350 addAttribute("shapes",NO_ATTRIBUTE_VALUE); 351 else 352 removeAttribute("shapes"); 353 return(this); 354 } 355 356 360 public ObjectElement setName(String name) 361 { 362 addAttribute("name",name); 363 return(this); 364 } 365 366 370 public ObjectElement setTabIndex(int number) 371 { 372 addAttribute("tabindex",Integer.toString(number)); 373 return(this); 374 } 375 376 380 public ObjectElement setTabIndex(String number) 381 { 382 addAttribute("tabindex",number); 383 return(this); 384 } 385 386 391 public ObjectElement addElement(String hashcode,Element element) 392 { 393 addElementToRegistry(hashcode,element); 394 return(this); 395 } 396 397 402 public ObjectElement addElement(String hashcode,String element) 403 { 404 addElementToRegistry(hashcode,element); 405 return(this); 406 } 407 408 412 public ObjectElement addElement(String element) 413 { 414 addElementToRegistry(element); 415 return(this); 416 } 417 418 422 public ObjectElement addElement(Element element) 423 { 424 addElementToRegistry(element); 425 return(this); 426 } 427 431 public ObjectElement removeElement(String hashcode) 432 { 433 removeElementFromRegistry(hashcode); 434 return(this); 435 } 436 437 443 public void setOnClick(String script) 444 { 445 addAttribute ( "onClick", script ); 446 } 447 453 public void setOnDblClick(String script) 454 { 455 addAttribute ( "onDblClick", script ); 456 } 457 463 public void setOnMouseDown(String script) 464 { 465 addAttribute ( "onMouseDown", script ); 466 } 467 473 public void setOnMouseUp(String script) 474 { 475 addAttribute ( "onMouseUp", script ); 476 } 477 483 public void setOnMouseOver(String script) 484 { 485 addAttribute ( "onMouseOver", script ); 486 } 487 493 public void setOnMouseMove(String script) 494 { 495 addAttribute ( "onMouseMove", script ); 496 } 497 503 public void setOnMouseOut(String script) 504 { 505 addAttribute ( "onMouseOut", script ); 506 } 507 508 514 public void setOnKeyPress(String script) 515 { 516 addAttribute ( "onKeyPress", script ); 517 } 518 519 525 public void setOnKeyDown(String script) 526 { 527 addAttribute ( "onKeyDown", script ); 528 } 529 530 536 public void setOnKeyUp(String script) 537 { 538 addAttribute ( "onKeyUp", script ); 539 } 540 } 541 | Popular Tags |