Package ca.ualberta.stothard.cgview
Class CgviewIO
java.lang.Object
ca.ualberta.stothard.cgview.CgviewIO
- All Implemented Interfaces:
CgviewConstants
This class contains static methods for converting Cgview objects to image files. Images can be
generated in PNG, JPG, SVG, and SVGZ (gzipped SVG) formats.
- Author:
- Paul Stothard
-
Field Summary
Fields inherited from interface ca.ualberta.stothard.cgview.CgviewConstants
BASES, BOUNDS_BUTTON, BOUNDS_FEATURE, BOUNDS_RULER, CENTISOMES, DECORATION_CLOCKWISE_ARROW, DECORATION_COUNTERCLOCKWISE_ARROW, DECORATION_HIDDEN, DECORATION_STANDARD, DIRECT_STRAND, INNER_LABELS_AUTO, INNER_LABELS_NO_SHOW, INNER_LABELS_SHOW, LABEL, LABEL_FORCE, LABEL_NONE, LABEL_ZOOMED, LEGEND_DRAW_ZOOMED, LEGEND_ITEM_ALIGN_CENTER, LEGEND_ITEM_ALIGN_LEFT, LEGEND_ITEM_ALIGN_RIGHT, LEGEND_LOWER_CENTER, LEGEND_LOWER_LEFT, LEGEND_LOWER_RIGHT, LEGEND_MIDDLE_CENTER, LEGEND_MIDDLE_LEFT, LEGEND_MIDDLE_LEFT_OF_CENTER, LEGEND_MIDDLE_RIGHT, LEGEND_MIDDLE_RIGHT_OF_CENTER, LEGEND_NO_DRAW_ZOOMED, LEGEND_UPPER_CENTER, LEGEND_UPPER_LEFT, LEGEND_UPPER_RIGHT, POSITIONS_AUTO, POSITIONS_NO_SHOW, POSITIONS_SHOW, REVERSE_STRAND, SWATCH_NO_SHOW, SWATCH_SHOW
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
writeHTMLFile
(Cgview cgview, String imageFilename, String imageFormat, String htmlFilename) Creates an HTML file that links to a Cgview map.static void
writeHTMLFile
(Cgview cgview, String imageFilename, String imageFormat, String htmlFilename, boolean useOverlib) Creates an HTML file that links to a Cgview map.static void
writeToJPGFile
(Cgview cgview, String filename) Writes a Cgview object to a JPG file.static void
writeToJPGFile
(Cgview cgview, String filename, boolean keepLastLabels) Writes a Cgview object to a JPG file.static void
writeToPNGFile
(Cgview cgview, String filename) Writes a Cgview object to a PNG file.static void
writeToPNGFile
(Cgview cgview, String filename, boolean keepLastLabels) Writes a Cgview object to a PNG file.static void
writeToSVGFile
(Cgview cgview, String filename, boolean useCompression) Writes a Cgview object to a SVG or a SVGZ file.static void
writeToSVGFile
(Cgview cgview, String filename, boolean useCompression, boolean keepLastLabels) Writes a Cgview object to a SVG or a SVGZ file.
-
Constructor Details
-
CgviewIO
public CgviewIO()
-
-
Method Details
-
writeToSVGFile
public static void writeToSVGFile(Cgview cgview, String filename, boolean useCompression) throws FileNotFoundException, IOException, UnsupportedEncodingException, org.apache.batik.svggen.SVGGraphics2DIOException Writes a Cgview object to a SVG or a SVGZ file. Any mouseover or hyperlink information associated with the Cgview object is embedded directly in the SVG.- Parameters:
cgview
- the Cgview object.filename
- the file to create.useCompression
- whether or not to generate compressed SVG (SVGZ).- Throws:
FileNotFoundException
IOException
UnsupportedEncodingException
org.apache.batik.svggen.SVGGraphics2DIOException
-
writeToSVGFile
public static void writeToSVGFile(Cgview cgview, String filename, boolean useCompression, boolean keepLastLabels) throws FileNotFoundException, IOException, UnsupportedEncodingException, org.apache.batik.svggen.SVGGraphics2DIOException Writes a Cgview object to a SVG or a SVGZ file. Any mouseover or hyperlink information associated with the Cgview object is embedded directly in the SVG.- Parameters:
cgview
- the Cgview object.filename
- the file to create.useCompression
- whether or not to generate compressed SVG (SVGZ).keepLastLabels
- whether or not to use labels generated by a previous call to one of the Cgview objects draw() or drawZoomed() methods.- Throws:
FileNotFoundException
IOException
UnsupportedEncodingException
org.apache.batik.svggen.SVGGraphics2DIOException
-
writeToPNGFile
public static void writeToPNGFile(Cgview cgview, String filename, boolean keepLastLabels) throws IOException Writes a Cgview object to a PNG file.- Parameters:
cgview
- the Cgview object.filename
- the file to create.keepLastLabels
- whether or not to use labels generated by a previous call to one of the Cgview objects draw() or drawZoomed() methods.- Throws:
IOException
-
writeToPNGFile
Writes a Cgview object to a PNG file.- Parameters:
cgview
- the Cgview object.filename
- the file to create.- Throws:
IOException
-
writeToJPGFile
public static void writeToJPGFile(Cgview cgview, String filename, boolean keepLastLabels) throws IOException Writes a Cgview object to a JPG file.- Parameters:
cgview
- the Cgview object.filename
- the file to create.keepLastLabels
- whether or not to use labels generated by a previous call to one of the Cgview objects draw() or drawZoomed() methods.- Throws:
IOException
-
writeToJPGFile
Writes a Cgview object to a JPG file.- Parameters:
cgview
- the Cgview object.filename
- the file to create.- Throws:
IOException
-
writeHTMLFile
public static void writeHTMLFile(Cgview cgview, String imageFilename, String imageFormat, String htmlFilename) throws FileNotFoundException, IOException Creates an HTML file that links to a Cgview map. Any hyperlink or mouseover information associated with the Cgview object is included in an image map in the HTML file (in the case of PNG and JPG maps). In the case of SVG and SVGZ maps, the mouseover and hyperlink information is embedded directly in the SVG.- Parameters:
cgview
- the Cgview object embedded in the HTML.imageFilename
- the name of the image file containing the Cgview image.imageFormat
- the format of the image file.htmlFilename
- the HTML file to generate.- Throws:
FileNotFoundException
IOException
-
writeHTMLFile
public static void writeHTMLFile(Cgview cgview, String imageFilename, String imageFormat, String htmlFilename, boolean useOverlib) throws FileNotFoundException, IOException Creates an HTML file that links to a Cgview map. Any hyperlink or mouseover information associated with the Cgview object is included in an image map in the HTML file (in the case of PNG and JPG maps). In the case of SVG and SVGZ maps, the mouseover and hyperlink information is embedded directly in the SVG.- Parameters:
cgview
- the Cgview object embedded in the HTML.imageFilename
- the name of the image file containing the Cgview image.imageFormat
- the format of the image file.htmlFilename
- the HTML file to generate.useOverlib
- whether to use the overlib javascript library for mouseovers (recommended)- Throws:
FileNotFoundException
IOException
-
main
-