|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.AbstractChart
AbstractChart represents a base class for all concrete implementations
of the Chart interface.
ChartAttributes,
ChartData,
ChartFactory,
Serialized Form| Field Summary | |
protected java.util.List |
M_annotatedShapes
List of serializable annotated shapes. |
protected java.lang.String |
M_contentType
Chart content MIME type. |
protected java.lang.Number |
M_height
Chart height, in millimeters. |
protected java.lang.Number |
M_resolution
Chart pixels-per-millimeter raster image resolution. |
protected java.lang.Number |
M_width
Chart width, in millimeters. |
| Constructor Summary | |
|
AbstractChart(AbstractChart ac)
Shallow copy constructor. |
protected |
AbstractChart(java.lang.Number width,
java.lang.Number height,
java.lang.Number resolution,
java.lang.String contentType,
java.util.List annotatedShapes)
Creates a new abstract chart. |
| Method Summary | |
void |
addAnnotatedShape(java.lang.Object shape)
|
java.util.List |
getAnnotatedShapes()
Get the current list of recorded annotated shapes. |
java.lang.String |
getContentType()
Gets the chart content MIME type. |
float |
getHeight()
Gets chart height as described by Chart.getHeight().
|
float |
getHeightInMillimeters()
Gets chart height in pixels. |
java.lang.Number |
getResolution()
Gets chart raster image pixels-per-millimeter resolution as described by Chart.getResolution(). |
static float |
getSizeInMillimeters(float size,
java.lang.Number resolution)
Computes chart size in pixels. |
float |
getWidth()
Gets chart width as described by Chart.getWidth().
|
float |
getWidthInMillimeters()
Gets chart width in pixels. |
void |
putChart(java.lang.String file)
Writes this chart into a file, using current MIME type. |
static void |
putChart(java.lang.String file,
Chart chart)
Writes given chart into a file, using chart current MIME type. |
void |
setContentType(java.lang.String contentType)
Sets the chart content MIME type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.davisor.graphics.chart.Chart |
putContent |
| Field Detail |
protected java.util.List M_annotatedShapes
protected java.lang.String M_contentType
protected java.lang.Number M_height
protected java.lang.Number M_resolution
protected java.lang.Number M_width
| Constructor Detail |
public AbstractChart(AbstractChart ac)
ac - chart to be copied
protected AbstractChart(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 MIME type (may be null)annotatedShapes - list of annotated shapes (may be null)| Method Detail |
public java.util.List getAnnotatedShapes()
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 instance uses to store the recorded shapes. Any modifications to the list will therefore affect this instance, too.
getAnnotatedShapes in interface Chartpublic void addAnnotatedShape(java.lang.Object shape)
public java.lang.String getContentType()
getContentType in interface ChartChart.putContent(java.io.OutputStream),
setContentType(java.lang.String)public float getHeight()
Chart.getHeight().
If chart height is not set, zero is returned.
getHeight in interface ChartgetWidth(),
getResolution()public java.lang.Number getResolution()
Chart.getResolution().
getResolution in interface ChartgetHeight(),
getWidth(),
ChartAttributes.getResolution()public float getWidth()
Chart.getWidth().
If chart height is not set, zero is returned.
getWidth in interface ChartgetHeight(),
getResolution()public float getHeightInMillimeters()
getHeight(),
getResolution(),
getSizeInMillimeters(float, java.lang.Number)public float getWidthInMillimeters()
getResolution(),
getSizeInMillimeters(float, java.lang.Number),
getWidth()
public static float getSizeInMillimeters(float size,
java.lang.Number resolution)
null, the
given size is expected to already be expressed in pixels, and it
is therefore just returned unmodified.
size - chart sizeresolution - chart resolution (may be null)
public void putChart(java.lang.String file)
throws java.io.IOException
file - output file name
java.io.IOException - if an I/O error occurs
public static void putChart(java.lang.String file,
Chart chart)
throws java.io.IOException
file - output file namechart - chart to write
java.io.IOException - if an I/O error occurspublic void setContentType(java.lang.String contentType)
Chart interface.
contentType - new chart content typegetContentType()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||