Class JFreeChartAsciiReader

java.lang.Object
net.simplace.core.io.AbstractDataReader
net.simplace.core.io.AbstractAsciiReader
net.simplace.ui.jfreechart.JFreeChartAsciiReader

public class JFreeChartAsciiReader extends net.simplace.core.io.AbstractAsciiReader
Reads an ASCII file (see AbstractAsciiReader) into a JFreeChart dataset. The head column gives the row keys, every other column a series (or category).
  • Field Summary

    Fields inherited from class net.simplace.core.io.AbstractAsciiReader

    iDefaultDateFormat, iSeperator, iSourceFile, iTabLen

    Fields inherited from class net.simplace.core.io.AbstractDataReader

    iColumnsData, iConfigData, iObservable
  • Constructor Summary

    Constructors
    Constructor
    Description
    JFreeChartAsciiReader(File aSourceFile, org.jdom2.Element aConfigData, String aTabLen, String aSeperator, String aDefaultDateFormat, net.simplace.core.FWObservable aPObservable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    processLineOfFile(String aOrientation, String aLine, int aRowIdx)
    Adds the values of a line to a category dataset: row key is the value of the head column (default Row + index), column key the column name; with orientation horizontal the columns are the series, with vertical the rows.
    org.jfree.data.category.CategoryDataset
     
    org.jfree.data.general.PieDataset<String>
    Reads the file into a pie dataset.
    org.jfree.data.xy.TableXYDataset
    Reads the file into an XY dataset.

    Methods inherited from class net.simplace.core.io.AbstractAsciiReader

    getStringParameter, getTitle, initColumnHeads, initTitle, readData, setTitle

    Methods inherited from class net.simplace.core.io.AbstractDataReader

    getIntegerValue

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JFreeChartAsciiReader

      public JFreeChartAsciiReader(File aSourceFile, org.jdom2.Element aConfigData, String aTabLen, String aSeperator, String aDefaultDateFormat, net.simplace.core.FWObservable aPObservable)
      Parameters:
      aSourceFile - the ASCII file
      aConfigData - the column definitions
      aTabLen - tab length (for fixed-width files)
      aSeperator - column separator
      aDefaultDateFormat - default date format
      aPObservable - provides the parameters
  • Method Details

    • readCategoryDatasetFromAsciiFile

      public org.jfree.data.category.CategoryDataset readCategoryDatasetFromAsciiFile() throws Exception
      Returns:
      a category dataset with the values of the file
      Throws:
      Exception - if the file cannot be read or a value is not numeric
    • readXYDatasetFromAsciiFile

      public org.jfree.data.xy.TableXYDataset readXYDatasetFromAsciiFile() throws Exception
      Reads the file into an XY dataset.

      Not implemented: the dataset stays empty and a warning is logged.

      Returns:
      an empty XY dataset
      Throws:
      Exception - if the file cannot be read
    • readPieDatasetFromAsciiFile

      public org.jfree.data.general.PieDataset<String> readPieDatasetFromAsciiFile() throws Exception
      Reads the file into a pie dataset.

      Not implemented: the dataset stays empty and a warning is logged.

      Returns:
      an empty pie dataset
      Throws:
      Exception - if the file cannot be read
    • processLineOfFile

      protected void processLineOfFile(String aOrientation, String aLine, int aRowIdx) throws Exception
      Adds the values of a line to a category dataset: row key is the value of the head column (default Row + index), column key the column name; with orientation horizontal the columns are the series, with vertical the rows.
      Specified by:
      processLineOfFile in class net.simplace.core.io.AbstractAsciiReader
      Parameters:
      aOrientation - horizontal or vertical, other values add nothing
      aLine - the line
      aRowIdx - index of the line
      Throws:
      Exception - if a value is not numeric