1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class Body extends MultiPartElement implements Printable, PageEvents, MouseEvents, KeyEvents 70 { 71 74 { 75 setElementType("body"); 76 } 77 78 82 public Body() 83 { 84 } 85 86 91 public Body(String color) 92 { 93 setBgColor(color); 94 } 95 96 100 public Body setBgColor(String color) 101 { 102 addAttribute("bgcolor",HtmlColor.convertColor(color)); 103 return this; 104 } 105 106 110 public Body setBackground(String url) 111 { 112 addAttribute("background",url); 113 return this; 114 } 115 116 120 public Body setText(String text) 121 { 122 addAttribute("text",text); 123 return this; 124 } 125 126 130 public Body setLink(String color) 131 { 132 addAttribute("link",HtmlColor.convertColor(color)); 133 return this; 134 } 135 136 140 public Body setVlink(String color) 141 { 142 addAttribute("vlink",HtmlColor.convertColor(color)); 143 return this; 144 } 145 146 150 public Body setAlink(String color) 151 { 152 addAttribute("alink",HtmlColor.convertColor(color)); 153 return this; 154 } 155 156 161 public Body addElement(String hashcode,Element element) 162 { 163 addElementToRegistry(hashcode,element); 164 return(this); 165 } 166 167 172 public Body addElement(String hashcode,String element) 173 { 174 addElementToRegistry(hashcode,element); 175 return(this); 176 } 177 178 182 public Body addElement(Element element) 183 { 184 addElementToRegistry(element); 185 return(this); 186 } 187 191 public Body addElement(String element) 192 { 193 addElementToRegistry(element); 194 return(this); 195 } 196 200 public Body removeElement(String hashcode) 201 { 202 removeElementFromRegistry(hashcode); 203 return(this); 204 } 205 206 213 public void setOnLoad(String script) 214 { 215 addAttribute ( "onLoad", script ); 216 } 217 218 225 public void setOnUnload(String script) 226 { 227 addAttribute ( "onUnload", script ); 228 } 229 230 236 public void setOnClick(String script) 237 { 238 addAttribute ( "onClick", script ); 239 } 240 246 public void setOnDblClick(String script) 247 { 248 addAttribute ( "onDblClick", script ); 249 } 250 256 public void setOnMouseDown(String script) 257 { 258 addAttribute ( "onMouseDown", script ); 259 } 260 266 public void setOnMouseUp(String script) 267 { 268 addAttribute ( "onMouseUp", script ); 269 } 270 276 public void setOnMouseOver(String script) 277 { 278 addAttribute ( "onMouseOver", script ); 279 } 280 286 public void setOnMouseMove(String script) 287 { 288 addAttribute ( "onMouseMove", script ); 289 } 290 296 public void setOnMouseOut(String script) 297 { 298 addAttribute ( "onMouseOut", script ); 299 } 300 301 307 public void setOnKeyPress(String script) 308 { 309 addAttribute ( "onKeyPress", script ); 310 } 311 312 318 public void setOnKeyDown(String script) 319 { 320 addAttribute ( "onKeyDown", script ); 321 } 322 323 329 public void setOnKeyUp(String script) 330 { 331 addAttribute ( "onKeyUp", script ); 332 } 333 } 334 | Popular Tags |