1 19 20 package jxl.biff.drawing; 21 22 25 final class BlipType 26 { 27 private int value; 28 private String desc; 29 30 private static BlipType[] types = new BlipType[0]; 31 32 private BlipType(int val, String d) 33 { 34 value = val; 35 desc = d; 36 37 BlipType[] newtypes = new BlipType[types.length+1]; 38 System.arraycopy(types, 0, newtypes, 0, types.length); 39 newtypes[types.length] = this; 40 types = newtypes; 41 } 42 43 public String getDescription() 44 { 45 return desc; 46 } 47 48 public int getValue() 49 { 50 return value; 51 } 52 53 public static BlipType getType(int val) 54 { 55 BlipType type = UNKNOWN; 56 for (int i = 0 ; i < types.length ; i++) 57 { 58 if (types[i].value == val) 59 { 60 type = types[i]; 61 break; 62 } 63 } 64 65 return type; 66 } 67 68 public static final BlipType ERROR = new BlipType(0, "Error"); public static final BlipType UNKNOWN = new BlipType(1, "Unknown"); public static final BlipType EMF = new BlipType(2, "EMF"); public static final BlipType WMF = new BlipType(3, "WMF"); public static final BlipType PICT = new BlipType(4, "PICT"); public static final BlipType JPEG = new BlipType(5, "JPEG"); public static final BlipType PNG = new BlipType(6, "PNG"); public static final BlipType DIB = new BlipType(7, "DIB"); public static final BlipType FIRST_CLIENT = new BlipType(32, "FIRST"); public static final BlipType LAST_CLIENT = new BlipType(255, "LAST"); } 79 | Popular Tags |