Package quadbase.ChartAPI.swing
Class DataSheet
java.lang.Object
quadbase.ChartAPI.swing.DataSheet
This class provides a functionality to merge multiple data sources together. Users can create a
DataSheet class from different data sources, such as data file, database, spreadSheetModel, and
IResultSet. Users may use a QbChart constructor for DataSheet array to create a chart object.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dataSheet from a data fileCreates a new dataSheet from a data fileDataSheet(Applet applet, String dataFile, boolean doTranspose, int[] transposeColIdx, int dataFileType) Creates a new dataSheet from a data fileCreates a new dataSheet from EJBInfoCreates a new dataSheet from EJBInfoCreates a new dataSheet from EJBInfoDataSheet(Applet applet, XMLFileQueryInfo xmlFileQueryInfo, boolean doTranspose, int[] transposeColIdx) Creates a new dataSheet from XML FileDataSheet(Applet applet, IDatabaseInfo dbInfo, boolean doTranspose) Creates a new dataSheet from a databaseDataSheet(Applet applet, IDatabaseInfo dbInfo, boolean doTranspose, int[] transposeColIdx) Creates a new dataSheet from a databaseDataSheet(Applet applet, IResultSet data, boolean doTranspose) Creates a new dataSheet from IResultsetDataSheet(Applet applet, IResultSet data, boolean doTranspose, int[] transposeColIdx) Creates a new dataSheet from IResultsetDataSheet(Applet applet, ISpreadSheetModel spreadSheet) Creates a new dataSheet from spread sheet -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new row data objectvoiddeleteRow(int no) Deletes a specified rowintReturns number of columnsObject[]getRow(int no) Returns specified row dataintReturns number of rowsvoidprint(PrintStream out, int separator, int format) Print Data FilevoidSets data transpose
limitation: all data columns (except the first column) must have same data typevoidtranspose(int[] transposeCol) Sets data transposevoidUpdates the specified row
-
Constructor Details
-
DataSheet
Creates a new dataSheet from a database- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdbInfo- database information, see interface IDatabaseInfodoTranspose- a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value
-
DataSheet
Creates a new dataSheet from a database- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdbInfo- database information, see interface IDatabaseInfodoTranspose- a flag denoting whether the input data has to be transposed into a resulttransposeColIdx- transpose selected column index
-
DataSheet
Creates a new dataSheet from a data file- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdataFile- source data file, see database file format for detailsdoTranspose- a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value
-
DataSheet
Creates a new dataSheet from a data file- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdataFile- source data file, see database file format for detailsdoTranspose- a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and ValuetransposeColIdx- transposing selected column index
-
DataSheet
public DataSheet(Applet applet, String dataFile, boolean doTranspose, int[] transposeColIdx, int dataFileType) Creates a new dataSheet from a data file- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdataFile- source data file, see database file format for detailsdoTranspose- a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and ValuetransposeColIdx- transposing selected column indexdataFileType- Type of data file (QbChart.DATAFILE, QbChart.CLASSFILE or QbChart.XMLFILE)
-
DataSheet
Creates a new dataSheet from IResultset- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdata- source data to plot chart, see IResultSet for detailsdoTranspose- a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value
-
DataSheet
Creates a new dataSheet from IResultset- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdata- source data to plot chart, see IResultSet for detailsdoTranspose- a flag denoting whether the input data has to be transposed into a resulttransposeColIdx- transposing selected column index
-
DataSheet
Creates a new dataSheet from EJBInfo- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationejbInfo- ejb info to plot chart.
-
DataSheet
Creates a new dataSheet from EJBInfo- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationejbInfo- ejb info to plot chart.doTranspose- a flag denoting whether the input data has to be transposed into a result
-
DataSheet
Creates a new dataSheet from EJBInfo- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationejbInfo- ejb info to plot chart.doTranspose- a flag denoting whether the input data has to be transposed into a resulttransposeColIdx- transposing selected column index
-
DataSheet
public DataSheet(Applet applet, XMLFileQueryInfo xmlFileQueryInfo, boolean doTranspose, int[] transposeColIdx) Creates a new dataSheet from XML File- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationdoTranspose- a flag denoting whether the input data has to be transposed into a resulttransposeColIdx- transposing selected column indexxmlFiledQueryInfo- xml info to plot chart.
-
DataSheet
Creates a new dataSheet from spread sheet- Parameters:
applet- the applet containing the chart. Use "(Applet)null" if used within an applicationspreadSheet- source data model for chart, see ISpreadSheetModel for details
-
-
Method Details
-
transpose
Sets data transpose
limitation: all data columns (except the first column) must have same data type- Throws:
Exception
-
transpose
Sets data transpose- Parameters:
transposeCol- transposing selected column index- Throws:
Exception
-
getRowCount
public int getRowCount()Returns number of rows- Returns:
- row count
-
getColumnCount
public int getColumnCount()Returns number of columns- Returns:
- column count
-
getRow
Returns specified row data- Parameters:
no- row number- Returns:
- object array which containing row data
-
addRow
Adds a new row data object- Parameters:
record- new row data object
-
deleteRow
public void deleteRow(int no) Deletes a specified row- Parameters:
no- row number of deleted row
-
updateRow
Updates the specified row- Parameters:
record- the new row datano- the row number to update
-
print
Print Data File- Parameters:
out- The outputStream. The caller is responsible for closing it.separator- Available separators are :
QbChart.COMMA
QbChart.SEMICOLON
QbChart.SPACEformat- Available format are :
QbChart.TXTFORMAT
QbChart.XMLFORMAT
-