public class Rectangle extends PlottableObject
Is also
able to create ellipses and circles using
setXCurvature(double) or
setYCurvature(double).
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
position |
protected double |
rotation |
protected double |
xCurvature |
protected double |
yCurvature |
ax, color, defaultColor, defaultLineStyle, defaultLineWidth, edgeColor, faceColor, lineStyle, lineWidth| Constructor and Description |
|---|
Rectangle(Axes a)
Creates a rectangle at (0,0) with (1,1) size and no curvature.
|
Rectangle(double x,
double y,
double w,
double h)
Creates a rectangle object with the parameters x, y, w, h at the current
axes of the current figure with no curvature.
|
Rectangle(double x,
double y,
double w,
double h,
Axes a)
Creates a rectangle object with the parameters x, y, w, h with no
curvature.
|
Rectangle(double x,
double y,
double w,
double h,
double xc,
double yc)
Creates a rectangle object with curvature at the current axes of the
current figure.
|
Rectangle(double x,
double y,
double w,
double h,
double xc,
double yc,
Axes a)
Creates a rectangle object with curvature.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
getPosition() |
double |
getRotation() |
double |
getXCurvature() |
double |
getYCurvature() |
void |
paint(java.awt.Graphics2D g) |
void |
setPosition(double[] position) |
void |
setRotation(double rotation)
Sets the rotation of the rectangle (in degrees from 0 to 360 clockwise).
|
void |
setXCurvature(double curvature) |
void |
setYCurvature(double curvature) |
dashdotted, dashed, dotted, getAxes, getColor, getEdgeColor, getFaceColor, getLineStyle, getLineWidth, setColor, setEdgeColor, setFaceColor, setLineStyle, setLineWidth, solidprotected double[] position
protected double xCurvature
protected double yCurvature
protected double rotation
public Rectangle(Axes a)
a - Reference to the Axes object.public Rectangle(double x,
double y,
double w,
double h)
x - x position (from lower left)y - y position (from lower left)w - widthh - heightpublic Rectangle(double x,
double y,
double w,
double h,
Axes a)
x - x position (from lower left)y - y position (from lower left)w - widthh - heighta - Axes to which the objects gets addedpublic Rectangle(double x,
double y,
double w,
double h,
double xc,
double yc)
x - x position (from lower left)y - y position (from lower left)w - widthh - heightxc - xCurvature (from 0 = no to 1 = full ellipse)yc - yCurvature (from 0 = no to 1 = full ellipse)public Rectangle(double x,
double y,
double w,
double h,
double xc,
double yc,
Axes a)
x - x position (from lower left)y - y position (from lower left)w - widthh - heightxc - xCurvature (from 0 = no to 1 = full ellipse)yc - yCurvature (from 0 = no to 1 = full ellipse)a - Axes to which rectangle gets addedpublic void paint(java.awt.Graphics2D g)
paint in class PlottableObjectpublic double[] getPosition()
public void setPosition(double[] position)
position - The position to set.public double getXCurvature()
public void setXCurvature(double curvature)
curvature - The xCurvature to set. From 0 = no curvature to 1 = full
curvature (=ellipse, circle)public double getYCurvature()
public void setYCurvature(double curvature)
curvature - The yCurvature to set. From 0 = no curvature to 1 = full
curvature (=ellipse, circle)public double getRotation()
setRotation(double)public void setRotation(double rotation)
rotation - The rotation to set.