JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart.data
Class JCDefaultDataSource

java.lang.Object
  |
  +--com.klg.jclass.chart.ChartDataSupport
        |
        +--com.klg.jclass.chart.data.BaseDataSource
              |
              +--com.klg.jclass.chart.data.JCDefaultDataSource
All Implemented Interfaces:
ChartDataManageable, ChartDataManager, ChartDataModel, HoleValueChartDataModel, com.klg.jclass.chart.ImageMapChartDataModel, LabelledChartDataModel, Serializable
Direct Known Subclasses:
JCEditableDataSource, JDBCDataSource

public class JCDefaultDataSource
extends BaseDataSource

JCDefaultDataSource extends BaseDataSource to create a more useful default container for JClass Chart data.

(Formerly VectorDataSource).

See Also:
Serialized Form

Field Summary
protected static double[][] defaultY
          Default data used in Beans.
protected  boolean suppressMultipleGeneration
          Used to suppress generation of x series data in all cases.
 
Fields inherited from class com.klg.jclass.chart.data.BaseDataSource
cloneArrays, clusterImageMapInfo, holeValue, legendImageMapInfo, name, pointImageMapInfo, pointLabels, seriesImageMapInfo, seriesLabels, xvalues, yvalues
 
Fields inherited from class com.klg.jclass.chart.ChartDataSupport
source
 
Fields inherited from interface com.klg.jclass.chart.ChartDataModel
ALL
 
Constructor Summary
JCDefaultDataSource()
          The default constructor.
JCDefaultDataSource(com.klg.jclass.chart.data.BaseDataSource baseDataSource)
          Creates a JCDefaultDataSource from a BaseDataSource.
JCDefaultDataSource(double[][] xvalues, double[][] yvalues, String[] pointLabels, String[] seriesLabels, String dataSourceName)
          Creates a data source using the provided data.
JCDefaultDataSource(double[][] xvalues, double[][] yvalues, String[] pointLabels, String[] seriesLabels, String dataSourceName, com.klg.jclass.util.ImageMapInfo[][] pointImageMapInfo, com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo, com.klg.jclass.util.ImageMapInfo[] seriesImageMapInfo, com.klg.jclass.util.ImageMapInfo[] legendImageMapInfo)
          Creates a data source using the provided data.
JCDefaultDataSource(double[][] xvalues, double[][] yvalues, String[] pointLabels, String[] seriesLabels, String dataSourceName, String[][] pointURLs, String[][] pointExtras, String[] clusterURLs, String[] clusterExtras, String[] seriesURLs, String[] seriesExtras, String[] legendURLs, String[] legendExtras)
          Creates a data source using the provided data and image map information.
JCDefaultDataSource(Locale locale)
          The default constructor with specified locale.
 
Method Summary
 String buildDataSourceString()
          Converts the current data source into a String form.
protected  void check()
          Checks the supplied data to see if x data has been provided.
protected  void generateLabels()
          Generates and sets the data source name, series labels, and point labels from the existing y values.
protected  void generateLabels(Locale locale)
          Generates and sets the data source name, series labels, and point labels from the existing y values for the specified locale.
 void setClusterImageMapInfo(com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo)
          Sets an array of image map information, one for each point cluster.
 void setClusterImageMapInfo(String[] URLs, String[] extras)
          Sets an array of image map information, one for each point cluster.
 void setData(double[][] xvalues, double[][] yvalues)
          Sets the x and y data contained by this data source.
 void setLegendImageMapInfo(com.klg.jclass.util.ImageMapInfo[] legendImageMapInfo)
          Sets an array of legend image map information, one for each series.
 void setLegendImageMapInfo(String[] URLs, String[] extras)
          Sets an array of legend image map information, one for each series.
 void setName(String s)
          Sets the value of the Name property.
 void setPointImageMapInfo(com.klg.jclass.util.ImageMapInfo[][] pointImageMapInfo)
          Sets an array of image map information indexed by series and point.
 void setPointImageMapInfo(int seriesIndex, com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo)
          Sets an array of image map information for a given series.
 void setPointImageMapInfo(int seriesIndex, String[] URLs, String[] extras)
          Sets an array of image map information for a given series.
 void setPointImageMapInfo(String[][] URLs, String[][] extras)
          Sets an array of image map information indexed by series and point.
 void setPointLabels(String[] ps)
          Sets the value of the pointLabels property.
 void setSeriesImageMapInfo(com.klg.jclass.util.ImageMapInfo[] seriesImageMapInfo)
          Sets an array of image map information, one for each series.
 void setSeriesImageMapInfo(String[] URLs, String[] extras)
          Sets an array of image map information, one for each series.
 void setSeriesLabels(String[] ss)
          Sets the seriesLabel properties.
 void setXSeries(int index, double[] xvalues)
          Sets the specified x-value series.
 void setYSeries(int index, double[] yvalues)
          Sets the specified y-value series.
protected  void updateChart(int type, int seriesIndex, int pointIndex)
          Internal method to inform the listeners when the chart data has changed.
 
Methods inherited from class com.klg.jclass.chart.data.BaseDataSource
cloneCheck, cloneCheck, cloneCheck, getChartDataManager, getCloneArrays, getClusterImageMapInfo, getDataSourceName, getHoleValue, getLegendImageMapInfo, getNumSeries, getPointImageMapInfo, getPointLabels, getSeriesImageMapInfo, getSeriesLabels, getXSeries, getYSeries, setCloneArrays
 
Methods inherited from class com.klg.jclass.chart.ChartDataSupport
addChartDataListener, fireChartDataEvent, fireChartDataEvent, removeChartDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

suppressMultipleGeneration

protected boolean suppressMultipleGeneration
Used to suppress generation of x series data in all cases.


defaultY

protected static double[][] defaultY
Default data used in Beans.

Constructor Detail

JCDefaultDataSource

public JCDefaultDataSource()
The default constructor. Used mostly for the DataSourceEditor.


JCDefaultDataSource

public JCDefaultDataSource(Locale locale)
The default constructor with specified locale. Locale is used to generate default labels.


JCDefaultDataSource

public JCDefaultDataSource(double[][] xvalues,
                           double[][] yvalues,
                           String[] pointLabels,
                           String[] seriesLabels,
                           String dataSourceName)
Creates a data source using the provided data.

Parameters:
xvalues - X series arrays; can be null
yvalues - Y series arrays; can be null
pointLabels - array of point labels; can be null
seriesLabels - array of series labels; can be null
dataSourceName - name to be applied to this data source

JCDefaultDataSource

public JCDefaultDataSource(double[][] xvalues,
                           double[][] yvalues,
                           String[] pointLabels,
                           String[] seriesLabels,
                           String dataSourceName,
                           String[][] pointURLs,
                           String[][] pointExtras,
                           String[] clusterURLs,
                           String[] clusterExtras,
                           String[] seriesURLs,
                           String[] seriesExtras,
                           String[] legendURLs,
                           String[] legendExtras)
Creates a data source using the provided data and image map information. Note that the image map information will only be used for JCServerChart (i.e. it will be ignored for JCChart).

Parameters:
xvalues - X series arrays; can be null.
yvalues - Y series arrays; can be null.
pointLabels - array of point labels; can be null.
seriesLabels - array of series labels; can be null.
dataSourceName - name to be applied to this data source.
pointURLs - An array of URLs, indexed by series and point.
pointExtras - An array of extra URL information, indexed by series and point.
clusterURLs - An array of URLs, one for each point cluster.
clusterExtras - An array of extra URL information, one for each point cluster.
seriesURLs - An array of URLs, one for each series.
seriesExtras - An array of extra URL information, one for each series.
legendURLs - An array of legend URLs, one for each series.
legendExtras - An array of extra legend URL information, one for each series.

JCDefaultDataSource

public JCDefaultDataSource(double[][] xvalues,
                           double[][] yvalues,
                           String[] pointLabels,
                           String[] seriesLabels,
                           String dataSourceName,
                           com.klg.jclass.util.ImageMapInfo[][] pointImageMapInfo,
                           com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo,
                           com.klg.jclass.util.ImageMapInfo[] seriesImageMapInfo,
                           com.klg.jclass.util.ImageMapInfo[] legendImageMapInfo)
Creates a data source using the provided data.

Parameters:
xvalues - X series arrays; can be null
yvalues - Y series arrays; can be null
pointLabels - array of point labels; can be null
seriesLabels - array of series labels; can be null
dataSourceName - name to be applied to this data source
pointImageMapInfo - An array of image map information, indexed by series and point.
clusterImageMapInfo - An array of image map information, one for each point cluster.
seriesImageMapInfo - An array of image map information, one for each series.
legendImageMapInfo - An array of legend image map information, one for each series.

JCDefaultDataSource

public JCDefaultDataSource(com.klg.jclass.chart.data.BaseDataSource baseDataSource)
Creates a JCDefaultDataSource from a BaseDataSource.

Parameters:
baseDataSource - The BaseDataSource from which this object is derived.
Method Detail

check

protected void check()
Checks the supplied data to see if x data has been provided. If it hasn't, it is generated.


generateLabels

protected void generateLabels()
Generates and sets the data source name, series labels, and point labels from the existing y values.


generateLabels

protected void generateLabels(Locale locale)
Generates and sets the data source name, series labels, and point labels from the existing y values for the specified locale.


updateChart

protected void updateChart(int type,
                           int seriesIndex,
                           int pointIndex)
Internal method to inform the listeners when the chart data has changed.

Parameters:
type - data change type to pass to the views
seriesIndex - index of series affected by the change
pointIndex - index of point affected by the change

setData

public void setData(double[][] xvalues,
                    double[][] yvalues)
Sets the x and y data contained by this data source.

Parameters:
xvalues - X series arrays; can be null
yvalues - Y series arrays; can be null

setXSeries

public void setXSeries(int index,
                       double[] xvalues)
Sets the specified x-value series. If the current array of x series data is not large enough to accommodate the index, it will automatically be expanded, with missing data series values set to null. Note: NumSeries will not be adjusted automatically.

Parameters:
index - data series index
xvalues - array of x values

setYSeries

public void setYSeries(int index,
                       double[] yvalues)
Sets the specified y-value series. If the current array of y series data is not large enough to accommodate the index, it will automatically be expanded, with missing data series values set to null.
Note: NumSeries will not be adjusted automatically.

Parameters:
index - data series index
yvalues - array of y values

setPointLabels

public void setPointLabels(String[] ps)
Sets the value of the pointLabels property. The pointLabels property is an indexed property that contains a list of point labels provided by the data source.

Parameters:
ps - the array of point label Strings

setSeriesLabels

public void setSeriesLabels(String[] ss)
Sets the seriesLabel properties. The seriesLabel property defines the label that is associated with a data series.

Parameters:
ss - the array of series label Strings

setName

public void setName(String s)
Sets the value of the Name property. The Name property defines the name of the data object.

Parameters:
s - the name String

setPointImageMapInfo

public void setPointImageMapInfo(com.klg.jclass.util.ImageMapInfo[][] pointImageMapInfo)
Sets an array of image map information indexed by series and point.

Parameters:
pointImageMapInfo - The new point image map information array.

setPointImageMapInfo

public void setPointImageMapInfo(String[][] URLs,
                                 String[][] extras)
Sets an array of image map information indexed by series and point. The arrays get combined into an array of ImageMapInfo objects.

Parameters:
URLs - An array of URLs, indexed by series and point.
extras - An array of extra URL information, indexed by series and point.

setPointImageMapInfo

public void setPointImageMapInfo(int seriesIndex,
                                 com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo)
Sets an array of image map information for a given series.

Parameters:
seriesIndex - The index of the series.
pointImageMapInfo - The new point image map information array.

setPointImageMapInfo

public void setPointImageMapInfo(int seriesIndex,
                                 String[] URLs,
                                 String[] extras)
Sets an array of image map information for a given series.

Parameters:
seriesIndex - The index of the series.
URLs - An array of URLs.
extras - An array of extra URL information.

setClusterImageMapInfo

public void setClusterImageMapInfo(com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo)
Sets an array of image map information, one for each point cluster.

Parameters:
clusterImageMapInfo - The new cluster image map information array.

setClusterImageMapInfo

public void setClusterImageMapInfo(String[] URLs,
                                   String[] extras)
Sets an array of image map information, one for each point cluster. The arrays get combined into an array of ImageMapInfo objects.

Parameters:
URLs - An array of URLs, one for each point cluster.
extras - An array of extra URL information, one for each point cluster.

setSeriesImageMapInfo

public void setSeriesImageMapInfo(com.klg.jclass.util.ImageMapInfo[] seriesImageMapInfo)
Sets an array of image map information, one for each series.

Parameters:
seriesImageMapInfo - The new series image map information array.

setSeriesImageMapInfo

public void setSeriesImageMapInfo(String[] URLs,
                                  String[] extras)
Sets an array of image map information, one for each series. The arrays get combined into an array of ImageMapInfo objects.

Parameters:
URLs - An array of URLs, one for each series.
extras - An array of extra URL information, one for each series.

setLegendImageMapInfo

public void setLegendImageMapInfo(com.klg.jclass.util.ImageMapInfo[] legendImageMapInfo)
Sets an array of legend image map information, one for each series.

Parameters:
legendImageMapInfo - The new legend image map information array.

setLegendImageMapInfo

public void setLegendImageMapInfo(String[] URLs,
                                  String[] extras)
Sets an array of legend image map information, one for each series. The arrays get combined into an array of ImageMapInfo objects.

Parameters:
URLs - An array of URLs, one for each series.
extras - An array of extra URL information, one for each series.

buildDataSourceString

public String buildDataSourceString()
Converts the current data source into a String form.

Returns:
See Also:
ChartDataSourceUtil

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