1 19 20 package jxl.format; 21 22 27 public final class UnderlineStyle 28 { 29 32 private int value; 33 34 38 private String string; 39 40 43 private static UnderlineStyle[] styles = new UnderlineStyle[0]; 44 45 51 protected UnderlineStyle(int val, String s) 52 { 53 value = val; 54 string = s; 55 56 UnderlineStyle[] oldstyles = styles; 57 styles = new UnderlineStyle[oldstyles.length + 1]; 58 System.arraycopy(oldstyles, 0, styles, 0, oldstyles.length); 59 styles[oldstyles.length] = this; 60 } 61 62 68 public int getValue() 69 { 70 return value; 71 } 72 73 78 public String getDescription() 79 { 80 return string; 81 } 82 83 89 public static UnderlineStyle getStyle(int val) 90 { 91 for (int i = 0 ; i < styles.length ; i++) 92 { 93 if (styles[i].getValue() == val) 94 { 95 return styles[i]; 96 } 97 } 98 99 return NO_UNDERLINE; 100 } 101 102 public static final UnderlineStyle NO_UNDERLINE = 104 new UnderlineStyle(0, "none"); 105 106 public static final UnderlineStyle SINGLE = 107 new UnderlineStyle(1, "single"); 108 109 public static final UnderlineStyle DOUBLE = 110 new UnderlineStyle(2, "double"); 111 112 public static final UnderlineStyle SINGLE_ACCOUNTING = 113 new UnderlineStyle(0x21, "single accounting"); 114 115 public static final UnderlineStyle DOUBLE_ACCOUNTING = 116 new UnderlineStyle(0x22, "double accounting"); 117 } 118 119 120 121 122 123 124 125 126 127 128 129 | Popular Tags |