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
    final 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

    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

    Modifier and Type
    Method
    Description
    void
    Converts this TextElement into widget specific objects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 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 point
      yCoord1 - the y-coordinate of the first point
      xCoord2 - the x-coordinate of the second point
      yCoord2 - the y-coordinate of the second point
      color - 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 rectangle
      yCoord - y-coordinate of the center of the rectangle
      width - width of the rectangle
      height - height of the rectangle
      filled - if true, the rectangle is drawn as filled
      color - the color of the rectangle
  • Method Details