Class 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
    • Constructor Detail

      • 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 Detail

      • 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