org.apache.batik.transcoder.wmf.tosvg
Class WMFRecordStore

java.lang.Object
  extended byorg.apache.batik.transcoder.wmf.tosvg.WMFRecordStore
All Implemented Interfaces:
WMFConstants

public class WMFRecordStore
extends Object
implements WMFConstants

Reads a WMF file, including an Aldus Placable Metafile Header.


Field Summary
protected  boolean bReading
           
 int lastObjectIdx
           
protected  int numObjects
           
protected  int numRecords
           
protected  Vector objectVector
           
protected  Vector records
           
protected  int vpH
           
protected  int vpW
           
protected  int vpX
           
protected  int vpY
           
 
Fields inherited from interface org.apache.batik.transcoder.wmf.WMFConstants
META_ALDUS_APM, META_ANIMATEPALETTE, META_ARC, META_BITBLT, META_CHORD, META_CREATEBITMAP, META_CREATEBITMAPINDIRECT, META_CREATEBRUSH, META_CREATEBRUSHINDIRECT, META_CREATEFONTINDIRECT, META_CREATEPALETTE, META_CREATEPATTERNBRUSH, META_CREATEPENINDIRECT, META_CREATEREGION, META_DELETEOBJECT, META_DIBBITBLT, META_DIBCREATEPATTERNBRUSH, META_DIBSTRETCHBLT, META_DRAWTEXT, META_ELLIPSE, META_ESCAPE, META_EXCLUDECLIPRECT, META_EXTFLOODFILL, META_EXTTEXTOUT, META_FILLREGION, META_FLOODFILL, META_FRAMEREGION, META_INTERSECTCLIPRECT, META_INVERTREGION, META_LINETO, META_MOVETO, META_OBJ_ANSI_FIXED_FONT, META_OBJ_ANSI_VAR_FONT, META_OBJ_BLACK_BRUSH, META_OBJ_BLACK_PEN, META_OBJ_DEFAULT_PALETTE, META_OBJ_DEVICE_DEFAULT_FONT, META_OBJ_DKGRAY_BRUSH, META_OBJ_GRAY_BRUSH, META_OBJ_HOLLOW_BRUSH, META_OBJ_LTGRAY_BRUSH, META_OBJ_NULL_BRUSH, META_OBJ_NULL_PEN, META_OBJ_OEM_FIXED_FONT, META_OBJ_SYSTEM_FIXED_FONT, META_OBJ_SYSTEM_FONT, META_OBJ_WHITE_BRUSH, META_OBJ_WHITE_PEN, META_OFFSETCLIPRGN, META_OFFSETVIEWPORTORG, META_OFFSETWINDOWORG, META_PAINTREGION, META_PATBLT, META_PIE, META_POLYBEZIER16, META_POLYGON, META_POLYLINE, META_POLYPOLYGON, META_REALIZEPALETTE, META_RECTANGLE, META_RESIZEPALETTE, META_RESTOREDC, META_ROUNDRECT, META_SAVEDC, META_SCALEVIEWPORTEXT, META_SCALEWINDOWEXT, META_SELECTCLIPREGION, META_SELECTOBJECT, META_SELECTPALETTE, META_SETBKCOLOR, META_SETBKMODE, META_SETDIBTODEV, META_SETLAYOUT, META_SETMAPMODE, META_SETMAPPERFLAGS, META_SETPALENTRIES, META_SETPIXEL, META_SETPOLYFILLMODE, META_SETRELABS, META_SETROP2, META_SETSTRETCHBLTMODE, META_SETTEXTALIGN, META_SETTEXTCHAREXTRA, META_SETTEXTCOLOR, META_SETTEXTJUSTIFICATION, META_SETVIEWPORTEXT, META_SETVIEWPORTORG, META_SETWINDOWEXT, META_SETWINDOWORG, META_SETWINDOWORG_EX, META_STRETCHBLT, META_STRETCHDIB, META_TEXTOUT
 
Constructor Summary
WMFRecordStore()
           
 
Method Summary
 void addObject(int type, Object obj)
           
 void addObjectAt(int type, Object obj, int idx)
          Adds a GdiObject to the internal handle table.
 int getNumObjects()
          Returns the number of GdiObjects in the handle table
 int getNumRecords()
          Returns a number of records in the image
 org.apache.batik.transcoder.wmf.tosvg.GdiObject getObject(int idx)
          Returns a GdiObject from the handle table
 org.apache.batik.transcoder.wmf.tosvg.MetaRecord getRecord(int idx)
          Returns a meta record.
 URL getUrl()
          Returns the current URL
 int getVpH()
          Returns the viewport height
 int getVpW()
          Returns the viewport width
 int getVpX()
          Returns the viewport x origin
 int getVpY()
          Returns the viewport y origin
 boolean read(DataInputStream is)
          Reads the WMF file from the specified Stream.
 void reset()
          Resets the internal storage and viewport coordinates.
 void setUrl(URL newUrl)
          Sets the current URL
 void setVpH(int newValue)
          Sets the viewport height
 void setVpW(int newValue)
          Sets the viewport width
 void setVpX(int newValue)
          Sets the viewport x origin
 void setVpY(int newValue)
          Sets the viewport y origin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numRecords

protected transient int numRecords

numObjects

protected transient int numObjects

lastObjectIdx

public transient int lastObjectIdx

vpX

protected transient int vpX

vpY

protected transient int vpY

vpW

protected transient int vpW

vpH

protected transient int vpH

records

protected transient Vector records

objectVector

protected transient Vector objectVector

bReading

protected transient boolean bReading
Constructor Detail

WMFRecordStore

public WMFRecordStore()
Method Detail

reset

public void reset()
Resets the internal storage and viewport coordinates.


read

public boolean read(DataInputStream is)
             throws IOException
Reads the WMF file from the specified Stream.

Throws:
IOException

addObject

public void addObject(int type,
                      Object obj)

addObjectAt

public void addObjectAt(int type,
                        Object obj,
                        int 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.


getUrl

public URL getUrl()
Returns the current URL


setUrl

public void setUrl(URL newUrl)
Sets the current URL


getObject

public org.apache.batik.transcoder.wmf.tosvg.GdiObject getObject(int idx)
Returns a GdiObject from the handle table


getRecord

public org.apache.batik.transcoder.wmf.tosvg.MetaRecord getRecord(int idx)
Returns a meta record.


getNumRecords

public int getNumRecords()
Returns a number of records in the image


getNumObjects

public int getNumObjects()
Returns the number of GdiObjects in the handle table


getVpX

public int getVpX()
Returns the viewport x origin


getVpY

public int getVpY()
Returns the viewport y origin


getVpW

public int getVpW()
Returns the viewport width


getVpH

public int getVpH()
Returns the viewport height


setVpX

public void setVpX(int newValue)
Sets the viewport x origin


setVpY

public void setVpY(int newValue)
Sets the viewport y origin


setVpW

public void setVpW(int newValue)
Sets the viewport width


setVpH

public void setVpH(int newValue)
Sets the viewport height



Copyright ? 2005 Apache Software Foundation. All Rights Reserved.