JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCChartFactory

java.lang.Object
  |
  +--com.klg.jclass.chart.JCChartFactory

public class JCChartFactory
extends Object

Factory class that creates JCChart objects from various sources.


Field Summary
static int DATA_FILE_TEXT
           
static int DATA_FILE_XML
           
static int EMBED_DATA
           
static int HTML
          Format (i.e.
static int NO_DATA
          Ways to save data.
 
Constructor Summary
JCChartFactory()
           
 
Method Summary
static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a file.
static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName, String name)
          Makes a JCChart instance by reading HTML-style chart parameters from a file.
static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a file.
static com.klg.jclass.chart.JCChart makeChartFromReader(Reader reader, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a reader.
static com.klg.jclass.chart.JCChart makeChartFromReader(Reader reader, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a reader.
static com.klg.jclass.chart.JCChart makeChartFromStream(InputStream stream, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from an input stream.
static com.klg.jclass.chart.JCChart makeChartFromStream(InputStream stream, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from an input stream.
static com.klg.jclass.chart.JCChart makeChartFromString(String params, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a String.
static com.klg.jclass.chart.JCChart makeChartFromString(String params, String name)
          Makes a JCChart instance by reading HTML-style chart parameters from a String.
static com.klg.jclass.chart.JCChart makeChartFromString(String params, String name, int type)
          Makes a JCChart instance by reading HTML-style chart parameters from a String.
static void saveChartToFile(com.klg.jclass.chart.JCChart chart, String fileName, int type)
          Saves JCChart to a file in HTML format.
static void saveChartToFile(com.klg.jclass.chart.JCChart chart, String fileName, int type, int dataSaveType, String dataFileName)
          Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToFile(chart, fileName, type)
static void saveChartToStream(com.klg.jclass.chart.JCChart chart, OutputStream stream, int type)
          Saves JCChart to an output stream in HTML format.
static void saveChartToStream(com.klg.jclass.chart.JCChart chart, OutputStream stream, int type, int dataSaveType, String dataFileName)
          Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToStream(chart, stream, type)
static String saveChartToString(com.klg.jclass.chart.JCChart chart, int type)
          Saves JCChart to a String in HTML format.
static String saveChartToString(com.klg.jclass.chart.JCChart chart, int type, int dataSaveType, String dataFileName)
          Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToString(chart, type)
static void setOutputDataPropertiesOnChart(com.klg.jclass.chart.JCChart chart, int dataSaveType, String outputDataFileName)
          Set the dataSaveType and the outputDataFileName on all dataViews of the chart.
protected static void updateChart(com.klg.jclass.chart.JCChart chart, String name, int type, Object inputSource, com.klg.jclass.util.io.LoadProperties loadProperties)
          Updates a JCChart instance by reading HTML-style chart parameters from an input source.
static void updateChartFromFile(com.klg.jclass.chart.JCChart chart, String fileName, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a file.
static void updateChartFromFile(com.klg.jclass.chart.JCChart chart, String fileName, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a file.
static void updateChartFromReader(com.klg.jclass.chart.JCChart chart, Reader reader, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a reader.
static void updateChartFromReader(com.klg.jclass.chart.JCChart chart, Reader reader, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a reader.
static void updateChartFromStream(com.klg.jclass.chart.JCChart chart, InputStream stream, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from an input stream.
static void updateChartFromStream(com.klg.jclass.chart.JCChart chart, InputStream stream, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from an input stream.
static void updateChartFromString(com.klg.jclass.chart.JCChart chart, String params, com.klg.jclass.util.io.LoadProperties loadProperties, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a String.
static void updateChartFromString(com.klg.jclass.chart.JCChart chart, String params, String name, int type)
          Updates a JCChart instance by reading HTML-style chart parameters from a String.
static void updateChartWithData(com.klg.jclass.chart.JCChart chart, int dataType, Object data, int dataViewIndex, com.klg.jclass.util.io.LoadProperties lp)
          Updates a JCChart instance with new data coming from a file, an input stream, or a reader.
static void updateChartWithData(com.klg.jclass.chart.JCChart chart, int dataType, Object data, com.klg.jclass.util.io.LoadProperties lp)
          Updates a JCChart instance with new data coming from a file, an input stream, or a reader.
static void updateChartWithData(com.klg.jclass.chart.JCChart chart, int dataType, Object data, String dataViewName, com.klg.jclass.util.io.LoadProperties lp)
          Updates a JCChart instance with new data coming from a file, an input stream, or a reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML

public static final int HTML
Format (i.e. output file) types.

See Also:
Constant Field Values

NO_DATA

public static final int NO_DATA
Ways to save data.

See Also:
Constant Field Values

EMBED_DATA

public static final int EMBED_DATA
See Also:
Constant Field Values

DATA_FILE_TEXT

public static final int DATA_FILE_TEXT
See Also:
Constant Field Values

DATA_FILE_XML

public static final int DATA_FILE_XML
See Also:
Constant Field Values
Constructor Detail

JCChartFactory

public JCChartFactory()
Method Detail

updateChartWithData

public static void updateChartWithData(com.klg.jclass.chart.JCChart chart,
                                       int dataType,
                                       Object data,
                                       com.klg.jclass.util.io.LoadProperties lp)
                                throws IOException
Updates a JCChart instance with new data coming from a file, an input stream, or a reader. This method always updates the first ChartDataView object.

Parameters:
chart - The chart to update
dataType - The type of data (must be DATA_FILE_TEXT or DATA_FILE_XML for anything to happen).
data - the data object (can be a filename String, an InputStream, or a Reader)
lp - a LoadProperties object. This object contains properties relating to file loading and XML parsing.
Throws:
IOException - If problems reading the data object

updateChartWithData

public static void updateChartWithData(com.klg.jclass.chart.JCChart chart,
                                       int dataType,
                                       Object data,
                                       String dataViewName,
                                       com.klg.jclass.util.io.LoadProperties lp)
                                throws IOException
Updates a JCChart instance with new data coming from a file, an input stream, or a reader.

Parameters:
chart - The chart to update
dataType - The type of data (must be DATA_FILE_TEXT or DATA_FILE_XML for anything to happen).
data - the data object (can be a filename String, an InputStream, or a Reader)
dataViewName - The name of the ChartDataView object to update. If the provided name does not match the name of any existing ChartDataView object, then nothing is done.
lp - a LoadProperties object. This object contains properties relating to file loading and XML parsing.
Throws:
IOException - If problems reading the data object

updateChartWithData

public static void updateChartWithData(com.klg.jclass.chart.JCChart chart,
                                       int dataType,
                                       Object data,
                                       int dataViewIndex,
                                       com.klg.jclass.util.io.LoadProperties lp)
                                throws IOException
Updates a JCChart instance with new data coming from a file, an input stream, or a reader.

Parameters:
chart - The chart to update
dataType - The type of data (must be DATA_FILE_TEXT or DATA_FILE_XML for anything to happen).
data - the data object (can be a filename String, an InputStream, or a Reader)
dataViewIndex - The index of the ChartDataView object to update. If no ChartDataView exists for the provided index, this method will attempt to create a ChartDataView with that index and set the data on this new ChartDataView object. This may result in the chart throwing an IllegalArgumentException if the index is more than one higher than the current number of dataviews.
lp - a LoadProperties object. This object contains properties relating to file loading and XML parsing.
Throws:
IOException - If problems reading the data object

updateChart

protected static void updateChart(com.klg.jclass.chart.JCChart chart,
                                  String name,
                                  int type,
                                  Object inputSource,
                                  com.klg.jclass.util.io.LoadProperties loadProperties)
                           throws IOException,
                                  JCIOException,
                                  JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from an input source. This object must either be a String which points to a filename, an InputStream or a Reader. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - The chart instance to be updated (if null, nothing is done)
inputSource - The input source
name - the name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of input. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties. If not needed, it should be null.
Throws:
IOException - If problems reading from the input source
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromStream

public static com.klg.jclass.chart.JCChart makeChartFromStream(InputStream stream,
                                                               com.klg.jclass.util.io.LoadProperties loadProperties,
                                                               String name,
                                                               int type)
                                                        throws IOException,
                                                               JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from an input stream. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
stream - the input source
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the input stream
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromStream

public static com.klg.jclass.chart.JCChart makeChartFromStream(InputStream stream,
                                                               String name,
                                                               int type)
                                                        throws IOException,
                                                               JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from an input stream. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
stream - the input source
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the input stream
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromStream

public static void updateChartFromStream(com.klg.jclass.chart.JCChart chart,
                                         InputStream stream,
                                         com.klg.jclass.util.io.LoadProperties loadProperties,
                                         String name,
                                         int type)
                                  throws IOException,
                                         JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from an input stream. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
stream - the input source
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Throws:
IOException - If problems reading from the input stream
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromStream

public static void updateChartFromStream(com.klg.jclass.chart.JCChart chart,
                                         InputStream stream,
                                         String name,
                                         int type)
                                  throws IOException,
                                         JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from an input stream. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
stream - the input source
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
Throws:
IOException - If problems reading from the input stream
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromReader

public static com.klg.jclass.chart.JCChart makeChartFromReader(Reader reader,
                                                               com.klg.jclass.util.io.LoadProperties loadProperties,
                                                               String name,
                                                               int type)
                                                        throws IOException,
                                                               JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a reader. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form:

Parameters:
reader - The input source
name - the name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of input. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the reader
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromReader

public static com.klg.jclass.chart.JCChart makeChartFromReader(Reader reader,
                                                               String name,
                                                               int type)
                                                        throws IOException,
                                                               JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a reader. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form:

Parameters:
reader - The input source
name - the name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of input. Currently this is always JCChartFactory.HTML.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the reader
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromReader

public static void updateChartFromReader(com.klg.jclass.chart.JCChart chart,
                                         Reader reader,
                                         com.klg.jclass.util.io.LoadProperties loadProperties,
                                         String name,
                                         int type)
                                  throws IOException,
                                         JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a reader. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form:

Parameters:
chart - The chart instance to be updated (if null, nothing is done)
reader - The input source
name - the name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of input. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Throws:
IOException - If problems reading from the reader
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromReader

public static void updateChartFromReader(com.klg.jclass.chart.JCChart chart,
                                         Reader reader,
                                         String name,
                                         int type)
                                  throws IOException,
                                         JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a reader. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form :

Parameters:
chart - The chart instance to be updated (if null, nothing is done)
reader - The input source
name - the name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of input. Currently this is always JCChartFactory.HTML.
Throws:
IOException - If problems reading from the reader
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromFile

public static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName,
                                                             com.klg.jclass.util.io.LoadProperties loadProperties,
                                                             String name,
                                                             int type)
                                                      throws IOException,
                                                             JCIOException,
                                                             JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a file. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
fileName - the file name of the input source containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the file
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromFile

public static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName,
                                                             String name,
                                                             int type)
                                                      throws IOException,
                                                             JCIOException,
                                                             JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a file. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
fileName - the file name of the input source containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
Returns:
JCChart instance created from parameters
Throws:
IOException - If problems reading from the file
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromFile

public static void updateChartFromFile(com.klg.jclass.chart.JCChart chart,
                                       String fileName,
                                       com.klg.jclass.util.io.LoadProperties loadProperties,
                                       String name,
                                       int type)
                                throws IOException,
                                       JCIOException,
                                       JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a file. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
fileName - the file name of the input source containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Throws:
IOException - If problems reading from the file
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

updateChartFromFile

public static void updateChartFromFile(com.klg.jclass.chart.JCChart chart,
                                       String fileName,
                                       String name,
                                       int type)
                                throws IOException,
                                       JCIOException,
                                       JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a file. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
fileName - the file name of the input source containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - The type of file to save. Currently this is always JCChartFactory.HTML.
Throws:
IOException - If problems reading from the file
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCFileAccessor

makeChartFromFile

public static com.klg.jclass.chart.JCChart makeChartFromFile(String fileName,
                                                             String name)
Makes a JCChart instance by reading HTML-style chart parameters from a file. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
fileName - the name of the file containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
Returns:
JCChart instance created from parameters
See Also:
JCChart, JCFileAccessor

makeChartFromString

public static com.klg.jclass.chart.JCChart makeChartFromString(String params,
                                                               com.klg.jclass.util.io.LoadProperties loadProperties,
                                                               String name,
                                                               int type)
                                                        throws JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a String. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
params - a String containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - the format of text within the String (currently this is always JCChartFactory.HTML)
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Returns:
JCChart instance created from parameters
Throws:
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCStringAccessor

makeChartFromString

public static com.klg.jclass.chart.JCChart makeChartFromString(String params,
                                                               String name,
                                                               int type)
                                                        throws JCIOException,
                                                               JCParseException
Makes a JCChart instance by reading HTML-style chart parameters from a String. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
params - a String containing chart parameters
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - the format of text within the String (currently this is always JCChartFactory.HTML)
Returns:
JCChart instance created from parameters
Throws:
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCStringAccessor

updateChartFromString

public static void updateChartFromString(com.klg.jclass.chart.JCChart chart,
                                         String params,
                                         com.klg.jclass.util.io.LoadProperties loadProperties,
                                         String name,
                                         int type)
                                  throws JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a String. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
params - a String containing chart parameters.
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - the format of text within the String (currently this is always JCChartFactory.HTML)
loadProperties - instance of LoadProperties containing information that will be used during the load of chart properties.
Throws:
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCStringAccessor

updateChartFromString

public static void updateChartFromString(com.klg.jclass.chart.JCChart chart,
                                         String params,
                                         String name,
                                         int type)
                                  throws JCIOException,
                                         JCParseException
Updates a JCChart instance by reading HTML-style chart parameters from a String. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
chart - the chart instance to be updated (if null, nothing is done)
params - a String containing chart parameters.
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
type - the format of text within the String (currently this is always JCChartFactory.HTML)
Throws:
JCIOException - If an internal file referenced within the input source cannot be found. These can be ignored by setting the appropriate option.
JCParseException - If errors in parsing the input source
See Also:
JCChart, JCStringAccessor

makeChartFromString

public static com.klg.jclass.chart.JCChart makeChartFromString(String params,
                                                               String name)
Makes a JCChart instance by reading HTML-style chart parameters from a String. See the JClass Chart manual for more information on the available parameters. The parameters are expected to be of the form: <PARAM NAME=propertyName VALUE="value">

Parameters:
params - a String containing chart parameters.
name - The name of the chart being read from parameters. If non-null, only parameters of the form name.parameter are applied to this chart.
Returns:
JCChart instance created from parameters
See Also:
JCChart, JCStringAccessor

setOutputDataPropertiesOnChart

public static void setOutputDataPropertiesOnChart(com.klg.jclass.chart.JCChart chart,
                                                  int dataSaveType,
                                                  String outputDataFileName)
Set the dataSaveType and the outputDataFileName on all dataViews of the chart. The filename will be altered to be different for each dataView so that all dataViews don't write to the same file.

Parameters:
chart - The chart to be saved
dataSaveType - How to write out the data. This must be one of NO_DATA, EMBED_DATA, DATA_FILE_TEXT, or DATA_FILE_XML. Respectively, this means that either no data is saved, data is embeded in the HTML or XML file, data is saved as a separate text file, or data is saved as a separate XML file. Note that if a separate text or xml file is written out, the corresponding property in the chart output is set to point to the absolute file name set in the outputDataFileName.
outputDataFileName - the name of the data file if the data is being written to a separate file (a default name is used if NULL is passed in)

saveChartToStream

public static void saveChartToStream(com.klg.jclass.chart.JCChart chart,
                                     OutputStream stream,
                                     int type,
                                     int dataSaveType,
                                     String dataFileName)
                              throws IOException
Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToStream(chart, stream, type)

Saves JCChart to an output stream in HTML format.

Parameters:
chart - the chart to be saved
stream - the output stream
type - format type to save (currently this is always JCChartFactory.HTML)
dataSaveType - How to write out the data. This must be one of NO_DATA, EMBED_DATA, DATA_FILE_TEXT, or DATA_FILE_XML. Respectively this means that either no data is saved, data is embeded in the HTML or XML file, data is saved as a separate text file, or data is saved as a separate XML file.
dataFileName - the name of the data file if the data is being written to a separate file (a default name is used if NULL is passed in)
Throws:
IOException

saveChartToStream

public static void saveChartToStream(com.klg.jclass.chart.JCChart chart,
                                     OutputStream stream,
                                     int type)
                              throws IOException
Saves JCChart to an output stream in HTML format. Output of data and images is specified by setting properties on the object which holds the data/image. For data, create an OutputDataProperties object and set it on the corresponding ChartDataView. For images, create an OutputProperties object and set in on the JCFillStyle object (or other object which holds the image).

Parameters:
chart - the chart to be saved
stream - the output stream
type - format type to save (currently this is always JCChartFactory.HTML)
Throws:
IOException
See Also:
OutputProperties, OutputDataProperties, ChartDataView, JCFillStyle

saveChartToFile

public static void saveChartToFile(com.klg.jclass.chart.JCChart chart,
                                   String fileName,
                                   int type,
                                   int dataSaveType,
                                   String dataFileName)
                            throws IOException
Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToFile(chart, fileName, type)

Saves JCChart to a file in HTML format.

Parameters:
chart - the chart to be saved
fileName - the name of the file
type - format type to save (currently this is always JCChartFactory.HTML)
dataSaveType - How to write out the data. This must be one of NO_DATA, EMBED_DATA, DATA_FILE_TEXT, or DATA_FILE_XML. Respectively this means that either no data is saved, data is embeded in the HTML or XML file, data is saved as a separate text file, or data is saved as a separate XML file.
dataFileName - the name of the data file if the data is being written to a separate file (a default name is used if NULL is passed in)
Throws:
IOException

saveChartToFile

public static void saveChartToFile(com.klg.jclass.chart.JCChart chart,
                                   String fileName,
                                   int type)
                            throws IOException
Saves JCChart to a file in HTML format. Output of data and images is specified by setting properties on the object which holds the data/image. For data, create an OutputDataProperties object and set it on the corresponding ChartDataView. For images, create an OutputProperties object and set in on the JCFillStyle object (or other object which holds the image).

Parameters:
chart - the chart to be saved
fileName - the name of the file
type - format type to save (currently this is always JCChartFactory.HTML)
Throws:
IOException
See Also:
OutputProperties, OutputDataProperties, ChartDataView, JCFillStyle

saveChartToString

public static String saveChartToString(com.klg.jclass.chart.JCChart chart,
                                       int type,
                                       int dataSaveType,
                                       String dataFileName)
Deprecated. As of DesktopViews 6.2. Set data output properties on each ChartDataView separately and use saveChartToString(chart, type)

Saves JCChart to a String in HTML format.

Parameters:
chart - the chart to be saved
type - format type to save (currently this is always JCChartFactory.HTML)
dataSaveType - How to write out the data. This must be one of NO_DATA, EMBED_DATA, DATA_FILE_TEXT, or DATA_FILE_XML. Respectively this means that either no data is saved, data is embeded in the HTML or XML file, data is saved as a separate text file, or data is saved as a separate XML file.
dataFileName - the name of the data file if the data is being written to a separate file (a default name is used if NULL is passed in)
Returns:
the String which contains the chart information in either HTML or XML format

saveChartToString

public static String saveChartToString(com.klg.jclass.chart.JCChart chart,
                                       int type)
                                throws JCIOException
Saves JCChart to a String in HTML format. Output of data and images is specified by setting properties on the object which holds the data/image. For data, create an OutputDataProperties object and set it on the corresponding ChartDataView. For images, create an OutputProperties object and set in on the JCFillStyle object (or other object which holds the image).

Parameters:
chart - the chart to be saved
type - format type to save (currently this is always JCChartFactory.HTML)
Returns:
the String which contains the chart information in either HTML or XML format
Throws:
JCIOException
See Also:
OutputProperties, OutputDataProperties, ChartDataView, JCFillStyle

Copyright © 2004 Quest Software Inc..
All rights reserved.