1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 68 public class Font extends MultiPartElement implements Printable 69 { 70 71 74 { 75 setElementType("font"); 76 } 77 78 81 public Font() 82 { 83 } 84 85 89 public Font(String face) 90 { 91 setFace(face); 92 } 93 94 100 public Font(String face,String color) 101 { 102 setFace(face); 103 setColor(color); 104 } 105 106 113 public Font(String face,String color,int size) 114 { 115 setFace(face); 116 setColor(color); 117 setSize(size); 118 } 119 120 125 public Font(int size) 126 { 127 setSize(size); 128 } 129 130 136 public Font(int size,String face) 137 { 138 setSize(size); 139 setFace(face); 140 } 141 142 148 public Font(String color,int size) 149 { 150 setSize(size); 151 setColor(color); 152 } 153 154 158 public Font setFace(String face) 159 { 160 addAttribute("face",face); 161 return(this); 162 } 163 164 168 public Font setColor(String color) 169 { 170 addAttribute("color",HtmlColor.convertColor(color)); 171 return(this); 172 } 173 174 178 public Font setSize(int size) 179 { 180 addAttribute("size",Integer.toString(size)); 181 return(this); 182 } 183 184 188 public Font setSize(String size) 189 { 190 addAttribute("size",size); 191 return(this); 192 } 193 194 199 public Font addElement(String hashcode,Element element) 200 { 201 addElementToRegistry(hashcode,element); 202 return(this); 203 } 204 205 210 public Font addElement(String hashcode,String element) 211 { 212 addElementToRegistry(hashcode,element); 213 return(this); 214 } 215 216 220 public Font addElement(Element element) 221 { 222 addElementToRegistry(element); 223 return(this); 224 } 225 226 230 public Font addElement(String element) 231 { 232 addElementToRegistry(element); 233 return(this); 234 } 235 239 public Font removeElement(String hashcode) 240 { 241 removeElementFromRegistry(hashcode); 242 return(this); 243 } 244 } 245 | Popular Tags |