Class RectangleElement
java.lang.Object
org.openscience.cdk.renderer.elements.RectangleElement
- All Implemented Interfaces:
IRenderingElement
A rectangle, with width and height.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ColorThe color of the rectangle.final booleanIf true, the rectangle is drawn as filled.final doubleThe height of the rectangle.final doubleThe width of the rectangle.final doubleThe x-coordinate of the center of the rectangle.final doubleThe 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 TypeMethodDescriptionvoidaccept(IRenderingVisitor visitor) Converts thisTextElementinto widget specific objects.static IRenderingElementcreateSquare(double cx, double cy, double size, boolean filled, Color color)
-
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
-
createSquare
public static IRenderingElement createSquare(double cx, double cy, double size, boolean filled, Color color) -
accept
Converts thisTextElementinto widget specific objects.- Specified by:
acceptin interfaceIRenderingElement- Parameters:
visitor- Toolkit specific widget factory.
-