Class TextGroupElement

java.lang.Object
org.openscience.cdk.renderer.elements.TextElement
org.openscience.cdk.renderer.elements.TextGroupElement
All Implemented Interfaces:
IRenderingElement

public class TextGroupElement extends TextElement
A group of text elements, particularly the element symbol (eg: "C") surrounded by other annotations such as mass number, charge, etc. These annotation elements are the 'children' of the parent text element.
Source code:
main
Belongs to CDK module:
renderbasic
  • Field Details

  • Constructor Details

    • TextGroupElement

      public TextGroupElement(double x, double y, String text, Color color)
      Make a text group at (x, y) with the text and color given.
      Parameters:
      x - the x-coordinate of the center of the text
      y - the y-coordinate of the center of the text
      text - the text to render
      color - the color of the text
  • Method Details

    • addChild

      public void addChild(String text, TextGroupElement.Position position)
      Add a child text element.
      Parameters:
      text - the child text to add
      position - the position of the child relative to this parent
    • addChild

      public void addChild(String text, String subscript, TextGroupElement.Position position)
      Add a child text element with a subscript.
      Parameters:
      text - the child text to add
      subscript - a subscript for the child
      position - the position of the child relative to the parent
    • accept

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