Class RectangleElement
java.lang.Object
org.openscience.cdk.renderer.elements.RectangleElement
- All Implemented Interfaces:
IRenderingElement
A rectangle, with width and height.
- Source code:
- main
- Belongs to CDK module:
- renderbasic
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Color
The color of the rectangle.final boolean
If true, the rectangle is drawn as filled.final double
The height of the rectangle.final double
The width of the rectangle.final double
The x-coordinate of the center of the rectangle.final double
The y-coordinate of the center of the rectangle. -
Constructor Summary
ConstructorsConstructorDescriptionRectangleElement
(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
Modifier and TypeMethodDescriptionvoid
accept
(IRenderingVisitor visitor) Converts thisTextElement
into widget specific objects.
-
Field Details
-
xCoord
public final double xCoordThe x-coordinate of the center of the rectangle. -
yCoord
public final double yCoordThe y-coordinate of the center of the rectangle. -
width
public final double widthThe width of the rectangle. -
height
public final double heightThe height of the rectangle. -
filled
public final boolean filledIf true, the rectangle is drawn as filled. -
color
The color of the rectangle.
-
-
Constructor Details
-
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 Details
-
accept
Converts thisTextElement
into widget specific objects.- Specified by:
accept
in interfaceIRenderingElement
- Parameters:
visitor
- Toolkit specific widget factory.
-