Package jcckit.graphic
Class Rectangle
- java.lang.Object
-
- jcckit.graphic.BasicGraphicalElement
-
- jcckit.graphic.Rectangle
-
- All Implemented Interfaces:
GraphicalElement
- Direct Known Subclasses:
Oval
public class Rectangle extends BasicGraphicalElement
A rectangle.- Author:
- Franz-Josef Elmer
-
-
Constructor Summary
Constructors Constructor Description Rectangle(GraphPoint center, double width, double height, GraphicAttributes attributes)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 specifiedRenderer
.-
Methods inherited from class jcckit.graphic.BasicGraphicalElement
getGraphicAttributes, isClosed
-
-
-
-
Constructor Detail
-
Rectangle
public Rectangle(GraphPoint center, double width, double height, GraphicAttributes attributes)
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 Detail
-
getCenter
public GraphPoint 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
public void renderWith(Renderer renderer)
Renders this rectangle with the specifiedRenderer
.- Parameters:
renderer
- An instance ofRectangleRenderer
.- Throws:
java.lang.IllegalArgumentException
- if renderer is not an instance of RectangleRenderer.
-
-