com.partnersoft.io.formats.rover
Class RoverWriter

java.lang.Object
  extended by com.partnersoft.io.formats.rover.RoverWriter
All Implemented Interfaces:
RoverConstants

public class RoverWriter
extends java.lang.Object
implements RoverConstants

A writer for the Rover format. Very low-level, little hand-holding.

Author:
Paul Reavis Copyright 2002 Partner Software, Inc.

Field Summary
 
Fields inherited from interface com.partnersoft.io.formats.rover.RoverConstants
ALIGN_BOTTOM_CENTER, ALIGN_BOTTOM_FIT, ALIGN_BOTTOM_LEFT, ALIGN_BOTTOM_RIGHT, ALIGN_CENTER, ALIGN_CENTER_LEFT, ALIGN_CENTER_RIGHT, ALIGN_CODE_CENTER, ALIGN_CODE_FIT, ALIGN_CODE_HIGH, ALIGN_CODE_LOW, ALIGN_FIT, ALIGN_FIT_LEFT, ALIGN_FIT_RIGHT, ALIGN_TOP_CENTER, ALIGN_TOP_FIT, ALIGN_TOP_LEFT, ALIGN_TOP_RIGHT, COMMENT, DATA_FIELDS_MAX, EOF, FLOAT_COORDS, GEOMETRY_TYPE_NAMES, HAS_DATA, HAS_OFFSET, HAS_ROTATION, LIST, MASK_TYPECODE, NAMING, POINT, POLYGON, POLYLINE, POP, PUSH, RENDER_FINDITEM, RENDER_INDICATION, RENDER_NORMAL, RENDER_SELECTION, ROTATION_MULT, TEXEL_COORD_MAX, TEXEL_COORD_SIZE, TEXT, TILE_COORD_MAX, TILE_SIZE_PIXELS, VALUE
 
Constructor Summary
RoverWriter(java.io.DataOutput output)
          Creates a writer for the given DataOutput (a DataOutputStream, RandomAccessFile, or whatever).
RoverWriter(java.io.DataOutput output, float originX, float originY, float tileSize)
           
RoverWriter(java.io.OutputStream ostream)
          Creates a builder to write to the given stream.
RoverWriter(java.io.OutputStream output, float originX, float originY, float tileSize)
           
 
Method Summary
 void close()
           
 void popContext()
           
 void pushContext(int contextID)
           
 int writeComment(java.lang.String comment)
           
 int writePoint(long ID, int offsetX, int offsetY, float rotation, float x, float y)
           
 int writePointSection(int style, int count, boolean hasData, boolean hasOffset, boolean hasRotation)
           
 int writePolygon(long ID, FloatBuffer coords)
           
 int writePolygonSection(int style, int count, boolean hasData)
           
 int writePolyline(long ID, FloatBuffer coords)
           
 int writePolylineSection(int style, int count, boolean hasData)
           
 int writeText(int offsetX, int offsetY, float rotation, float x, float y, java.lang.String text)
           
 int writeTextSection(int style, int count, int alignment, boolean hasOffset, boolean hasRotation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoverWriter

public RoverWriter(java.io.DataOutput output)
Creates a writer for the given DataOutput (a DataOutputStream, RandomAccessFile, or whatever). You have to manage your own closings and buffering and such.


RoverWriter

public RoverWriter(java.io.OutputStream ostream)
Creates a builder to write to the given stream. Creates a BufferedOutputStream if needed.


RoverWriter

public RoverWriter(java.io.DataOutput output,
                   float originX,
                   float originY,
                   float tileSize)

RoverWriter

public RoverWriter(java.io.OutputStream output,
                   float originX,
                   float originY,
                   float tileSize)
Method Detail

pushContext

public void pushContext(int contextID)
                 throws java.io.IOException
Throws:
java.io.IOException

popContext

public void popContext()
                throws java.io.IOException
Throws:
java.io.IOException

writeComment

public int writeComment(java.lang.String comment)
                 throws java.io.IOException
Throws:
java.io.IOException

writePointSection

public int writePointSection(int style,
                             int count,
                             boolean hasData,
                             boolean hasOffset,
                             boolean hasRotation)
                      throws java.io.IOException
Throws:
java.io.IOException

writePolylineSection

public int writePolylineSection(int style,
                                int count,
                                boolean hasData)
                         throws java.io.IOException
Throws:
java.io.IOException

writePolygonSection

public int writePolygonSection(int style,
                               int count,
                               boolean hasData)
                        throws java.io.IOException
Throws:
java.io.IOException

writeTextSection

public int writeTextSection(int style,
                            int count,
                            int alignment,
                            boolean hasOffset,
                            boolean hasRotation)
                     throws java.io.IOException
Throws:
java.io.IOException

writePoint

public int writePoint(long ID,
                      int offsetX,
                      int offsetY,
                      float rotation,
                      float x,
                      float y)
               throws java.io.IOException
Throws:
java.io.IOException

writePolyline

public int writePolyline(long ID,
                         FloatBuffer coords)
                  throws java.io.IOException
Throws:
java.io.IOException

writePolygon

public int writePolygon(long ID,
                        FloatBuffer coords)
                 throws java.io.IOException
Throws:
java.io.IOException

writeText

public int writeText(int offsetX,
                     int offsetY,
                     float rotation,
                     float x,
                     float y,
                     java.lang.String text)
              throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException