|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component net.sourceforge.webcompmath.draw.Drawable net.sourceforge.webcompmath.draw.ScatterPlot
public class ScatterPlot
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
CORRELATION
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
static int |
DATACT
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
static int |
INTERCEPT
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
static int |
MISSINGCT
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
static int |
SLOPE
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
static int |
STANDARDERROR
A constant that can be used in the getValueObject() method to indicate which statistic the object should represent. |
Fields inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
canvas, coords |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ScatterPlot()
Default constructor. |
|
ScatterPlot(DataTableInput table)
Create a scatter plot to plot data from the specified table. |
|
ScatterPlot(DataTableInput table,
Expression exp1,
Expression exp2)
Create scatter plot to plot specified expressions using data from a table. |
|
ScatterPlot(DataTableInput table,
int column1,
int column2)
Create a scatter plot to plot data from two specified columns in a table. |
Method Summary | |
---|---|
void |
compute()
Recompute the data for the scatter plot. |
void |
draw(java.awt.Graphics g,
boolean coordsChanged)
Draw the data points and regression line. |
boolean |
getAutoChangeLimits()
The return value indicates whether the limits on the CoordinateRect are automatically adjusted when the data is recomputed. |
int |
getCrossHalfSize()
Get the width and height, in pixels, of crosses. |
int |
getCrossLineWidth()
Get the width, in pixels, of lines that are drawn. |
java.awt.Color |
getDataColor()
Get the color that is used to draw the points in the data. |
java.awt.Color |
getLineColor()
Get the color that is used to draw the regression line. |
int |
getLineWidth()
Get the width, in pixels, of lines for crosses. |
boolean |
getMissingValueIsError()
The return value indicates whether missing data is considered to be an error. |
boolean |
getShowRegressionLine()
The return value tells whether a regression line is drawn. |
DataTableInput |
getTable()
Get the DataTableInput from which the plotted data is obtained. |
Value |
getValueObject(int valueCode)
Get a Value that represents a statistic about the data that is shown in the scatter plot. |
void |
setAutoChangeLimits(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. |
void |
setColumns(int c1,
int c2)
Specify that the data to be plotted should be taken from the specified columns in the table. |
void |
setCrossHalfSize(int size)
Set the width and height, in pixels, of crosses. |
void |
setCrossLineWidth(int width)
Set the width, in pixels, of lines for crosses. |
void |
setDataColor(java.awt.Color color)
Set the color that is used to draw the points in the data. |
void |
setExpressions(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. |
void |
setLineColor(java.awt.Color color)
Set the color that is used to draw the regression line. |
void |
setLineWidth(int width)
Set the width, in pixels, of lines that are drawn. |
void |
setMissingValueIsError(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. |
void |
setShowRegressionLine(boolean line)
If the parameter is true, then a regression line for the data is drawn. |
void |
setTable(DataTableInput table)
Specify the table from which the plotted data is to be taken. |
Methods inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
getVisible, needsRedraw, setOwnerData, setVisible |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INTERCEPT
public static final int SLOPE
public static final int DATACT
public static final int MISSINGCT
public static final int STANDARDERROR
public static final int CORRELATION
Constructor Detail |
---|
public ScatterPlot()
public ScatterPlot(DataTableInput table)
table
- table to usepublic ScatterPlot(DataTableInput table, int column1, int column2)
table
- table to usecolumn1
- column to usecolumn2
- column to usepublic ScatterPlot(DataTableInput table, Expression exp1, Expression exp2)
table
- table to useexp1
- expression to plotexp2
- expression to plotMethod Detail |
---|
public void setTable(DataTableInput table)
table
- table to usepublic DataTableInput getTable()
public void setColumns(int c1, int c2)
c1
- column to usec2
- column to usepublic void setExpressions(Expression exp1, Expression exp2)
exp1
- expression to plotexp2
- expression to plotpublic void setShowRegressionLine(boolean line)
line
- true or falsepublic boolean getShowRegressionLine()
public void setMissingValueIsError(boolean isError)
isError
- true or falsepublic boolean getMissingValueIsError()
public void setAutoChangeLimits(boolean set)
set
- true or falsepublic boolean getAutoChangeLimits()
public java.awt.Color getDataColor()
public void setDataColor(java.awt.Color color)
color
- point colorpublic java.awt.Color getLineColor()
public void setLineColor(java.awt.Color color)
color
- line colorpublic void setLineWidth(int width)
width
- line widthpublic int getCrossLineWidth()
public void setCrossLineWidth(int width)
width
- line widthpublic int getLineWidth()
public void setCrossHalfSize(int size)
size
- the sizepublic int getCrossHalfSize()
public Value getValueObject(int valueCode)
valueCode
- code for statistic to get
public void compute()
compute
in interface Computable
public void draw(java.awt.Graphics g, boolean coordsChanged)
draw
in class Drawable
g
- graphics contextcoordsChanged
- true or false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |