|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.AbstractChart
com.davisor.graphics.chart.ImageChart
ImageChart represents an image chart.
ImageChart objects may also contain information about the general inner layout of chart components over the surface of the chart image. Two main areas are defined: chart backround area, and chart plot area. Plot area resides inside chart backround area, and chart backround resides inside chart image area. Plot area defines principal chart data visualization area, like for example the inner bounds of a 2D coordinate axis system. Background area covers that too, plus any labels and titles running along the coordinate axis system edges. Outside backround area there may still be some outer decorations, like a wide outer borderline.
ImageChart objects may also contain a reference to a Java Graphics2D context that if used for drawing, will apply additional graphics over the chart image. The context, in available, will always initially have identity transformation and no clipping regions. The initial values of all other graphics context parameters are undefined, and they should be explicitly set before invoking any operations that depend on them.
ImageChart comes also with a set of convenience image
encoding methods to encoding chart images into different image
formats. This functionality relies on the encoding powers of the
CodecFactory class.
ImageChart sub-classes may define additional or alternative methods to access chart image data.
ChartAttributes,
ChartData,
ChartFactory,
Serialized Form| Field Summary | |
protected java.awt.geom.Rectangle2D |
M_backArea
Chart background area. |
protected AnnotatedGraphics2D |
M_graphics
Chart graphics content. |
protected java.awt.Image |
M_image
Chart image. |
protected java.lang.String |
M_imageParams
Chart content encoding image parameters. |
protected java.awt.geom.Rectangle2D |
M_plotArea
Chart plot area. |
| Fields inherited from class com.davisor.graphics.chart.AbstractChart |
M_annotatedShapes, M_contentType, M_height, M_resolution, M_width |
| Constructor Summary | |
|
ImageChart(ImageChart ic)
Shallow copy constructor. |
protected |
ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes)
Creates a new image chart. |
|
ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes,
AnnotatedGraphics2D graphics,
java.awt.Image image,
java.lang.String imageParams,
java.awt.geom.Rectangle2D backArea,
java.awt.geom.Rectangle2D plotArea)
Creates a new image chart. |
protected |
ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes,
java.lang.String imageParams)
Creates a new image chart. |
| Method Summary | |
java.util.List |
getAnnotatedShapes()
Returns the current list of recorded serializable annotated shapes. |
java.awt.geom.Rectangle2D |
getBackArea()
Gets the chart background area bounds. |
java.awt.Graphics2D |
getGraphics()
Gets the chart graphics' context. |
java.awt.Image |
getImage()
Gets chart image. |
java.lang.String |
getImageParams()
Gets chart image parameters. |
java.awt.geom.Rectangle2D |
getPlotArea()
Gets the chart plot area bounds. |
void |
putContent(java.io.OutputStream stream)
Puts the chart content. |
void |
putImage(java.io.OutputStream stream)
Deprecated. replaced with putContent(java.io.OutputStream) |
void |
putImage(java.io.OutputStream stream,
java.lang.String mime)
Writes the chart image into an output stream, using spesific encoding. |
void |
putImage(java.lang.String file)
Writes the chart image into a file. |
void |
putImage(java.lang.String file,
java.lang.String contentType)
Writes the chart image into a file, using given MIME type. |
protected void |
setAntialiasDefaults(ChartAttributes attr)
Sets current graphics' context antialias default rendering hints. |
protected void |
setAntialiasMode(ChartAttributes attr)
Sets current graphics' context antialias rendering hints. |
protected void |
setAntialiasMode(int antialiasMode)
Sets current graphics' context antialias rendering hints. |
protected java.lang.Object |
writeReplace()
Subsitutes this object with a ByteArrayChart object during
this object serialization. |
| Methods inherited from class com.davisor.graphics.chart.AbstractChart |
addAnnotatedShape, getContentType, getHeight, getHeightInMillimeters, getResolution, getSizeInMillimeters, getWidth, getWidthInMillimeters, putChart, putChart, setContentType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.awt.geom.Rectangle2D M_backArea
protected transient AnnotatedGraphics2D M_graphics
protected java.awt.Image M_image
protected java.lang.String M_imageParams
protected java.awt.geom.Rectangle2D M_plotArea
| Constructor Detail |
public ImageChart(ImageChart ic)
ic - image chart to be copied
protected ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes)
width - chart width, in millimeters (may be null)height - chart height, in millimeters (may be null)resolution - resolution, in pixels-per-millimeters (may be null)contentType - chart content encoding type (may be null)annotatedShapes - list of annotated shapes (may be null)
protected ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes,
java.lang.String imageParams)
width - chart width, in millimeters (may be null)height - chart height, in millimeters (may be null)resolution - resolution, in pixels-per-millimeters (may be null)contentType - chart content encoding type (may be null)annotatedShapes - list of annotated shapes (may be null)imageParams - image encoding parameters (may be null)
public ImageChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes,
AnnotatedGraphics2D graphics,
java.awt.Image image,
java.lang.String imageParams,
java.awt.geom.Rectangle2D backArea,
java.awt.geom.Rectangle2D plotArea)
width - chart width, in millimeters (may be null)height - chart height, in millimeters (may be null)resolution - resolution, in pixels-per-millimeters (may be null)contentType - chart content encoding type (may be null)annotatedShapes - list of annotated shapes (may be null)graphics - graphics context to draw into the chart image
(may be null)image - the chart image (may be null, in which case a
sub-class should provide an alternative way to access chart
image)imageParams - image encoding parametersbackArea - chart background area bounds (may be null)plotArea - chart plot area bounds (may be null)AbstractChart.getHeight(),
getImage(),
AbstractChart.getWidth()| Method Detail |
public java.util.List getAnnotatedShapes()
AnnotatedSerializableShape objects, with the annotation
information as label, and the corresponding serializable shape as
assosiated object.
The list elements are arranged in last-in-first-out (LIFO) order, so that shapes drawn last are encountered first when traversing the list from beginning to end.
The returned list object refers directly to the list object this
Chart uses to store the recorded shapes. Any
modifications to the list will therefore affect this
Chart instance, too.
This implementation of this method calls the corresponding AnnotatedGraphics2D.getAnnotatedShapes() method of the current
graphics context instance.
getAnnotatedShapes in interface ChartgetAnnotatedShapes in class AbstractChartAnnotatedGraphics2D.getAnnotatedShapes()
public void putContent(java.io.OutputStream stream)
throws java.io.IOException
stream - stream to write chart content into
java.io.IOException - if an I/O error occursAbstractChart.getContentType(),
putImage(OutputStream,String)protected void setAntialiasMode(ChartAttributes attr)
setAntialiasDefaults(com.davisor.graphics.chart.ChartAttributes) are set.
attr - attributes to read antialias mode fromsetAntialiasDefaults(ChartAttributes),
setAntialiasMode(int),
ChartAttributes.getAntialiasMode()protected void setAntialiasMode(int antialiasMode)
antialiasMode - antialias mode (as defined by RenderAttributesChartAttributes.getAntialiasMode()protected void setAntialiasDefaults(ChartAttributes attr)
This default implementation seeks chart attributes encoder info
with ChartAttributes.getEncoderInfo(), and if found,
applies them on curreng graphics.
attr - attributes to read encoder info fromChartAttributes.getEncoderInfo(),
MimeInfo,
MimeInfo.configureHints(java.awt.Graphics2D)public java.awt.geom.Rectangle2D getBackArea()
AbstractChart.getHeight(),
getPlotArea(),
AbstractChart.getWidth()public java.awt.Graphics2D getGraphics()
null is returned.
getImage()public java.awt.Image getImage()
Chart sub-classes may define additional or alternative methods to
access chart image data. If sub-class implementation can not
provide a direct reference to chart image, null is
returned. In that case, the sub-class should provide an
alternative method to access the image data.
getGraphics()public java.lang.String getImageParams()
CodecFactory.getImageEncoder(java.lang.String) method.
public java.awt.geom.Rectangle2D getPlotArea()
getBackArea(),
AbstractChart.getHeight(),
AbstractChart.getWidth()
public void putImage(java.lang.String file)
throws java.io.IOException
CodecFactory, using the current MIME type.
file - output file name
java.io.IOException - if an I/O error occurs,AbstractChart.getContentType(),
putImage(OutputStream),
putImage(String,String)
public void putImage(java.io.OutputStream stream)
throws java.io.IOException
putContent(java.io.OutputStream)
CodecFactory, using the current MIME type.
stream - output stream
java.io.IOException - if an I/O error occursputImage(String),
putImage(OutputStream,String),
ChartAttributes.getContentType(),
CodecFactory
public void putImage(java.lang.String file,
java.lang.String contentType)
throws java.io.IOException
CodecFactory. If the given encoding
type is null, the default encoding type
image/png is used instead.
file - output file namecontentType - output MIME type (may be null)
java.io.IOException - if an I/O error occursputImage(OutputStream,String)
public void putImage(java.io.OutputStream stream,
java.lang.String mime)
throws java.io.IOException
CodecFactory. If the
given mime type is null, the default encoding type
image/png is used instead.
stream - output streammime - output mime type (may be null)
java.io.IOExceptiongetImage(),
CodecFactory.putImage(Image,OutputStream,String)
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException
ByteArrayChart object during
this object serialization.
java.io.ObjectStreamExceptionByteArrayChart.ByteArrayChart(Chart)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||