public class Rectangle extends BasicGraphicalElement
Constructor and Description |
---|
Rectangle(GraphPoint center,
double width,
double height,
GraphicAttributes attributes)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
GraphPoint |
getCenter()
Returns the center of this element.
|
double |
getHeight()
Returns the height of this element.
|
double |
getWidth()
Returns the width of this element.
|
void |
renderWith(Renderer renderer)
Renders this rectangle with the specified
Renderer . |
getGraphicAttributes, isClosed
public Rectangle(GraphPoint center, double width, double height, GraphicAttributes attributes)
center
- The position of the center of this element.width
- The width.height
- The height.attributes
- Drawing attributes. Can be null.public GraphPoint getCenter()
public double getWidth()
public double getHeight()
public void renderWith(Renderer renderer)
Renderer
.renderer
- An instance of RectangleRenderer
.IllegalArgumentException
- if renderer is not
an instance of RectangleRenderer.Copyright © 2016. All Rights Reserved.