com.f1j.swing.engine.ss
Class ChartImageEncoder

java.lang.Object
  |
  +--com.actuate.util.Debug
        |
        +--com.f1j.util.Debug
              |
              +--com.f1j.util.ObjConst
                    |
                    +--com.f1j.util.Obj
                          |
                          +--com.f1j.swing.common.ImageEncoder
                                |
                                +--com.f1j.swing.engine.ss.ChartImageEncoder
Direct Known Subclasses:
ChartImageEncoder

public class ChartImageEncoder
extends ImageEncoder
implements com.f1j.swing.common.ImageDrawIF

This class encodes a chart as a GIF or PNG image using a run-length encoding algorithm. This class extends the ImageEncoder class and can be used to write out an image map in XML.

See Also:
ImageEncoder

Method Summary
 void encode(JBook jbook, FcChart chart)
          Creates an image of the given FcChart object.
 void encode(JBook jbook, FcChart chart, int iWidth, int iHeight)
          Creates an image of the given FcChart object of the given height and width.
 void encode(JBook jbook, FcChart chart, int iWidth, int iHeight, int iScale)
          Creates an image of the given FcChart object of the given height, width, and view scale.
 void encode(JBook jbook, GRChart chart)
          Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart).
 void encode(JBook jbook, GRChart chart, int iWidth, int iHeight)
          Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, int, int).
 void encode(JBook jbook, GRChart chart, int iWidth, int iHeight, int iScale)
          Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, int, int, int).
 void encodeWithoutViewScale(JBook jbook, FcChart chart)
          Creates an image of the given FcChart object without regard to its display size.
 void encodeWithoutViewScale(JBook jbook, GRChart chart)
          Deprecated. Replaced by encodeWithouViewScale(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart).
 java.lang.String getDataPointValue(java.lang.String seriesName, java.lang.String pointName)
          Returns the value for the given data point on the given series.
 java.awt.Polygon getImageMapChartCoordinates()
          Returns the coordinates of the current chart.
 java.awt.Polygon getImageMapDataPointCoordinates(java.lang.String seriesName, java.lang.String pointName)
          Returns the coordinates for the given data point on the given series.
 java.awt.Polygon getImageMapLegendCoordinates()
          Returns the coordinates of the legend of the current chart.
 java.awt.Polygon getImageMapLegendItemCoordinates(java.lang.String legendName)
          Returns the coordinates of the given item in the legend of the current chart.
 java.awt.Polygon getImageMapPlotCoordinates()
          Returns the coordinates of the plot of the current chart.
 java.awt.Polygon getImageMapSeriesCoordinates(java.lang.String seriesName)
          Returns the coordinates of the given series of the current chart.
 java.awt.Polygon getImageMapTitleCoordinates()
          Returns the coordinates of the title of the current chart.
 int getOptimalSize(JBook jbook, FcChart chart, java.awt.Dimension dims)
          Returns the width, height, and scale of the given chart.
 int getOptimalSize(JBook jbook, GRChart chart, java.awt.Dimension dims)
          Deprecated. Replaced by getOptimalSize(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, java.awt.Dimension).
 
Methods inherited from class com.f1j.swing.common.ImageEncoder
getBackgroundColor, getImage, getOriginalImage, isCreateImageMap, setAntiAliasing, setBackgroundColor, setCreateImageMap, setGraphics, setImageMapDefaultUrl, setImageMapName, setOptimizedPalette, setPalette, setPalette, setUseStandard16Colors, useAllColors, useGrayScalePalette, useOptimizedPalette, useStandardPalette, writeEPSIMG, writeImage, writeImageMap, writeImageMap, writePNG, writeRLEGIF
 

Method Detail

encode

public void encode(JBook jbook,
                   GRChart chart)
            throws F1Exception
Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart).
Creates an image of the given GRChart object.
Parameters:
jbook - a JBook object.
chart - a GRChart object.
Throws:
F1Exception - if a parameter is invalid

encode

public void encode(JBook jbook,
                   FcChart chart)
            throws F1Exception
Creates an image of the given FcChart object.
Parameters:
jbook - a JBook object.
chart - a FcChart object.
Throws:
F1Exception - if a parameter is invalid

encodeWithoutViewScale

public void encodeWithoutViewScale(JBook jbook,
                                   GRChart chart)
                            throws F1Exception
Deprecated. Replaced by encodeWithouViewScale(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart).
Creates an image of the given GRChart object without regard to its display size.
Parameters:
jbook - a JBook object.
chart - a GRChart object.
Throws:
F1Exception - if a parameter is invalid

encodeWithoutViewScale

public void encodeWithoutViewScale(JBook jbook,
                                   FcChart chart)
                            throws F1Exception
Creates an image of the given FcChart object without regard to its display size.
Parameters:
jbook - a JBook object.
chart - a FcChart object.
Throws:
F1Exception - if a parameter is invalid

encode

public void encode(JBook jbook,
                   GRChart chart,
                   int iWidth,
                   int iHeight)
            throws F1Exception
Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, int, int).
Creates an image of the given GRChart object of the given height and width. The aspect ratio of the image is maintained regardless of the height and width settings.
Parameters:
jbook - a JBook object.
chart - a GRChart object.
iWidth - an int indicating the width of the output graphic.
iHeight - an int indicating the height of the output graphic.
Throws:
F1Exception - if a parameter is invalid

encode

public void encode(JBook jbook,
                   FcChart chart,
                   int iWidth,
                   int iHeight)
            throws F1Exception
Creates an image of the given FcChart object of the given height and width. The aspect ratio of the image is maintained regardless of the height and width settings.
Parameters:
jbook - a JBook object.
chart - a FcChart object.
iWidth - an int indicating the width of the output graphic.
iHeight - an int indicating the height of the output graphic.
Throws:
F1Exception - if a parameter is invalid

encode

public void encode(JBook jbook,
                   GRChart chart,
                   int iWidth,
                   int iHeight,
                   int iScale)
            throws F1Exception
Deprecated. Replaced by encode(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, int, int, int).
Creates an image of the given GRChart object of the given height, width, and view scale. Aspect ratio is not maintained.
Parameters:
jbook - a JBook object.
chart - a GRChart object.
iWidth - an int indicating the width of the output graphic.
iHeight - an int indicating the height of the output graphic.
iScale - an int indicating the the scale of the output graphic.
Throws:
F1Exception - if a parameter is invalid

encode

public void encode(JBook jbook,
                   FcChart chart,
                   int iWidth,
                   int iHeight,
                   int iScale)
            throws F1Exception
Creates an image of the given FcChart object of the given height, width, and view scale. Aspect ratio is not maintained.
Parameters:
jbook - a JBook object.
chart - a FcChart object.
iWidth - an int indicating the width of the output graphic.
iHeight - an int indicating the height of the output graphic.
iScale - an int indicating the the scale of the output graphic.
Throws:
F1Exception - if a parameter is invalid

getDataPointValue

public java.lang.String getDataPointValue(java.lang.String seriesName,
                                          java.lang.String pointName)
                                   throws F1Exception
Returns the value for the given data point on the given series.
Parameters:
seriesName - a text string indicating the series.
pointName - a text string indicating the data point.
Returns:
a string indicating the value.
Throws:
F1Exception - if a parameter is invalid

getOptimalSize

public int getOptimalSize(JBook jbook,
                          GRChart chart,
                          java.awt.Dimension dims)
                   throws F1Exception
Deprecated. Replaced by getOptimalSize(com.f1j.swing.engine.ss.JBook, com.f1j.ss.FcChart, java.awt.Dimension).
Returns the width, height, and scale of the given chart.
Parameters:
jbook - a JBook object.
chart - a GRChart object.
dims - the size will be set in this object.
Returns:
an int indicating the scale of the object.
Throws:
F1Exception - if a parameter is invalid

getOptimalSize

public int getOptimalSize(JBook jbook,
                          FcChart chart,
                          java.awt.Dimension dims)
                   throws F1Exception
Returns the width, height, and scale of the given chart.
Parameters:
jbook - a JBook object.
chart - a FcChart object.
dims - the size will be set in this object.
Returns:
an int indicating the scale of the object.
Throws:
F1Exception - if a parameter is invalid

getImageMapChartCoordinates

public java.awt.Polygon getImageMapChartCoordinates()
                                             throws F1Exception
Returns the coordinates of the current chart.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapDataPointCoordinates

public java.awt.Polygon getImageMapDataPointCoordinates(java.lang.String seriesName,
                                                        java.lang.String pointName)
                                                 throws F1Exception
Returns the coordinates for the given data point on the given series.
Parameters:
seriesName - a text string indicating the series.
pointName - a text string indicating the data point.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapLegendCoordinates

public java.awt.Polygon getImageMapLegendCoordinates()
                                              throws F1Exception
Returns the coordinates of the legend of the current chart.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapLegendItemCoordinates

public java.awt.Polygon getImageMapLegendItemCoordinates(java.lang.String legendName)
                                                  throws F1Exception
Returns the coordinates of the given item in the legend of the current chart. If the legend item is outside the boundaries of the legend itself, so that it is not visible, then the returned polygon will have all coordinates set to zero.
Parameters:
legendName - a text string indicating the legend item.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapPlotCoordinates

public java.awt.Polygon getImageMapPlotCoordinates()
                                            throws F1Exception
Returns the coordinates of the plot of the current chart.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapSeriesCoordinates

public java.awt.Polygon getImageMapSeriesCoordinates(java.lang.String seriesName)
                                              throws F1Exception
Returns the coordinates of the given series of the current chart.
Parameters:
seriesName - a text string indicating the series.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid

getImageMapTitleCoordinates

public java.awt.Polygon getImageMapTitleCoordinates()
                                             throws F1Exception
Returns the coordinates of the title of the current chart.
Returns:
a polygon indicating the coordinates.
Throws:
F1Exception - if a parameter is invalid