|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetcharts.pro.common.NFImageGeneration
public class NFImageGeneration
This class provides powerful methods for generating images and image map data. For a simpler/quicker implementation for server side image generation, you may wish to use the methods in the NFServletUtil class.
The following image types are supported:
image/bmp image/jpeg image/pict image/png image/psd image/tga image/tiff image/xpm image/xbm image/x-cmu-raster image/pcx image/svg+xml image/wbmp
Field Summary | |
---|---|
static int |
COMPRESSION_DEFLATE
DEFLATE lossless compression (also known as "Zip-in-TIFF"). |
static int |
COMPRESSION_GROUP3_1D
Modified Huffman Compression (CCITT Group 3 1D facsimile compression). |
static int |
COMPRESSION_GROUP3_2D
CCITT T.4 bilevel compression (CCITT Group 3 2D facsimile compression). |
static int |
COMPRESSION_GROUP4
CCITT T.6 bilevel compression (CCITT Group 4 facsimile compression). |
static int |
COMPRESSION_JPEG_TTN2
JPEG-in-TIFF compression. |
static int |
COMPRESSION_NONE
No compression. |
static int |
COMPRESSION_PACKBITS
Byte-oriented run-length encoding "PackBits" compression. |
static java.lang.String |
DEFAULT_MIME_TYPE
Default MIME type. |
static java.lang.String |
MIME_TYPE_BMP
BMP (image/bmp) |
static java.lang.String |
MIME_TYPE_JPG
JPG (image/jpg) |
static java.lang.String |
MIME_TYPE_PCX
PCX (image/pcx) |
static java.lang.String |
MIME_TYPE_PICT
PICT (image/pict) |
static java.lang.String |
MIME_TYPE_PNG
PNG (image/png) |
static java.lang.String |
MIME_TYPE_SVG
SVG (image/svg+xml) |
static java.lang.String |
MIME_TYPE_TGA
TGA (image/tga) |
static java.lang.String |
MIME_TYPE_TIFF
TIFF (image/tiff) |
static java.lang.String |
MIME_TYPE_WBMP
WBMP (image/wbmp) |
static java.lang.String |
MIME_TYPE_XBM
XBM (image/xbm) |
static java.lang.String |
MIME_TYPE_XPM
XPM (image/xpm) |
Constructor Summary | |
---|---|
NFImageGeneration()
|
Method Summary | |
---|---|
static byte[] |
generateImage(NFGraph graph,
NFImageParams params)
Generates an image of the given graph. |
static byte[] |
generateImage(NFGraph graph,
java.lang.String mimeType)
Deprecated. Use generateImage(NFGraph, NFImageParams) |
static java.awt.Image |
getAWTImage(NFGraph graph)
Generates a java.awt.Image of the given graph. |
static java.awt.Image |
getAWTImage(NFGraph graph,
int imageType)
Generates a java.awt.Image of the given graph. |
static int |
getJPGQuality()
Deprecated. |
static boolean |
getPNGTransparency()
Deprecated. |
static NFServerGeneratedImage |
getServerGeneratedImage(NFGraph graph,
NFImageParams params)
Outputs the chart to NFServerGeneratedImage object, using the image parameters specified. |
static NFServerGeneratedImage |
getServerGeneratedImage(NFGraph graph,
java.lang.String mimeType,
java.lang.String textDescription,
boolean createImageMap)
Deprecated. Use getServerGeneratedImage(NFGraph, NFImageParams) |
static int |
getTIFFCompression()
Deprecated. |
static void |
setJPGQuality(int quality)
Deprecated. Use the appropriate method in the JPG image params object. |
static void |
setPNGTransparency(boolean transparent)
Deprecated. Use the appropriate method in the PNG image params object. |
static void |
setTIFFCompression(int compression)
Deprecated. Use the appropriate method in the TIFF image params object. |
static void |
writeImage(NFGraph graph,
java.lang.String mimeType,
java.io.OutputStream outputStream)
Deprecated. Write to the OutputStream using the result of calling generateImage(NFGraph, NFImageParams) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COMPRESSION_NONE
public static final int COMPRESSION_PACKBITS
public static final int COMPRESSION_GROUP3_1D
Not currently supported.
public static final int COMPRESSION_GROUP3_2D
Not currently supported.
public static final int COMPRESSION_GROUP4
Not currently supported.
public static final int COMPRESSION_JPEG_TTN2
public static final int COMPRESSION_DEFLATE
public static final java.lang.String MIME_TYPE_PNG
public static final java.lang.String MIME_TYPE_TIFF
public static final java.lang.String MIME_TYPE_JPG
public static final java.lang.String MIME_TYPE_BMP
public static final java.lang.String MIME_TYPE_TGA
public static final java.lang.String MIME_TYPE_XPM
public static final java.lang.String MIME_TYPE_XBM
public static final java.lang.String MIME_TYPE_PICT
public static final java.lang.String MIME_TYPE_WBMP
public static final java.lang.String DEFAULT_MIME_TYPE
public static final java.lang.String MIME_TYPE_SVG
public static final java.lang.String MIME_TYPE_PCX
Constructor Detail |
---|
public NFImageGeneration()
Method Detail |
---|
public static void setTIFFCompression(int compression)
COMPRESSION_NONE, COMPRESSION_PACKBITS (default), COMPRESSION_GROUP3_1D,
COMPRESSION_GROUP3_2D, COMPRESSION_JPEG_TTN2 or COMPRESSION_DEFLATE
.
compression
- The type of compression to use.public static int getTIFFCompression()
public static void setJPGQuality(int quality)
0
to 100
. The higher the value, the less
compression will be used and better quality, but also larger file size.
The default value used is 75
.
quality
- The quality level.public static int getJPGQuality()
public static void setPNGTransparency(boolean transparent)
Background = (white_0,NONE,1,"null",TILE,black);
The transparency can be in most modern browsers.
By default PNG transparency is enabled.
transparent
- Whether or not transparent backgrounds will be supported
in the PNG images of charts generated.public static boolean getPNGTransparency()
public static NFServerGeneratedImage getServerGeneratedImage(NFGraph graph, java.lang.String mimeType, java.lang.String textDescription, boolean createImageMap) throws java.lang.Exception
graph
- The graph object to generate an image for.mimeType
- the mime type format for the chart image created.textDescription
- The value to use in the ALT tagcreateImageMap
- generate the image map or not.
java.lang.Exception
public static NFServerGeneratedImage getServerGeneratedImage(NFGraph graph, NFImageParams params) throws java.lang.Exception
graph
- The graph object to generate an image for.params
- The image generation parameters
java.lang.Exception
public static void writeImage(NFGraph graph, java.lang.String mimeType, java.io.OutputStream outputStream) throws java.lang.Exception
graph
- The graph object to generate an image for.mimeType
- The mime type format for the chart image created.outputStream
- The stream to write the image bytes to.
java.lang.Exception
public static java.awt.Image getAWTImage(NFGraph graph) throws java.lang.Exception
graph
- The graph object to generate a java.awt.Image of.
java.lang.Exception
public static java.awt.Image getAWTImage(NFGraph graph, int imageType) throws java.lang.Exception
graph
- The graph object to generate a java.awt.Image of.imageType
- The image type to create. Examples include:
java.awt.image.BufferedImage.TYPE_BYTE_INDEXED java.awt.image.BufferedImage.TYPE_BYTE_BINARY java.awt.image.BufferedImage.TYPE_INT_ARGB etc.
java.lang.Exception
public static byte[] generateImage(NFGraph graph, java.lang.String mimeType) throws java.lang.Exception
graph
- The graph object to generate an image for.mimeType
- The mime type format for the chart image created.
java.lang.Exception
public static byte[] generateImage(NFGraph graph, NFImageParams params) throws java.lang.Exception
graph
- The graph object to generate an image for.params
- The image generation parameters
java.lang.Exception
|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2011 |
Last Modified: Jun 28, 2011 |