Class LineElement

java.lang.Object
org.openscience.cdk.renderer.elements.LineElement
All Implemented Interfaces:
IRenderingElement
Direct Known Subclasses:
WedgeLineElement

public class LineElement extends Object implements IRenderingElement
A line between two points.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The type of the line.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Color
    The color of the line.
    final double
    The x-coordinate of the first point.
    final double
    The y-coordinate of the first point.
    final double
    The x-coordinate of the second point.
    final double
    The y-coordinate of the second point.
    final double
    The width of the line.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LineElement(double firstPointX, double firstPointY, double secondPointX, double secondPointY, double width, Color color)
    Make a line element.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Converts this TextElement into widget specific objects.
    Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.
    toArea(boolean endCaps)
    Convert the Line to an awt.Area specifying whether to include the end caps or not.

    Methods inherited from class Object

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

    • firstPointX

      public final double firstPointX
      The x-coordinate of the first point.
    • firstPointY

      public final double firstPointY
      The y-coordinate of the first point.
    • secondPointX

      public final double secondPointX
      The x-coordinate of the second point.
    • secondPointY

      public final double secondPointY
      The y-coordinate of the second point.
    • width

      public final double width
      The width of the line.
    • color

      public final Color color
      The color of the line.
  • Constructor Details

    • LineElement

      public LineElement(double firstPointX, double firstPointY, double secondPointX, double secondPointY, double width, Color color)
      Make a line element.
      Parameters:
      firstPointX - x-coordinate of the first point
      firstPointY - y-coordinate of the first point
      secondPointX - x-coordinate of the second point
      secondPointY - y-coordinate of the second point
      width - the width of the line
      color - the color of the line
  • Method Details

    • accept

      public void accept(IRenderingVisitor visitor)
      Converts this TextElement into widget specific objects.
      Specified by:
      accept in interface IRenderingElement
      Parameters:
      visitor - Toolkit specific widget factory.
    • toArea

      public Area toArea()
      Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.
      Returns:
      the area
    • toArea

      public Area toArea(boolean endCaps)
      Convert the Line to an awt.Area specifying whether to include the end caps or not.
      Parameters:
      endCaps - include the end caps
      Returns:
      the area