Class RectangleElement
- java.lang.Object
-
- org.openscience.cdk.renderer.elements.RectangleElement
-
- All Implemented Interfaces:
IRenderingElement
public class RectangleElement extends Object implements IRenderingElement
A rectangle, with width and height.- Source code:
- main
- Belongs to CDK module:
- renderbasic
-
-
Field Summary
Fields Modifier and Type Field Description Color
color
The color of the rectangle.boolean
filled
If true, the rectangle is drawn as filled.double
height
The height of the rectangle.double
width
The width of the rectangle.double
xCoord
The x-coordinate of the center of the rectangle.double
yCoord
The y-coordinate of the center of the rectangle.
-
Constructor Summary
Constructors Constructor 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).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(IRenderingVisitor visitor)
Converts thisTextElement
into widget specific objects.
-
-
-
Field Detail
-
xCoord
public final double xCoord
The x-coordinate of the center of the rectangle.
-
yCoord
public final double yCoord
The y-coordinate of the center of the rectangle.
-
width
public final double width
The width of the rectangle.
-
height
public final double height
The height of the rectangle.
-
filled
public final boolean filled
If true, the rectangle is drawn as filled.
-
color
public final Color color
The color of the rectangle.
-
-
Constructor Detail
-
RectangleElement
public RectangleElement(double xCoord1, double yCoord1, double xCoord2, double yCoord2, Color color)
Make a rectangle from two opposite corners (x1, y1) and (x2, y2).- Parameters:
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 rectangle
-
RectangleElement
public RectangleElement(double xCoord, double yCoord, double width, double height, boolean filled, Color color)
Make a rectangle centered on (x, y).- Parameters:
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 rectangle
-
-
Method Detail
-
accept
public void accept(IRenderingVisitor visitor)
Converts thisTextElement
into widget specific objects.- Specified by:
accept
in interfaceIRenderingElement
- Parameters:
visitor
- Toolkit specific widget factory.
-
-