Chart FX for Java 6.5

SoftwareFX.ChartFX
Class TextProvider

java.lang.Object
  extended by SoftwareFX.ChartFX.TextProvider
All Implemented Interfaces:
IDataProvider

public final class TextProvider
extends java.lang.Object
implements IDataProvider

Provides access to the TextProvider object.

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.

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


Constructor Summary
TextProvider()
           
TextProvider(java.io.InputStream stream)
           
TextProvider(java.lang.String fileName)
           
 
Method Summary
 void close()
          Used to close the connection to a text datasource for the ChartFX TextProvider object.
 java.lang.String getCulture()
          Gets the Culture.
 java.lang.String getDateFormat()
          Gets the DateFormat.
 java.lang.String getSeparators()
          Gets the Separators.
 void open(java.io.InputStream stream)
          Used to open the connection to a text datasource for the ChartFX TextProvider object.
 void open(java.lang.String fileName)
          Used to open the connection to a text datasource for the ChartFX TextProvider object.
 void setCulture(java.lang.String value)
          Allows you to localize the text provider for language and region specific data.
 void setDateFormat(java.lang.String value)
          Allows you to customize the default date format for the Chart FX TextProvider.
 void setSeparators(java.lang.String value)
          Allows you to change 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(java.lang.String fileName)

TextProvider

public TextProvider(java.io.InputStream stream)
Method Detail

close

public void close()

Used to close the connection to a text datasource for the ChartFX TextProvider object.

Remarks:
  • The open(java.lang.String) method is used to open the connection to a text datasource for the ChartFX TextProvider Object.

  • The DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider) property should be called before the connection to the text datasource is closed.

  • A text file must be passed to a ChartFX TextProvider object.

  • See Also:
    DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider), ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider), open(java.lang.String), DataSourceSettings, Chart

    getCulture

    public java.lang.String getCulture()

    Gets the Culture. For more detail see setCulture(java.lang.String).


    getDateFormat

    public java.lang.String getDateFormat()

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


    getSeparators

    public java.lang.String getSeparators()

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


    open

    public void open(java.lang.String fileName)

    Used to open the connection to a text datasource for the ChartFX TextProvider object.

    Remarks:
  • The close() method is used to close the connection to a text datasource for the ChartFX TextProvider Object.

  • The DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider) property should be called before the connection to the text datasource is closed.

  • A text file must be passed to a ChartFX TextProvider object.

  • Parameters:
    fileName - A string specifying the path and or filename of a text file used as a datasource.
    See Also:
    DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider), ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider), close(), DataSourceSettings, Chart

    open

    public void open(java.io.InputStream stream)

    Used to open the connection to a text datasource for the ChartFX TextProvider object.

    Remarks:
  • The close() method is used to close the connection to a text datasource for the ChartFX TextProvider Object.

  • The DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider) property should be called before the connection to the text datasource is closed.

  • A text file must be passed to a ChartFX TextProvider object.

  • Parameters:
    stream -
    See Also:
    DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider), ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider), close(), DataSourceSettings, Chart

    setCulture

    public void setCulture(java.lang.String value)

    Allows 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 Chart FX 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 are documented in the Java API Documentation.

  • When setting this property, you may need the Languaje Code and/or Country Code constants for the desired culture. For more information, please refer to the java.util.Locale documentation.

    Example:

    TextProvider txtProvider = new TextProvider("TextFile.txt");
    txtProvider.setCulture("es-ES");

  • See Also:
    ChartCore.setCulture(java.lang.String), ChartCore.setMessageText(java.lang.String, java.lang.String), Chart

    setDateFormat

    public void setDateFormat(java.lang.String value)

    Allows you to customize the default date format for the Chart FX 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. To format the data like 01-Jan-2002:

    TextProvider txtProvider = new TextProvider("TextFile.txt");
    txtProvider.setDateFormat("dd-MMM-yyyy");

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

    setSeparators

    public void setSeparators(java.lang.String value)

    Allows you to change 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, configuring the Text Provider is done as follows:

    TextProvider txtProvider = new TextProvider("TextFile.txt");
    txtProvider.setSeparators("_");

  • See Also:
    Axis.getDataFormat(), setCulture(java.lang.String), Chart

    http://www.softwarefx.com

    2007 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.