1 19 20 25 26 package org.netbeans.modules.css.visual.model; 27 28 import javax.swing.DefaultComboBoxModel ; 29 30 35 public class TextBlockData { 36 39 private String verticalAlignUnit ="px"; 41 44 private String verticalAlignValue =""; 45 46 49 private String indentationUnit ="px"; 51 54 private String wordSpacingUnit ="px"; 56 59 private String indentationValue =""; 60 61 64 private String wordSpacingValue =""; 65 66 69 private String letterSpacingUnit="px"; 71 74 private String letterSpacingValue=""; 75 76 79 private String lineHeightUnit="px"; 81 84 private String lineHeightValue; 85 86 public void setVerticalAlign(String verticalAlignStr){ 87 verticalAlignUnit = getUnit(verticalAlignStr); 88 verticalAlignValue = verticalAlignStr.replaceAll(verticalAlignUnit,"").trim(); 89 } 90 91 public void setIndentation(String indentationStr){ 92 indentationUnit = getUnit(indentationStr); 93 indentationValue = indentationStr.replaceAll(indentationUnit,"").trim(); 94 } 95 96 public void setWordSpacing(String wordSpacingStr){ 97 wordSpacingUnit = getUnit(wordSpacingStr); 98 wordSpacingValue = wordSpacingStr.replaceAll(wordSpacingUnit,"").trim(); 99 } 100 101 public void setLetterSpacing(String letterSpacingStr){ 102 letterSpacingUnit = getUnit(letterSpacingStr); 103 letterSpacingValue = letterSpacingStr.replaceAll(letterSpacingUnit,"").trim(); 104 } 105 106 public void setLineHeight(String lineHeightStr){ 107 lineHeightUnit = getUnit(lineHeightStr); 108 lineHeightValue = lineHeightStr.replaceAll(lineHeightUnit,"").trim(); 109 } 110 111 private String getUnit(String textBlockStr){ 112 DefaultComboBoxModel unitList = new TextBlockModel().getTextBlockUnitList(); 113 for(int i=0; i< unitList.getSize(); i++){ 114 String unit = (String )unitList.getElementAt(i); 115 if(textBlockStr.trim().endsWith(unit)){ 116 return unit; 117 } 118 } 119 return ""; 120 } 121 122 126 public String getVerticalAlignUnit() { 127 128 return this.verticalAlignUnit; 129 } 130 131 135 public void setVerticalAlignUnit(String verticalAlignUnit) { 136 137 this.verticalAlignUnit = verticalAlignUnit; 138 } 139 140 144 public String getVerticalAlignValue() { 145 146 return this.verticalAlignValue; 147 } 148 149 153 public void setVerticalAlignValue(String verticalAlignValue) { 154 155 this.verticalAlignValue = verticalAlignValue; 156 } 157 158 162 public String getIndentationUnit() { 163 164 return this.indentationUnit; 165 } 166 167 171 public void setIndentationUnit(java.lang.String indentationUnit) { 172 173 this.indentationUnit = indentationUnit; 174 } 175 176 180 public String getWordSpacingUnit() { 181 182 return this.wordSpacingUnit; 183 } 184 185 189 public void setWordSpacingUnit(String wordSpacingUnit) { 190 191 this.wordSpacingUnit = wordSpacingUnit; 192 } 193 194 198 public String getIndentationValue() { 199 200 return this.indentationValue; 201 } 202 203 207 public void setIndentationValue(String indentationValue) { 208 209 this.indentationValue = indentationValue; 210 } 211 212 216 public String getWordSpacingValue() { 217 218 return this.wordSpacingValue; 219 } 220 221 225 public void setWordSpacingValue(String wordSpacingValue) { 226 227 this.wordSpacingValue = wordSpacingValue; 228 } 229 230 234 public String getLetterSpacingUnit() { 235 236 return this.letterSpacingUnit; 237 } 238 239 243 public void setLetterSpacingUnit(String letterSpacingUnit) { 244 245 this.letterSpacingUnit = letterSpacingUnit; 246 } 247 248 252 public String getLetterSpacingValue() { 253 254 return this.letterSpacingValue; 255 } 256 257 261 public void setLetterSpacingValue(String letterSpacingValue) { 262 263 this.letterSpacingValue = letterSpacingValue; 264 } 265 266 270 public String getLineHeightUnit() { 271 272 return this.lineHeightUnit; 273 } 274 275 279 public void setLineHeightUnit(String lineHeightUnit) { 280 281 this.lineHeightUnit = lineHeightUnit; 282 } 283 284 288 public String getLineHeightValue() { 289 290 return this.lineHeightValue; 291 } 292 293 297 public void setLineHeightValue(String lineHeightValue) { 298 299 this.lineHeightValue = lineHeightValue; 300 } 301 302 303 } 304 | Popular Tags |