public class Line extends Shape
| Modifier and Type | Class and Description |
|---|---|
static class |
Line.Style
The supported styles of lines.
|
| Constructor and Description |
|---|
Line(double[][] points,
Line.Style style,
char mark,
java.awt.Color color)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Line |
of(double[][] points)
Creates a Line with solid stroke and black color.
|
static Line |
of(double[][] points,
char mark)
Creates a Line.
|
static Line |
of(double[][] points,
java.awt.Color color)
Creates a Line.
|
static Line |
of(double[][] points,
Line.Style style)
Creates a Line.
|
static Line |
of(double[][] points,
Line.Style style,
java.awt.Color color)
Creates a Line.
|
void |
paint(Graphics g)
Draws the shape.
|
static double[][] |
zipWithIndex(double[] y)
Returns a 2-dimensional array with the index as the x coordinate.
|
public Line(double[][] points,
Line.Style style,
char mark,
java.awt.Color color)
points - a n-by-2 or n-by-3 matrix that are the coordinates of points.style - the style of line.mark - the mark of points.
color - the color of line.public static double[][] zipWithIndex(double[] y)
y - the data vector of y coordinates.
The x coordinates will be [0, n), where n is the length of y.public static Line of(double[][] points)
public static Line of(double[][] points, Line.Style style)
public static Line of(double[][] points, char mark)
public static Line of(double[][] points, java.awt.Color color)
public static Line of(double[][] points, Line.Style style, java.awt.Color color)