|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--rvl.awt.Plot
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.awt.Color[] |
defaultColor
|
protected int |
defaultDotSize
|
protected java.awt.Color[][] |
dotColor
|
protected int[][] |
dotSize
|
protected double |
h0
|
protected double |
h1
|
protected double |
hMax
|
protected double |
hMin
|
protected java.awt.Color[][] |
lineColor
|
protected double |
mh
|
protected double |
mv
|
protected boolean |
needsRescaling
|
protected boolean |
sameScale
|
protected java.awt.Color |
scaleColor
|
protected java.awt.Font |
scaleFont
|
protected boolean |
swap
|
protected java.lang.String[] |
title
|
protected double |
v0
|
protected double |
v1
|
protected double |
vMax
|
protected double |
vMin
|
protected double[][] |
x
|
protected java.lang.String[] |
xAxisLab
|
protected boolean |
xCustomLab
|
protected double |
xMax
|
protected double |
xMin
|
protected double[] |
xTick
|
protected java.lang.String[] |
xTickLab
|
protected double[][] |
y
|
protected java.lang.String[] |
yAxisLab
|
protected boolean |
yCustomLab
|
protected double |
yMax
|
protected double |
yMin
|
protected double[] |
yTick
|
protected java.lang.String[] |
yTickLab
|
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 | |
Plot(double[][] x,
double[][] y)
General constructor: Plots y[0][] vs x[0][], y[2][] vs x[1][], ... |
|
Plot(double[] x,
double[] y)
Constructor for a simple plot of one variable against another. |
|
Plot(double[] x,
double[][] y)
Constructor for a multiple plot of several y[]s, all with same x[]. |
Method Summary | |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
double[][] |
getXData()
|
double[][] |
getYData()
|
protected boolean |
isBad(double x)
|
java.awt.Dimension |
minimumSize()
|
void |
paint(java.awt.Graphics g)
|
java.awt.Dimension |
preferredSize()
|
protected void |
rescale()
Set values if xMin, xMax, yMin, yMax |
void |
setAxisLabels(java.lang.String[] xLab,
java.lang.String[] yLab)
Set axis labels. |
void |
setAxisLabels(java.lang.String xLab,
java.lang.String yLab)
Set single-line axis labels. |
void |
setData(double[][] x,
double[][] y)
Set data and rescale the plot (see constructor for details). |
void |
setData(double[][] x,
double[][] y,
boolean rescale)
Set data to be plotted (see constructor for details) |
void |
setData(double[] x,
double[] y)
Set data for one set of x values and one set of y values; and rescale the plot. |
void |
setData(double[] x,
double[][] y)
Set data for one set of x values and several sets of y values; and rescale the plot. |
void |
setData(double[] x,
double[][] y,
boolean rescale)
Set data for one set of x values and several sets of y values. |
void |
setData(double[] x,
double[] y,
boolean rescale)
Set data for one set of x values and one set of y values. |
void |
setDefaultColor(java.awt.Color[] color)
Set default sequence of colors to cycle through |
void |
setDefaultDotSize(int size)
Set default size of dots (width, in pixels) |
void |
setDotColor(java.awt.Color color)
Set dot color (same color for all points) |
void |
setDotColor(java.awt.Color[] color)
Set dot colors (constant color for each data set) |
void |
setDotColor(java.awt.Color[][] color)
Set dot colors (potentially individual for each point) |
void |
setDotMode(boolean mode)
Enable or disable plotting of symbols at all points |
void |
setDotSize(int size)
Set dot size (same size for all points) |
void |
setDotSize(int[] size)
Set dot sizes (constant size for each data set) |
void |
setDotSize(int[][] size)
Set dot sizes (potentially individual for each point) |
void |
setLineColor(java.awt.Color color)
Set line color (constant color for all curves) |
void |
setLineColor(java.awt.Color[] color)
Set line colors (constant color for each data set) |
void |
setLineColor(java.awt.Color[][] color)
Set line colors (potentially individual for each point) |
void |
setLineMode(boolean mode)
Enable or disable plotting of lines for all data. |
void |
setSameScale(boolean flag)
Enable/disable provision to keep scale constants equal |
void |
setScaleColor(java.awt.Color color)
set Colors of axes |
void |
setTickMode(boolean xHasThem,
boolean yHasThem)
Enable or disable default tick marks and labels for each axis. |
void |
setTitle(java.lang.String title)
Set a one-line title. |
void |
setTitle(java.lang.String[] title)
Set title. |
void |
setTranspose(boolean swap)
Enable/disable transposing the plot |
void |
setXData(double[][] x)
Set x data and rescale the plot |
void |
setXData(double[][] x,
boolean rescale)
Set x data to be plotted |
void |
setXTicks(double[] tick,
java.lang.String[] tickLab)
Set tick positions and labels for the x variable. |
void |
setYData(double[][] y)
Set y data and rescale the plot |
void |
setYData(double[][] y,
boolean rescale)
Set y data to be plotted |
void |
setYTicks(double[] tick,
java.lang.String[] tickLab)
Set tick positions and labels for the y variable. |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double[][] x
protected double[][] y
protected int defaultDotSize
protected int[][] dotSize
protected java.awt.Color[] defaultColor
protected java.awt.Color[][] dotColor
protected java.awt.Color[][] lineColor
protected java.awt.Color scaleColor
protected double[] xTick
protected double[] yTick
protected java.lang.String[] xTickLab
protected java.lang.String[] yTickLab
protected java.lang.String[] title
protected java.lang.String[] xAxisLab
protected java.lang.String[] yAxisLab
protected boolean xCustomLab
protected boolean yCustomLab
protected boolean sameScale
protected double xMin
protected double xMax
protected double yMin
protected double yMax
protected double h0
protected double v0
protected double h1
protected double v1
protected double mh
protected double mv
protected double hMin
protected double hMax
protected double vMin
protected double vMax
protected java.awt.Font scaleFont
protected boolean needsRescaling
protected boolean swap
Constructor Detail |
public Plot(double[] x, double[] y)
public Plot(double[] x, double[][] y)
public Plot(double[][] x, double[][] y)
However, if x.length != y.length, array indices are modded-out. For example, suppose x.length = 2 and y.length = 5, then plots are of (x[0],y[0]), (x[1],y[1]), (x[0],y[2]), (x[1],y[3]), (x[0],y[4]).
Method Detail |
public void setData(double[][] x, double[][] y, boolean rescale)
x
- Arrays of x valuesy
- Arrays of y valuesrescale
- If true, the scaling of the plot is changed
to fit the data; otherwise, the same scale is used.#Plot(double x[][], double y[][])
public void setData(double[][] x, double[][] y)
setData (x, y, true)
x
- Arrays of x valuesy
- Arrays of y valuessetData(double x[][], double y[][], boolean rescale)
public void setData(double[] x, double[][] y, boolean rescale)
x
- Array of x valuesy
- Arrays of y valuesrescale
- If true, the scaling of the plot is changed
to fit the data; otherwise, the same scale is used.public void setData(double[] x, double[][] y)
x
- Array of x valuesy
- Arrays of y valuespublic void setData(double[] x, double[] y, boolean rescale)
x
- Array of x valuesy
- Array of y valuesrescale
- If true, the scaling of the plot is changed
to fit the data; otherwise, the same scale is used.public void setData(double[] x, double[] y)
x
- Array of x valuesy
- Array of y valuespublic double[][] getXData()
public void setXData(double[][] x, boolean rescale)
x
- Arrays of x valuesrescale
- If true, the scaling of the plot is changed
to fit the data; otherwise, the same scale is used.public void setXData(double[][] x)
x
- Arrays of x valuespublic double[][] getYData()
public void setYData(double[][] y, boolean rescale)
y
- Arrays of y valuesrescale
- If true, the scaling of the plot is changed
to fit the data; otherwise, the same scale is used.public void setYData(double[][] y)
y
- Arrays of y valuespublic void setDotMode(boolean mode)
mode
- If true, all points be plotted with dots of
default size and colors. If false, no symbols are plottedpublic void setLineMode(boolean mode)
mode
- If true, each (x,y) pair of arrays will
be connected with lines of
default colors. If false, no lines are plotted.public void setDotColor(java.awt.Color color)
public void setDotColor(java.awt.Color[] color)
color
- array of colors. The ith element specifies
the color to be used in plotting the ith curvepublic void setDotColor(java.awt.Color[][] color)
public void setDotSize(int size)
public void setDotSize(int[] size)
size
- array of sizes. The ith element specifies
the size of dots to be used in plotting the ith curvepublic void setDotSize(int[][] size)
public void setLineColor(java.awt.Color color)
public void setLineColor(java.awt.Color[] color)
public void setLineColor(java.awt.Color[][] color)
public void setDefaultColor(java.awt.Color[] color)
public void setDefaultDotSize(int size)
public void setScaleColor(java.awt.Color color)
public void setTranspose(boolean swap)
swap
- If true, the x variable is the vertical
coordinate and the y variable is horizontal.public void setSameScale(boolean flag)
flag
- If true, scaling is done so that both axes use
the same number of pixels per unit scale value.public void setAxisLabels(java.lang.String[] xLab, java.lang.String[] yLab)
public void setAxisLabels(java.lang.String xLab, java.lang.String yLab)
public void setTitle(java.lang.String[] title)
setAxisLabels
setAxisLabels(java.lang.String[], java.lang.String[])
public void setTitle(java.lang.String title)
setAxisLabels
setAxisLabels
public void setTickMode(boolean xHasThem, boolean yHasThem)
true
enables them and places
tick marks at nice numbers. An argument of false
disables both custom and default tick labeling for that axis.setXTicks
,
setYTicks
public void setXTicks(double[] tick, java.lang.String[] tickLab)
setTickMode
public void setYTicks(double[] tick, java.lang.String[] tickLab)
setTickMode
public void paint(java.awt.Graphics g)
paint
in class java.awt.Component
protected boolean isBad(double x)
protected void rescale()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
public java.awt.Dimension preferredSize()
preferredSize
in class java.awt.Component
public java.awt.Dimension minimumSize()
minimumSize
in class java.awt.Component
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |