Package weka.gui.visualize
Class PostscriptWriter
- java.lang.Object
-
- weka.gui.visualize.JComponentWriter
-
- weka.gui.visualize.PostscriptWriter
-
public class PostscriptWriter extends JComponentWriter
This class takes any Component and outputs it to a Postscript file.Note:
This writer does not work with Components that rely on clipping, like e.g. scroll lists. Here the complete list is printed, instead of only in the borders of the scroll list (may overlap other components!). This is due to the way, clipping is handled in Postscript. There was no easy way around this issue. :-(- Version:
- $Revision: 7059 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
PostscriptGraphics
-
-
Constructor Summary
Constructors Constructor Description PostscriptWriter()
initializes the objectPostscriptWriter(javax.swing.JComponent c)
initializes the object with the given ComponentPostscriptWriter(javax.swing.JComponent c, java.io.File f)
initializes the object with the given Component and filename
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateOutput()
generates the actual outputjava.lang.String
getDescription()
returns the name of the writer, to display in the FileChooser.java.lang.String
getExtension()
returns the extension (incl.static void
main(java.lang.String[] args)
for testing only-
Methods inherited from class weka.gui.visualize.JComponentWriter
getComponent, getCustomHeight, getCustomWidth, getFile, getScalingEnabled, getUseCustomDimensions, getXScale, getYScale, setComponent, setCustomHeight, setCustomWidth, setFile, setScale, setScalingEnabled, setUseCustomDimensions, toOutput, toOutput, toOutput
-
-
-
-
Constructor Detail
-
PostscriptWriter
public PostscriptWriter()
initializes the object
-
PostscriptWriter
public PostscriptWriter(javax.swing.JComponent c)
initializes the object with the given Component- Parameters:
c
- the component to print in the output format
-
PostscriptWriter
public PostscriptWriter(javax.swing.JComponent c, java.io.File f)
initializes the object with the given Component and filename- Parameters:
c
- the component to print in the output formatf
- the file to store the output in
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
returns the name of the writer, to display in the FileChooser. must be overridden in the derived class.- Specified by:
getDescription
in classJComponentWriter
- Returns:
- the name of the writer
-
getExtension
public java.lang.String getExtension()
returns the extension (incl. ".") of the output format, to use in the FileChooser. must be overridden in the derived class.- Specified by:
getExtension
in classJComponentWriter
- Returns:
- the file extension
-
generateOutput
public void generateOutput() throws java.lang.Exception
generates the actual output- Throws:
java.lang.Exception
- if something goes wrong
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
for testing only- Throws:
java.lang.Exception
-
-