com.partnersoft.v3x.io.formats.rover
Class RoverBuilder

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

public class RoverBuilder
extends java.lang.Object
implements RoverConstants

A more high-level interface to building a ROVER file. Maintains your style codes for you.


Field Summary
 
Fields inherited from interface com.partnersoft.v3x.io.formats.rover.RoverConstants
DRAW_JUSTIFIED_TEXT, DRAW_OFFSET_POINT, DRAW_OFFSET_TEXT, DRAW_POINT, DRAW_POLYGON, DRAW_POLYLINE, DRAW_TEXT, EOF, JUSTIFY_BASELINE_CENTER, JUSTIFY_BASELINE_LEFT, JUSTIFY_BASELINE_RIGHT, JUSTIFY_NOTSPECIFIED, OPCODE_TYPE_BOUNDARY, SIZE_DRAW_JUSTIFIED_TEXT_PREAMBLE, SIZE_DRAW_OFFSET_POINT, SIZE_DRAW_OFFSET_TEXT_CONCLUSION, SIZE_DRAW_OFFSET_TEXT_PREAMBLE, SIZE_DRAW_POINT, SIZE_DRAW_POLYLINE_PREAMBLE, SIZE_DRAW_TEXT_PREAMBLE, STYLE_REGION
 
Constructor Summary
RoverBuilder(java.io.DataOutput output)
          Creates a builder to write RoverData to the given DataOutput (a DataOutputStream, RandomAccessFile, or whatever).
RoverBuilder(java.io.OutputStream ostream)
          Creates a builder to write RoverData to the given stream.
 
Method Summary
 void close()
          Finishes up and closes out the stream.
 void closeNoEOF()
          Finishes up and closes out the stream, but doesn't put an EOF marker.
 void drawGraphic(RoverGraphic graphic)
          Does the right thing for any 'ol graphic.
 void drawLine(RoverLine line)
          Draws a RoverLine object (as a RoverPolyline; RoverLines are deprecated).
 void drawPoint(RoverPoint point)
          Draws a RoverPoint object.
 void drawPolygon(RoverPolygon polygon)
          Draws a RoverPolygon object.
 void drawPolyline(RoverPolyline polyline)
          Draws a RoverPolyline object.
 void drawText(RoverText text)
          Draws a RoverText object.
 void flush()
          Flushes the output stream.
 void markStyleSection(int style, int length)
          Marks a homogenous style section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoverBuilder

public RoverBuilder(java.io.DataOutput output)
Creates a builder to write RoverData to the given DataOutput (a DataOutputStream, RandomAccessFile, or whatever). You have to manage your own closings and buffering and such.


RoverBuilder

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

Method Detail

markStyleSection

public void markStyleSection(int style,
                             int length)
                      throws java.io.IOException
Marks a homogenous style section. Requires the length (in bytes!) of the section.

Throws:
java.io.IOException

drawGraphic

public void drawGraphic(RoverGraphic graphic)
                 throws java.io.IOException
Does the right thing for any 'ol graphic.

Throws:
java.io.IOException

drawPoint

public void drawPoint(RoverPoint point)
               throws java.io.IOException
Draws a RoverPoint object.

Throws:
java.io.IOException

drawText

public void drawText(RoverText text)
              throws java.io.IOException
Draws a RoverText object.

Throws:
java.io.IOException

drawPolyline

public void drawPolyline(RoverPolyline polyline)
                  throws java.io.IOException
Draws a RoverPolyline object.

Throws:
java.io.IOException

drawLine

public void drawLine(RoverLine line)
              throws java.io.IOException
Draws a RoverLine object (as a RoverPolyline; RoverLines are deprecated).

Throws:
java.io.IOException

drawPolygon

public void drawPolygon(RoverPolygon polygon)
                 throws java.io.IOException
Draws a RoverPolygon object.

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the output stream.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Finishes up and closes out the stream.

Throws:
java.io.IOException

closeNoEOF

public void closeNoEOF()
                throws java.io.IOException
Finishes up and closes out the stream, but doesn't put an EOF marker.

Throws:
java.io.IOException