com.davisor.graphics.chart
Class ByteArrayChart

java.lang.Object
  extended bycom.davisor.graphics.chart.AbstractChart
      extended bycom.davisor.graphics.chart.ByteArrayChart
All Implemented Interfaces:
Chart, java.io.Serializable

public class ByteArrayChart
extends AbstractChart

ByteArrayChart represents some form of final chart output, encoded and stored into a memory buffer.

Since:
JDK1.2
See Also:
ChartAttributes, ChartData, ChartFactory, Serialized Form

Field Summary
protected  byte[] M_content
          Encoded chart content.
 
Fields inherited from class com.davisor.graphics.chart.AbstractChart
M_annotatedShapes, M_contentType, M_height, M_resolution, M_width
 
Constructor Summary
ByteArrayChart(Chart chart)
          Creates a shallow byte array copy of given chart.
ByteArrayChart(java.lang.Number width, java.lang.Number height, java.lang.Number resolution, java.lang.String contentType, java.util.List annotatedShapes, byte[] content)
          Creates and initializes a new byte array chart.
 
Method Summary
 byte[] getBuffer()
          Gets a reference to the internal byte array.
 java.io.InputStream getContent()
          Gets a new input stream containing the encoded chart image data.
 void putContent(java.io.OutputStream stream)
          Puts the chart content into given stream.
 
Methods inherited from class com.davisor.graphics.chart.AbstractChart
addAnnotatedShape, getAnnotatedShapes, 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

M_content

protected byte[] M_content
Encoded chart content.

Constructor Detail

ByteArrayChart

public ByteArrayChart(Chart chart)
               throws java.io.IOException
Creates a shallow byte array copy of given chart. The copy will have no references back to the original chart object, except if the source chart is an instance of a byte array chart, in which case the new chart will share it's encoded image byte array with the source chart, along with all the other chart members.

Parameters:
chart - chart to be copied

ByteArrayChart

public ByteArrayChart(java.lang.Number width,
                      java.lang.Number height,
                      java.lang.Number resolution,
                      java.lang.String contentType,
                      java.util.List annotatedShapes,
                      byte[] content)
Creates and initializes a new byte array chart. In particular, the given content becomes the internal byte array.

Parameters:
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 MIME type
annotatedShapes - list of serializable annotated shapes
content - encoded chart content
Method Detail

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:
AbstractChart.getContentType()

getBuffer

public byte[] getBuffer()
Gets a reference to the internal byte array.


getContent

public java.io.InputStream getContent()
Gets a new input stream containing the encoded chart image data.



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