org.sourceforge.jlibeps.epsgraphics

Class EpsDocument


public class EpsDocument
extends java.lang.Object

This represents an EPS document. Several EpsGraphics2D objects may point to the same EpsDocument.
Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/
Copyright 2007 Arnaud Blouin
08/09/07
Version:
0.1

Field Summary

private BufferedWriter
_bufferedWriter
private boolean
_isClipSet
private EpsGraphics2D
_lastG
private StringWriter
_stringWriter
private String
_title
private float
maxX
private float
maxY
private float
minX
private float
minY

Constructor Summary

EpsDocument(String title)
Constructs an empty EpsDevice.
EpsDocument(String title, OutputStream outputStream, int minX, int minY, int maxX, int maxY)
Constructs an empty EpsDevice that writes directly to a file.

Method Summary

void
append(EpsGraphics2D g, String line)
Appends a line to the EpsDocument.
void
close()
void
flush()
String
getTitle()
Returns the title of the EPS document.
boolean
isClipSet()
void
setClipSet(boolean isClipSet)
void
updateBounds(double x, double y)
Updates the bounds of the current EPS document.
void
write(Writer writer)
Outputs the contents of the EPS document to the specified Writer, complete with headers and bounding box.
private void
writeFooter(Writer writer)

Field Details

_bufferedWriter

private BufferedWriter _bufferedWriter

_isClipSet

private boolean _isClipSet

_lastG

private EpsGraphics2D _lastG

_stringWriter

private StringWriter _stringWriter

_title

private String _title

maxX

private float maxX

maxY

private float maxY

minX

private float minX

minY

private float minY

Constructor Details

EpsDocument

public EpsDocument(String title)
Constructs an empty EpsDevice.
Since:
0.1

EpsDocument

public EpsDocument(String title,
                   OutputStream outputStream,
                   int minX,
                   int minY,
                   int maxX,
                   int maxY)
            throws IOException
Constructs an empty EpsDevice that writes directly to a file. Bounds must be set before use.
Since:
0.1

Method Details

append

public void append(EpsGraphics2D g,
                   String line)
Appends a line to the EpsDocument. A new line character is added to the end of the line when it is added.
Since:
0.1

close

public void close()
            throws IOException

flush

public void flush()
            throws IOException

getTitle

public String getTitle()
Returns the title of the EPS document.
Since:
0.1

isClipSet

public boolean isClipSet()

setClipSet

public void setClipSet(boolean isClipSet)

updateBounds

public void updateBounds(double x,
                         double y)
Updates the bounds of the current EPS document.
Since:
0.1

write

public void write(Writer writer)
            throws IOException
Outputs the contents of the EPS document to the specified Writer, complete with headers and bounding box.
Since:
0.1

writeFooter

private void writeFooter(Writer writer)
            throws IOException