1 19 20 package jxl.biff.drawing; 21 22 25 final class ShapeType 26 { 27 30 int value; 31 32 private static ShapeType[] types = new ShapeType[0]; 33 ShapeType(int v) 34 { 35 value = v; 36 37 ShapeType[] old = types; 38 types = new ShapeType[types.length+1]; 39 System.arraycopy(old, 0, types, 0, old.length); 40 types[old.length] = this; 41 } 42 43 static ShapeType getType(int v) 44 { 45 ShapeType st = UNKNOWN; 46 boolean found = false; 47 for (int i = 0 ; i < types.length && !found ; i++) 48 { 49 if (types[i].value == v) 50 { 51 found = true; 52 st = types[i]; 53 } 54 } 55 return st; 56 } 57 58 public static final ShapeType MIN = new ShapeType(0); 59 public static final ShapeType PICTURE_FRAME = new ShapeType(75); 60 public static final ShapeType HOST_CONTROL = new ShapeType(201); 61 public static final ShapeType TEXT_BOX = new ShapeType(202); 62 public static final ShapeType UNKNOWN = new ShapeType(-1); 63 } 64 | Popular Tags |