Class EpsDocument
- java.lang.Object
-
- org.sourceforge.jlibeps.epsgraphics.EpsDocument
-
public class EpsDocument extends 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
Fields Modifier and Type Field Description private BufferedWriter_bufferedWriterprivate boolean_isClipSetprivate EpsGraphics2D_lastGprivate StringWriter_stringWriterprivate String_titleprivate floatmaxXprivate floatmaxYprivate floatminXprivate floatminY
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(EpsGraphics2D g, String line)Appends a line to the EpsDocument.voidclose()voidflush()StringgetTitle()Returns the title of the EPS document.booleanisClipSet()voidsetClipSet(boolean isClipSet)voidupdateBounds(double x, double y)Updates the bounds of the current EPS document.voidwrite(Writer writer)Outputs the contents of the EPS document to the specified Writer, complete with headers and bounding box.private voidwriteFooter(Writer writer)
-
-
-
Field Detail
-
minX
private float minX
-
minY
private float minY
-
maxX
private float maxX
-
maxY
private float maxY
-
_isClipSet
private boolean _isClipSet
-
_title
private String _title
-
_stringWriter
private StringWriter _stringWriter
-
_bufferedWriter
private BufferedWriter _bufferedWriter
-
_lastG
private EpsGraphics2D _lastG
-
-
Constructor Detail
-
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.- Throws:
IOException- Since:
- 0.1
-
-
Method Detail
-
getTitle
public String getTitle()
Returns the title of the EPS document.- Since:
- 0.1
-
updateBounds
public void updateBounds(double x, double y)Updates the bounds of the current EPS document.- Since:
- 0.1
-
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
-
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.- Throws:
IOException- Since:
- 0.1
-
writeFooter
private void writeFooter(Writer writer) throws IOException
- Throws:
IOException
-
flush
public void flush() throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Throws:
IOException
-
isClipSet
public boolean isClipSet()
-
setClipSet
public void setClipSet(boolean isClipSet)
-
-