com.davisor.graphics.chart
Interface Chart

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractChart

public interface Chart
extends java.io.Serializable

Chart represents some form of a result generated by a chart factory. The result is encoded with a MIME type returned by getContentType(). The content itself may be read with putContent(java.io.OutputStream). Finally, if the result involves any AnnotatedShape objects, they can be access with getAnnotatedShapes() method.

Since:
JDK1.2
See Also:
getAnnotatedShapes(), getContentType(), putContent(java.io.OutputStream), ChartAttributes, ChartData, ChartFactory

Method Summary
 java.util.List getAnnotatedShapes()
          Returns the current list of recorded annotated shapes.
 java.lang.String getContentType()
          Gets the chart content encoding MIME type.
 float getHeight()
          Gets chart height in pixels.
 java.lang.Number getResolution()
          Gets chart raster image pixels-per-millimeter resolution.
 float getWidth()
          Gets chart width in pixels.
 void putContent(java.io.OutputStream stream)
          Puts the chart content into given stream.
 

Method Detail

getAnnotatedShapes

public java.util.List getAnnotatedShapes()
Returns the current list of recorded annotated shapes. The annotated shapes are represented with AnnotatedShape objects, with the annotation information as label, and the corresponding 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.


getContentType

public java.lang.String getContentType()
Gets the chart content encoding MIME type.

Returns:
content encoding MIME type (never null)
See Also:
putContent(java.io.OutputStream)

getHeight

public float getHeight()
Gets chart height in pixels.

See Also:
getWidth(), getResolution(), AbstractChart.getHeightInMillimeters()

getResolution

public java.lang.Number getResolution()
Gets chart raster image pixels-per-millimeter resolution. In particular, wWhen resolution is defined, the absolute size of this chart is computed as follows:
   resolution          = getResolution().floatValue();
   widthInMillimeters  = getWidth()  / resolution;
   heightInMillimeters = getHeight() / resolution;
 

For other than raster bitmap charts, the resolution value is irrelevant.

Returns:
raster image resolution, as described above
See Also:
getHeight(), getWidth(), ChartAttributes.getResolution()

getWidth

public float getWidth()
Gets chart width in pixels.

See Also:
getHeight(), getResolution(), AbstractChart.getWidthInMillimeters()

putContent

public void putContent(java.io.OutputStream stream)
                throws java.io.IOException
Puts the chart content into given stream.

Parameters:
stream - stream to write chart content into
Throws:
java.io.IOException - if an I/O error occurs
See Also:
getContentType()


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.