Package ucar.visad
Class Plotter
java.lang.Object
ucar.visad.Plotter
Plot a Plottable object to file. This is roughly analoguous to java
printing which provides a Graphics2D to a Printable object, which the
Printable can then render itself to, before being printed
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for classes which create charts capable of being plotted via a third party rendering library to a vector based graphics format -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSpecifies a format of DIFAXstatic final String[]The different file formats supportedstatic final intSpecifies a format of JPGstatic final intSpecifies a format of PDFstatic final intSpecifies a format of PNGstatic final intSpecifies a format of Postscriptstatic final intSpecifies a format of SVGstatic final intSpecifies a format of PS2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintFind out which format the plotter is plotting togetPreview(Plotter.Plottable plottable) Get the preview of the given plotvoidhandleError(Exception exc) handle the error.voidplot(Plotter.Plottable plottable) Plot a plottable object to the file specified in the constructorvoidsetColourDepth(int colourDepth) Set color depthvoidsetFilename(String filename) Set the filenamevoidsetMonochrome(boolean monochrome) set monochrome
-
Field Details
-
SVG
public static final int SVGSpecifies a format of SVG- See Also:
-
PNG
public static final int PNGSpecifies a format of PNG- See Also:
-
JPG
public static final int JPGSpecifies a format of JPG- See Also:
-
PS
public static final int PSSpecifies a format of Postscript- See Also:
-
PDF
public static final int PDFSpecifies a format of PDF- See Also:
-
TIFF
public static final int TIFFSpecifies a format of PS2- See Also:
-
DIFAX
public static final int DIFAXSpecifies a format of DIFAX- See Also:
-
FORMATS
The different file formats supported
-
-
Constructor Details
-
Plotter
Create a plotter- Parameters:
format- The format of the distination file SVG, PNG or PSfilename- The filename to plot to
-
Plotter
ctor- Parameters:
filename- file to write to
-
Plotter
Create a plotter- Parameters:
format- The format of the distination file SVG, PNG or PSfilename- The filename to plot tomonochrome- Set to true if all colours are to be plotted as either pure black or pure white
-
-
Method Details
-
handleError
handle the error. THis just throws the error but can be overwritten- Parameters:
exc- The error.- Throws:
Exception- On badness
-
setFilename
Set the filename- Parameters:
filename- the filename
-
setMonochrome
public void setMonochrome(boolean monochrome) set monochrome- Parameters:
monochrome- is monochrome
-
setColourDepth
public void setColourDepth(int colourDepth) Set color depth- Parameters:
colourDepth- the depth
-
getFormat
public int getFormat()Find out which format the plotter is plotting to- Returns:
- format
-
plot
Plot a plottable object to the file specified in the constructor- Parameters:
plottable- The object to be plotted- Throws:
Exception- On badnessFileNotFoundException- On badnessIOException- On badness
-
getPreview
Get the preview of the given plot- Parameters:
plottable- plot to preview- Returns:
- preview component
- Throws:
FileNotFoundException- On badnessIOException- On badness
-