recordtypes.java

来自「EXCEL read and write」· Java 代码 · 共 282 行 · 第 1/2 页

JAVA
282
字号
    public static final Type ExWAVAudioEmbeddedAtom = new Type(4115,null);    public static final Type AnimationInfo = new Type(4116,AnimationInfo.class);    public static final Type AnimationInfoAtom = new Type(4081,AnimationInfoAtom.class);    public static final Type RTFDateTimeMCAtom = new Type(4117,null);    public static final Type ProgTags = new Type(5000,DummyPositionSensitiveRecordWithChildren.class);    public static final Type ProgStringTag = new Type(5001,null);    public static final Type ProgBinaryTag = new Type(5002,DummyPositionSensitiveRecordWithChildren.class);    public static final Type BinaryTagData = new Type(5003,DummyPositionSensitiveRecordWithChildren.class);    public static final Type PrpublicintOptions = new Type(6000,null);    public static final Type PersistPtrFullBlock = new Type(6001,PersistPtrHolder.class);    public static final Type PersistPtrIncrementalBlock = new Type(6002,PersistPtrHolder.class);    public static final Type GScalingAtom = new Type(10001,null);    public static final Type GRColorAtom = new Type(10002,null);        // Records ~12000 seem to be related to the Comments used in PPT 2000/XP    // (Comments in PPT97 are normal Escher text boxes)    public static final Type Comment2000 = new Type(12000,Comment2000.class);    public static final Type Comment2000Atom = new Type(12001,Comment2000Atom.class);    public static final Type Comment2000Summary = new Type(12004,null);    public static final Type Comment2000SummaryAtom = new Type(12005,null);        // Records ~12050 seem to be related to Document Encryption    public static final Type DocumentEncryptionAtom = new Type(12052,DocumentEncryptionAtom.class);    public static final Type OriginalMainMasterId = new Type(1052,null);    public static final Type CompositeMasterId = new Type(1052,null);    public static final Type RoundTripContentMasterInfo12 = new Type(1054,null);    public static final Type RoundTripShapeId12 = new Type(1055,null);    public static final Type RoundTripHFPlaceholder12 = new Type(1056,RoundTripHFPlaceholder12.class);    public static final Type RoundTripContentMasterId = new Type(1058,null);    public static final Type RoundTripOArtTextStyles12 = new Type(1059,null);    public static final Type RoundTripShapeCheckSumForCustomLayouts12 = new Type(1062,null);    public static final Type RoundTripNotesMasterTextStyles12 = new Type(1063,null);    public static final Type RoundTripCustomTableStyles12 = new Type(1064,null);    //records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher    public static final int EscherDggContainer = 0xf000;    public static final int EscherDgg = 0xf006;    public static final int EscherCLSID = 0xf016;    public static final int EscherOPT = 0xf00b;    public static final int EscherBStoreContainer = 0xf001;    public static final int EscherBSE = 0xf007;    public static final int EscherBlip_START = 0xf018;    public static final int EscherBlip_END = 0xf117;    public static final int EscherDgContainer = 0xf002;    public static final int EscherDg = 0xf008;    public static final int EscherRegroupItems = 0xf118;    public static final int EscherColorScheme = 0xf120;    public static final int EscherSpgrContainer = 0xf003;    public static final int EscherSpContainer = 0xf004;    public static final int EscherSpgr = 0xf009;    public static final int EscherSp = 0xf00a;    public static final int EscherTextbox = 0xf00c;    public static final int EscherClientTextbox = 0xf00d;    public static final int EscherAnchor = 0xf00e;    public static final int EscherChildAnchor = 0xf00f;    public static final int EscherClientAnchor = 0xf010;    public static final int EscherClientData = 0xf011;    public static final int EscherSolverContainer = 0xf005;    public static final int EscherConnectorRule = 0xf012;    public static final int EscherAlignRule = 0xf013;    public static final int EscherArcRule = 0xf014;    public static final int EscherClientRule = 0xf015;    public static final int EscherCalloutRule = 0xf017;    public static final int EscherSelection = 0xf119;    public static final int EscherColorMRU = 0xf11a;    public static final int EscherDeletedPspl = 0xf11d;    public static final int EscherSplitMenuColors = 0xf11e;    public static final int EscherOleObject = 0xf11f;    public static final int EscherUserDefined = 0xf122;    /**     * Returns name of the record by its type     *     * @param type section of the record header     * @return name of the record     */    public static String recordName(int type) {        String name = (String)typeToName.get(new Integer(type));        if (name == null) name = "Unknown" + type;        return name;    }    /**     * Returns the class handling a record by its type.	 * If given an un-handled PowerPoint record, will return a dummy	 *  placeholder class. If given an unknown PowerPoint record, or	 *  and Escher record, will return null.     *     * @param type section of the record header     * @return class to handle the record, or null if an unknown (eg Escher) record     */	public static Class recordHandlingClass(int type) {		Class c = (Class)typeToClass.get(new Integer(type));		return c;	}    static {		typeToName = new HashMap();		typeToClass = new HashMap();        try {            Field[] f = RecordTypes.class.getFields();            for (int i = 0; i < f.length; i++){                Object val = f[i].get(null);				// Escher record, only store ID -> Name                if (val instanceof Integer) {                    typeToName.put(val, f[i].getName());                }				// PowerPoint record, store ID -> Name and ID -> Class				if (val instanceof Type) {					Type t = (Type)val;					Class c = t.handlingClass;					Integer id = new Integer(t.typeID);					if(c == null) { c = UnknownRecordPlaceholder.class; }                    typeToName.put(id, f[i].getName());                    typeToClass.put(id, c);				}            }        } catch (IllegalAccessException e){            throw new RuntimeException("Failed to initialize records types");        }    }	/** 	 * Wrapper for the details of a PowerPoint or Escher record type.	 * Contains both the type, and the handling class (if any), and	 *  offers methods to get either back out.	 */	public static class Type {		public int typeID;		public Class handlingClass;		public Type(int typeID, Class handlingClass) {			this.typeID = typeID;			this.handlingClass = handlingClass;		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?