Chart FX 7 for Java Server

com.softwarefx.chartfx.server.dataproviders
Class TextProvider

java.lang.Object
  extended by com.softwarefx.chartfx.server.dataproviders.TextProvider
All Implemented Interfaces:
IDataSource

public class TextProvider
extends Object
implements IDataSource

Provides access to the TextProvider object and allows the user to databind a text file to the Chart.

Chart FX can also read information stored in text files or text streams. Both Tab Separated Values (TSV) and Comma Separated Values (CSV) are valid and can be accessed by Chart FX by default, but other formats can also be used.

It is used through the DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource)property of the DataSourceSettings Class as follows:

TextProvider txtProvider = new TextProvider("c:\\TextFile.txt");
chart1.getDataSourceSettings().setDataSource(txtProvider);


Constructor Summary
TextProvider()
           
TextProvider(Reader reader)
           
TextProvider(String fileName)
           
 
Method Summary
 void close()
          Used to close the connection to the text datasource linked to the TextProvider object.
 Locale getCulture()
          Gets the Culture.
 String getDateFormat()
          Gets the DateFormat.
 String getSeparators()
          Gets the Separators.
 void open(Reader reader)
          Used to open the connection to a text datasource linked to the TextProvider object.
 void open(String fileName)
          Used to open the connection to a text datasource linked to the TextProvider object.
 void setCulture(Locale value)
          Sets a value allowing you to localize the text provider for language and region specific data.
 void setDateFormat(String value)
          Sets a value allowing you to customize the default date format of the TextProvider.
 void setSeparators(String value)
          Sets a value specifying the delimiter character for the TextProvider.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextProvider

public TextProvider()

TextProvider

public TextProvider(Reader reader)

TextProvider

public TextProvider(String fileName)
Method Detail

close

public void close()

Used to close the connection to the text datasource linked to the TextProvider object.

Remarks:
  • The DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource) property should be called before the connection to the text datasource is closed.

  • See Also:
    DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource), open(java.io.Reader), DataSourceSettings, Chart

    getCulture

    public Locale getCulture()

    Gets the Culture. For more detail see setCulture(java.util.Locale).


    getDateFormat

    public String getDateFormat()

    Gets the DateFormat. For more detail see setDateFormat(java.lang.String).


    getSeparators

    public String getSeparators()

    Gets the Separators. For more detail see setSeparators(java.lang.String).


    open

    public void open(Reader reader)

    Used to open the connection to a text datasource linked to the TextProvider object.

    Remarks:
  • The DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource) property should be called before the connection to the text datasource is closed.

  • Parameters:
    reader - A TextReader object to be used as a datasource.
    See Also:
    DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource), close(), DataSourceSettings, Chart

    open

    public void open(String fileName)

    Used to open the connection to a text datasource linked to the TextProvider object.

    Remarks:
  • The DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource) property should be called before the connection to the text datasource is closed.

  • Parameters:
    fileName - A string specifying the path and/or filename of a text file used as a datasource.
    See Also:
    DataSourceSettings.setDataSource(com.softwarefx.chartfx.server.dataproviders.IDataSource), close(), DataSourceSettings, Chart

    setCulture

    public void setCulture(Locale value)

    Sets a value allowing you to localize the text provider for language and region specific data.

    Remarks:
  • If your text data is from a specific country that uses formatting that differs from "us-en", you need to set this property so ChartFX can understand the formatting of the text data.

  • When setting this property, you may need the Culture Name or Culture Identifier constants for the desired culture. These values as well as the CultureInfo type are documented in the Java API .

  • See Also:
    Chart.setCulture(java.util.Locale), Chart

    setDateFormat

    public void setDateFormat(String value)

    Sets a value allowing you to customize the default date format of the TextProvider.

    Remarks:
  • When dates are included in the text file in a format other than "mm/dd/yyyy" (which is the default format for Chart FX TextProvider), the DateFormat property must be used to create a mask that will instruct Chart FX how to understand the values.

  • See Also:
    setCulture(java.util.Locale), setSeparators(java.lang.String), Chart

    setSeparators

    public void setSeparators(String value)

    Sets a value specifying the delimiter character for the TextProvider.

    Remarks:
  • By default, Chart FX for Java 's TextProvider understands commas and tabs as separators. However, columns within the text file can be separated with many other characters, as long as they are always the same.

  • See Also:
    Axis.getDataFormat(), setCulture(java.util.Locale), Chart

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.