public class RectangleElement extends Object implements IRenderingElement
| Modifier and Type | Field and Description | 
|---|---|
| Color | colorThe color of the rectangle. | 
| boolean | filledIf true, the rectangle is drawn as filled. | 
| double | heightThe height of the rectangle. | 
| double | widthThe width of the rectangle. | 
| double | xCoordThe x-coordinate of the center of the rectangle. | 
| double | yCoordThe y-coordinate of the center of the rectangle. | 
| Constructor and Description | 
|---|
| RectangleElement(double xCoord,
                double yCoord,
                double width,
                double height,
                boolean filled,
                Color color)Make a rectangle centered on (x, y). | 
| RectangleElement(double xCoord1,
                double yCoord1,
                double xCoord2,
                double yCoord2,
                Color color)Make a rectangle from two opposite corners (x1, y1) and (x2, y2). | 
| Modifier and Type | Method and Description | 
|---|---|
| void | accept(IRenderingVisitor visitor)Converts this  TextElementinto widget specific objects. | 
public final double xCoord
public final double yCoord
public final double width
public final double height
public final boolean filled
public final Color color
public RectangleElement(double xCoord1,
                        double yCoord1,
                        double xCoord2,
                        double yCoord2,
                        Color color)
xCoord1 - the x-coordinate of the first pointyCoord1 - the y-coordinate of the first pointxCoord2 - the x-coordinate of the second pointyCoord2 - the y-coordinate of the second pointcolor - the color of the rectanglepublic RectangleElement(double xCoord,
                        double yCoord,
                        double width,
                        double height,
                        boolean filled,
                        Color color)
xCoord - x-coordinate of the center of the rectangleyCoord - y-coordinate of the center of the rectanglewidth - width of the rectangleheight - height of the rectanglefilled - if true, the rectangle is drawn as filledcolor - the color of the rectanglepublic void accept(IRenderingVisitor visitor)
TextElement into widget specific objects.accept in interface IRenderingElementvisitor - Toolkit specific widget factory.Copyright © 2022. All rights reserved.