1 19 20 package jxl.format; 21 22 25 public class BorderLineStyle 26 { 27 30 private int value; 31 32 35 private String string; 36 37 40 private static BorderLineStyle[] styles = new BorderLineStyle[0]; 41 42 43 46 protected BorderLineStyle(int val, String s) 47 { 48 value = val; 49 string = s; 50 51 BorderLineStyle[] oldstyles = styles; 52 styles = new BorderLineStyle[oldstyles.length + 1]; 53 System.arraycopy(oldstyles, 0, styles, 0, oldstyles.length); 54 styles[oldstyles.length] = this; 55 } 56 57 62 public int getValue() 63 { 64 return value; 65 } 66 67 70 public String getDescription() 71 { 72 return string; 73 } 74 75 81 public static BorderLineStyle getStyle(int val) 82 { 83 for (int i = 0 ; i < styles.length ; i++) 84 { 85 if (styles[i].getValue() == val) 86 { 87 return styles[i]; 88 } 89 } 90 91 return NONE; 92 } 93 94 public final static BorderLineStyle NONE 95 = new BorderLineStyle(0, "none"); 96 public final static BorderLineStyle THIN 97 = new BorderLineStyle(1, "thin"); 98 public final static BorderLineStyle MEDIUM 99 = new BorderLineStyle(2, "medium"); 100 public final static BorderLineStyle DASHED 101 = new BorderLineStyle(3, "dashed"); 102 public final static BorderLineStyle DOTTED 103 = new BorderLineStyle(4, "dotted"); 104 public final static BorderLineStyle THICK 105 = new BorderLineStyle(5, "thick"); 106 public final static BorderLineStyle DOUBLE 107 = new BorderLineStyle(6, "double"); 108 public final static BorderLineStyle HAIR 109 = new BorderLineStyle(7, "hair"); 110 public final static BorderLineStyle MEDIUM_DASHED 111 = new BorderLineStyle(8, "medium dashed"); 112 public final static BorderLineStyle DASH_DOT 113 = new BorderLineStyle(9, "dash dot"); 114 public final static BorderLineStyle MEDIUM_DASH_DOT 115 = new BorderLineStyle(0xa, "medium dash dot"); 116 public final static BorderLineStyle DASH_DOT_DOT 117 = new BorderLineStyle(0xb, "Dash dot dot"); 118 public final static BorderLineStyle MEDIUM_DASH_DOT_DOT 119 = new BorderLineStyle(0xc, "Medium dash dot dot"); 120 public final static BorderLineStyle SLANTED_DASH_DOT 121 = new BorderLineStyle(0xd, "Slanted dash dot"); 122 } 123 | Popular Tags |