Package jcckit.graphic
Class Rectangle
java.lang.Object
jcckit.graphic.BasicGraphicalElement
jcckit.graphic.Rectangle
- All Implemented Interfaces:
GraphicalElement
- Direct Known Subclasses:
Oval
A rectangle.
-
Constructor Summary
ConstructorDescriptionRectangle
(GraphPoint center, double width, double height, GraphicAttributes attributes) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the center of this element.double
Returns the height of this element.double
getWidth()
Returns the width of this element.void
renderWith
(Renderer renderer) Renders this rectangle with the specifiedRenderer
.Methods inherited from class jcckit.graphic.BasicGraphicalElement
getGraphicAttributes, isClosed
-
Constructor Details
-
Rectangle
Creates a new instance.- Parameters:
center
- The position of the center of this element.width
- The width.height
- The height.attributes
- Drawing attributes. Can be null.
-
-
Method Details
-
getCenter
Returns the center of this element. -
getWidth
public double getWidth()Returns the width of this element. -
getHeight
public double getHeight()Returns the height of this element. -
renderWith
Renders this rectangle with the specifiedRenderer
.- Parameters:
renderer
- An instance ofRectangleRenderer
.- Throws:
IllegalArgumentException
- if renderer is not an instance of RectangleRenderer.
-