public class PointsView extends TiledView
For each point (x1,x2), a mark with a specified style, size, and color may be painted. Between each consecutive pair of points (x1,x2) within a plot segment, lines with specified style, width, and color may be painted.
For example, to view sampled functions x2 = sin(x1) and x2 = cos(x1), one might construct two plot segments by specifying an array of two arrays of x1 coordinates and a corresponding array of two arrays of x2 coordinates.
Note that mark and line attributes are constant for each points view. These attributes do not vary among plot segments. To paint marks and lines with different attributes, construct multiple views.
Modifier and Type | Class and Description |
---|---|
static class |
PointsView.Line
The style of line plotted between consecutive points (x1,x2).
|
static class |
PointsView.Mark
The style of mark plotted at points (x1,x2).
|
static class |
PointsView.Orientation
Orientation of axes x1 and x2.
|
Constructor and Description |
---|
PointsView(float[] x2)
Constructs a view of points (x1,x2) with specified x2 coordinates.
|
PointsView(float[][] x1,
float[][] x2)
Constructs a view of points (x1,x2) with multiple plot segments.
|
PointsView(float[][] x1,
float[][] x2,
float[][] x3)
Constructs a view of points (x1,x2,x3) with multiple plot segments.
|
PointsView(float[] x1,
float[] x2)
Constructs a view of points (x1,x2) with a single plot segment.
|
PointsView(float[] x1,
float[] x2,
float[] x3)
Constructs a view of points (x1,x2,x3) with a single plot segment.
|
PointsView(Sampling s1,
float[] x2)
Constructs a view of points (x1,x2) for a sampled function x2(x1).
|
Modifier and Type | Method and Description |
---|---|
PointsView.Orientation |
getOrientation()
Gets the orientation of (x1,x2) axes.
|
void |
paint(java.awt.Graphics2D g2d)
Paints this tiled view.
|
void |
set(float[][] x1,
float[][] x2)
Sets array of arrays of (x1,x2) coordinates for multiple plot segments.
|
void |
set(float[][] x1,
float[][] x2,
float[][] x3)
Sets array of arrays of (x1,x2,x3) coordinates for multiple plot segments.
|
void |
set(float[] x1,
float[] x2)
Sets arrays of (x1,x2) coordinates for a single plot segment.
|
void |
set(float[] x1,
float[] x2,
float[] x3)
Sets arrays of (x1,x2,x3) coordinates for a single plot segment.
|
void |
set(Sampling s1,
float[] x2)
Sets (x1,x2) coordinates for a sampled function x2(x1).
|
void |
setLineColor(java.awt.Color color)
Sets the line color.
|
void |
setLineStyle(PointsView.Line style)
Sets the line style.
|
void |
setLineWidth(float width)
Sets the line width.
|
void |
setMarkColor(java.awt.Color color)
Sets the mark color.
|
void |
setMarkSize(float size)
Sets the mark size.
|
void |
setMarkStyle(PointsView.Mark style)
Sets the mark style.
|
void |
setOrientation(PointsView.Orientation orientation)
Sets the orientation of (x1,x2) axes.
|
void |
setStyle(java.lang.String style)
Sets the color, line style, and mark style from a style string.
|
void |
setTextFormat(java.lang.String format)
Sets the format used for text labels.
|
getBestHorizontalProjector, getBestVerticalProjector, getHorizontalProjector, getLineWidth, getTile, getTranscaler, getVerticalProjector, repaint, setBestProjectors
public PointsView(float[] x2)
x2
- array of x2 coordinates.public PointsView(Sampling s1, float[] x2)
s1
- the sampling of x1 coordinates.x2
- array of x2 coordinates.public PointsView(float[] x1, float[] x2)
x1
- array of x1 coordinates.x2
- array of x2 coordinates.public PointsView(float[][] x1, float[][] x2)
x1
- array of arrays of x1 coordinates.x2
- array of arrays of x2 coordinates.public PointsView(float[] x1, float[] x2, float[] x3)
x1
- array of x1 coordinates.x2
- array of x2 coordinates.x3
- array of x3 coordinates; null, if none.public PointsView(float[][] x1, float[][] x2, float[][] x3)
x1
- array of arrays of x1 coordinates.x2
- array of arrays of x2 coordinates.x3
- array of arrays of x3 coordinates.public void set(Sampling s1, float[] x2)
s1
- the sampling of x1 coordinates.x2
- array of x2 coordinates.public void set(float[] x1, float[] x2)
x1
- array of x1 coordinates.x2
- array of x2 coordinates.public void set(float[] x1, float[] x2, float[] x3)
x1
- array of x1 coordinates.x2
- array of x2 coordinates.x3
- array of x3 coordinates; null, if none.public void set(float[][] x1, float[][] x2)
x1
- array of arrays of x1 coordinates.x2
- array of arrays of x2 coordinates.public void set(float[][] x1, float[][] x2, float[][] x3)
x1
- array of arrays of x1 coordinates.x2
- array of arrays of x2 coordinates.x3
- array of arrays of x3 coordinates; null, if none.public void setOrientation(PointsView.Orientation orientation)
orientation
- the orientation.public PointsView.Orientation getOrientation()
public void setStyle(java.lang.String style)
To specify a color, the style string may contain one of "r" for red, "g" for green, "b" for blue, "c" for cyan, "m" for magenta, "y" for yellow, "k" for black, or "w" for white. If the style string contains none of these colors, then the default color is used.
To specify a line style, the style string may contain one of "-" for solid lines, "--" for dashed lines, "-." for dotted lines, or "--." for dash-dotted lines. If the style string contains none of these line styles, then no lines are painted.
To specify a mark style, the style string may contain one of "." for point, "+" for plus, "x" for cross, "o" for hollow circle", "O" for filled circle, "s" for hollow square, or "S" for filled square. If the style string contains none of these mark styles, then no marks are painted.
style
- the style string.public void setLineStyle(PointsView.Line style)
style
- the line style.public void setLineWidth(float width)
width
- the line width.public void setLineColor(java.awt.Color color)
color
- the line color; null, for tile foreground color.public void setMarkStyle(PointsView.Mark style)
style
- the mark style.public void setMarkSize(float size)
size
- the mark size.public void setMarkColor(java.awt.Color color)
color
- the mark color.public void setTextFormat(java.lang.String format)
format
- the text format.public void paint(java.awt.Graphics2D g2d)
TiledView
Tiled views should not replace (set) entirely the transform in the specified graphics context. This transform may already have been set by the tile or its mosaic. Therefore, tiled views should modify this transform only by specifying additional scaling, translation, etc.