reset(); setReading( true ); int dwIsAldus = readInt( is ); if ( dwIsAldus == WMFConstants.META_ALDUS_APM ) { readShort( is ); // metafile handle, always zero left = readShort( is ); top = readShort( is ); right = readShort( is ); bottom = readShort( is ); inch = readShort( is ); int reserved = readInt( is ); short checksum = readShort( is ); mtType = readShort( is ); mtHeaderSize = readShort( is ); } else { mtVersion = readShort( is ); mtSize = readInt( is ); mtNoObjects = readShort( is ); mtMaxRecord = readInt( is ); mtNoParameters = readShort( is ); boolean ret = readRecords(is); is.close(); if (!ret) throw new IOException("Unhandled exception while reading records");
/** * Adds a GdiObject to the internal handle table. * Wmf files specify the index as given in EMF records such as * EMRCREATEPENINDIRECT whereas WMF files always use 0. * * This function should not normally be called by an application. * @return the object index */ public int addObjectAt( int type, Object obj, int idx ) { if (( idx == 0 ) || ( idx > numObjects )) { addObject( type, obj ); return lastObjectIdx; } lastObjectIdx = idx; for ( int i = 0; i < numObjects; i++ ) { GdiObject gdi = (GdiObject)objectVector.get( i ); if ( i == idx ) { gdi.Setup( type, obj ); break; } } return idx; }
/** * Adds a GdiObject to the internal handle table. * Wmf files specify the index as given in EMF records such as * EMRCREATEPENINDIRECT whereas WMF files always use 0. * * This function should not normally be called by an application. * @return the object index */ public int addObjectAt( int type, Object obj, int idx ) { if (( idx == 0 ) || ( idx > numObjects )) { addObject( type, obj ); return lastObjectIdx; } lastObjectIdx = idx; for ( int i = 0; i < numObjects; i++ ) { GdiObject gdi = (GdiObject)objectVector.get( i ); if ( i == idx ) { gdi.Setup( type, obj ); break; } } return idx; }
reset(); setReading( true ); int dwIsAldus = readInt( is ); if ( dwIsAldus == WMFConstants.META_ALDUS_APM ) { readShort( is ); // metafile handle, always zero left = readShort( is ); top = readShort( is ); right = readShort( is ); bottom = readShort( is ); inch = readShort( is ); int reserved = readInt( is ); short checksum = readShort( is ); mtType = readShort( is ); mtHeaderSize = readShort( is ); } else { mtVersion = readShort( is ); mtSize = readInt( is ); mtNoObjects = readShort( is ); mtMaxRecord = readInt( is ); mtNoParameters = readShort( is ); boolean ret = readRecords(is); is.close(); if (!ret) throw new IOException("Unhandled exception while reading records");