|
Chart FX for Java 6.5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SoftwareFX.ChartFX.TextProvider
public final class TextProvider
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 |
---|
public TextProvider()
public TextProvider(java.lang.String fileName)
public TextProvider(java.io.InputStream stream)
Method Detail |
---|
public void close()
Used to close the connection to a text datasource for the ChartFX TextProvider object.
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.
DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
open(java.lang.String)
,
DataSourceSettings
,
Chart
public java.lang.String getCulture()
Gets the Culture. For more detail see setCulture(java.lang.String)
.
public java.lang.String getDateFormat()
Gets the DateFormat. For more detail see setDateFormat(java.lang.String)
.
public java.lang.String getSeparators()
Gets the Separators. For more detail see setSeparators(java.lang.String)
.
public void open(java.lang.String fileName)
Used to open the connection to a text datasource for the ChartFX TextProvider object.
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.
fileName
- A string specifying the path and or filename of a text file used as a datasource.DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
close()
,
DataSourceSettings
,
Chart
public void open(java.io.InputStream stream)
Used to open the connection to a text datasource for the ChartFX TextProvider object.
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.
stream
- DataSourceSettings.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
ChartCore.setDataSource(SoftwareFX.ChartFX.IDataProvider)
,
close()
,
DataSourceSettings
,
Chart
public void setCulture(java.lang.String value)
Allows you to localize the text provider for language and region specific data.
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");
ChartCore.setCulture(java.lang.String)
,
ChartCore.setMessageText(java.lang.String, java.lang.String)
,
Chart
public void setDateFormat(java.lang.String value)
Allows you to customize the default date format for the Chart FX TextProvider.
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");
setCulture(java.lang.String)
,
setSeparators(java.lang.String)
,
Chart
public void setSeparators(java.lang.String value)
Allows you to change the delimiter character for the TextProvider.
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("_");
Axis.getDataFormat()
,
setCulture(java.lang.String)
,
Chart
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |