Java Doc for ScatterPlot.java in  » Science » jcm1-source » edu » hws » jcm » draw » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » jcm1 source » edu.hws.jcm.draw 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.hws.jcm.draw.Drawable
      edu.hws.jcm.draw.ScatterPlot

ScatterPlot
public class ScatterPlot extends Drawable implements Computable(Code)
A ScatterPlot graphs data taken from a DataTableInput. The data in the form of a small plus sign at each (x,y) in the data. The x and y values can be taken directly from two specified columns in the table. They can also be computed by expressions that can use column names from the table as well as the special variable rowNumber. For example, if column names are X and Y, then it could plot sqrt(X) versus rowNumber*(X+Y).

Optionally, a ScatterPlot will also draw a regression line for the data. Certain statistical values about the data points are available as Value objects by calling the getValueObject() method.



Field Summary
final public static  intINTERCEPTSLOPEDATACTMISSINGCTSTANDARDERRORCORRELATION
     A constant that can be used in the getValueObject() method to indicate which statistic the object should represent.

Constructor Summary
public  ScatterPlot()
     Default constructor.
public  ScatterPlot(DataTableInput table)
     Create a scatter plot to plot data from the specified table.
public  ScatterPlot(DataTableInput table, int column1, int column2)
     Create a scatter plot to plot data from two specified columns in a table.
public  ScatterPlot(DataTableInput table, Expression exp1, Expression exp2)
     Create scatter plot to plot specified expressions using data from a table.

Method Summary
public  voidcompute()
     Recompute the data for the scatter plot.
public  voiddraw(Graphics g, boolean coordsChanged)
     Draw the data points and regression line.
public  booleangetAutoChangeLimits()
     The return value indicates whether the limits on the CoordinateRect are automatically adjusted when the data is recomputed.
public  ColorgetDataColor()
     Get the color that is used to draw the points in the data.
public  ColorgetLineColor()
     Get the color that is used to draw the regression line.
public  booleangetMissingValueIsError()
     The return value indicates whether missing data is considered to be an error.
public  booleangetShowRegressionLine()
     The return value tells whether a regression line is drawn.
public  DataTableInputgetTable()
     Get the DataTableInput from which the plotted data is obtained.
public  ValuegetValueObject(int valueCode)
     Get a Value that represents a statistic about the data that is shown in the scatter plot.
public  voidsetAutoChangeLimits(boolean set)
     If the parameter is true, then the limits on the CoordinateRect that contains this ScatterPlot are automatically adjusted whenever the data is recomputed.
public  voidsetColumns(int c1, int c2)
     Specify that the data to be plotted should be taken from the specified columns in the table.
public  voidsetDataColor(Color color)
     Set the color that is used to draw the points in the data.
public  voidsetExpressions(Expression exp1, Expression exp2)
     Specify the data for the the plot is to be obtained by evaluating the two expressions that are given as parameters.
public  voidsetLineColor(Color color)
     Set the color that is used to draw the regression line.
public  voidsetMissingValueIsError(boolean isError)
     If the parameter is true, then a missing data value (an empty cell or an undefined value for one of the expressions) is considered to be an error, and a JCMError is thrown when it is encountered.
public  voidsetShowRegressionLine(boolean line)
     If the parameter is true, then a regression line for the data is drawn.
public  voidsetTable(DataTableInput table)
     Specify the table from which the plotted data is to be taken.

Field Detail
INTERCEPTSLOPEDATACTMISSINGCTSTANDARDERRORCORRELATION
final public static int INTERCEPTSLOPEDATACTMISSINGCTSTANDARDERRORCORRELATION(Code)
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent.




Constructor Detail
ScatterPlot
public ScatterPlot()(Code)
Default constructor. A data table, at least, must be specified before anything can be drawn. The first two columns of the table will be plotted (once a table is specified).



ScatterPlot
public ScatterPlot(DataTableInput table)(Code)
Create a scatter plot to plot data from the specified table. Initially, it is configured to plot data from the first two columns in the table.



ScatterPlot
public ScatterPlot(DataTableInput table, int column1, int column2)(Code)
Create a scatter plot to plot data from two specified columns in a table. Columns are numbered starting from zero.



ScatterPlot
public ScatterPlot(DataTableInput table, Expression exp1, Expression exp2)(Code)
Create scatter plot to plot specified expressions using data from a table. The expressions should include references to the column names from the table and can also refer to the special variable "rowNumber".




Method Detail
compute
public void compute()(Code)
Recompute the data for the scatter plot. This is generally not called directly.



draw
public void draw(Graphics g, boolean coordsChanged)(Code)
Draw the data points and regression line. Not meant to be called directly.



getAutoChangeLimits
public boolean getAutoChangeLimits()(Code)
The return value indicates whether the limits on the CoordinateRect are automatically adjusted when the data is recomputed.



getDataColor
public Color getDataColor()(Code)
Get the color that is used to draw the points in the data.



getLineColor
public Color getLineColor()(Code)
Get the color that is used to draw the regression line.



getMissingValueIsError
public boolean getMissingValueIsError()(Code)
The return value indicates whether missing data is considered to be an error.



getShowRegressionLine
public boolean getShowRegressionLine()(Code)
The return value tells whether a regression line is drawn.



getTable
public DataTableInput getTable()(Code)
Get the DataTableInput from which the plotted data is obtained.



getValueObject
public Value getValueObject(int valueCode)(Code)
Get a Value that represents a statistic about the data that is shown in the scatter plot. The parameter specifies which statistic is represented. It can be one of the constants defined in this class: SLOPE (of regression line), INTERCEPT (y-intercept of regression line), DATACT (number of data points), MISSINGCT (number of missing data; alwasy zero if the missingValueIsError property is true), STANDARDERROR (standard error of regression line), and CORRELATION (correlation coefficient between first and second coordintes of data points).



setAutoChangeLimits
public void setAutoChangeLimits(boolean set)(Code)
If the parameter is true, then the limits on the CoordinateRect that contains this ScatterPlot are automatically adjusted whenever the data is recomputed. The default value is true.



setColumns
public void setColumns(int c1, int c2)(Code)
Specify that the data to be plotted should be taken from the specified columns in the table. Note that columns are numbered starting from zero. The parameters must be within the range of column numbers in the table.



setDataColor
public void setDataColor(Color color)(Code)
Set the color that is used to draw the points in the data. The default value is red.



setExpressions
public void setExpressions(Expression exp1, Expression exp2)(Code)
Specify the data for the the plot is to be obtained by evaluating the two expressions that are given as parameters. Both expressions should be non-null. The expressions can only be created by a Parser to which the variables from the table have been added by calling the method DataTableInput.addVariablesToParser(). The expressions are evaluated once for each row in the table to obtain the data to be ploted. They can include references to the column names from the table and to the special variable "rowNumber", which represents the number of the current row.



setLineColor
public void setLineColor(Color color)(Code)
Set the color that is used to draw the regression line. The default value is black.



setMissingValueIsError
public void setMissingValueIsError(boolean isError)(Code)
If the parameter is true, then a missing data value (an empty cell or an undefined value for one of the expressions) is considered to be an error, and a JCMError is thrown when it is encountered. If the value is false, missing data are ignored, and the value of MISSINGCT gives the number of points for which the data was missing. Note that invalid data (a cell that contains text that does not represent a number) is always considered to be an error. Also note that completely empty rows at the bottom of a DataTableInput are always ignored and are never considered to be an error. The default value of missingValueIsError is true, so that missing data is considered to be an error unless you turn off this option.



setShowRegressionLine
public void setShowRegressionLine(boolean line)(Code)
If the parameter is true, then a regression line for the data is drawn. The default value is true.



setTable
public void setTable(DataTableInput table)(Code)
Specify the table from which the plotted data is to be taken. The data from the first two columns of the table will be plotted, unless this is changed by calling setColumns() or setExpressions().



Fields inherited from edu.hws.jcm.draw.Drawable
protected DisplayCanvas canvas(Code)(Java Doc)
protected CoordinateRect coords(Code)(Java Doc)

Methods inherited from edu.hws.jcm.draw.Drawable
abstract public void draw(Graphics g, boolean coordsChanged)(Code)(Java Doc)
public boolean getVisible()(Code)(Java Doc)
public void needsRedraw()(Code)(Java Doc)
protected void setOwnerData(DisplayCanvas canvas, CoordinateRect coords)(Code)(Java Doc)
public void setVisible(boolean show)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.