1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 import java.io.OutputStream ; 63 import java.io.PrintWriter ; 64 import java.io.IOException ; 65 import java.util.Enumeration ; 66 67 74 public class HR extends SinglePartElement implements Printable, MouseEvents, KeyEvents 75 { 76 79 { 80 setElementType("hr"); 81 } 82 83 86 public HR() 87 { 88 } 89 90 95 public HR(String width) 96 { 97 setWidth(width); 98 } 99 100 105 public HR(int width) 106 { 107 setWidth(width); 108 } 109 110 116 public HR(String width, String align) 117 { 118 setWidth(width); 119 setAlign(align); 120 } 121 122 128 public HR(int width, String align) 129 { 130 setWidth(width); 131 setAlign(align); 132 } 133 134 141 public HR(String width, String align, String size) 142 { 143 setWidth(width); 144 setAlign(align); 145 setSize(size); 146 } 147 148 155 public HR(String width, String align, int size) 156 { 157 setWidth(width); 158 setAlign(align); 159 setSize(size); 160 } 161 162 169 public HR(int width, String align, int size) 170 { 171 setWidth(width); 172 setAlign(align); 173 setSize(size); 174 } 175 176 180 public HR setWidth(String width) 181 { 182 addAttribute("width",width); 183 return this; 184 } 185 186 190 public HR setWidth(int width) 191 { 192 addAttribute("width",Integer.toString(width)); 193 return this; 194 } 195 196 200 public HR setAlign(String align) 201 { 202 addAttribute("align",align); 203 return this; 204 } 205 206 210 public HR setSize(String size) 211 { 212 addAttribute("size",size); 213 return this; 214 } 215 216 220 public HR setSize(int size) 221 { 222 addAttribute("size",Integer.toString(size)); 223 return this; 224 } 225 226 230 public HR setNoShade(boolean shade) 231 { 232 if ( shade == true ) 233 addAttribute("noshade", NO_ATTRIBUTE_VALUE); 234 else 235 removeAttribute("noshade"); 236 237 return(this); 238 } 239 240 245 public HR addElement(String hashcode,Element element) 246 { 247 addElementToRegistry(hashcode,element); 248 return(this); 249 } 250 251 256 public HR addElement(String hashcode,String element) 257 { 258 addElementToRegistry(hashcode,element); 259 return(this); 260 } 261 262 266 public HR addElement(Element element) 267 { 268 addElementToRegistry(element); 269 return(this); 270 } 271 275 public HR addElement(String element) 276 { 277 addElementToRegistry(element); 278 return(this); 279 } 280 284 public HR removeElement(String hashcode) 285 { 286 removeElementFromRegistry(hashcode); 287 return(this); 288 } 289 290 296 public void setOnClick(String script) 297 { 298 addAttribute ( "onClick", script ); 299 } 300 306 public void setOnDblClick(String script) 307 { 308 addAttribute ( "onDblClick", script ); 309 } 310 316 public void setOnMouseDown(String script) 317 { 318 addAttribute ( "onMouseDown", script ); 319 } 320 326 public void setOnMouseUp(String script) 327 { 328 addAttribute ( "onMouseUp", script ); 329 } 330 336 public void setOnMouseOver(String script) 337 { 338 addAttribute ( "onMouseOver", script ); 339 } 340 346 public void setOnMouseMove(String script) 347 { 348 addAttribute ( "onMouseMove", script ); 349 } 350 356 public void setOnMouseOut(String script) 357 { 358 addAttribute ( "onMouseOut", script ); 359 } 360 361 367 public void setOnKeyPress(String script) 368 { 369 addAttribute ( "onKeyPress", script ); 370 } 371 372 378 public void setOnKeyDown(String script) 379 { 380 addAttribute ( "onKeyDown", script ); 381 } 382 383 389 public void setOnKeyUp(String script) 390 { 391 addAttribute ( "onKeyUp", script ); 392 } 393 } 394 | Popular Tags |