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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TextGroupElement.Child
A string of text that should be shown around the parent.static class
TextGroupElement.Position
Compass-point positions for text element annotation children.
-
Field Summary
Fields Modifier and Type Field Description List<TextGroupElement.Child>
children
The child text elements.-
Fields inherited from class org.openscience.cdk.renderer.elements.TextElement
color, text, xCoord, yCoord
-
-
Constructor Summary
Constructors Constructor Description TextGroupElement(double x, double y, String text, Color color)
Make a text group at (x, y) with the text and color given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(IRenderingVisitor v)
Converts thisTextElement
into widget specific objects.void
addChild(String text, String subscript, TextGroupElement.Position position)
Add a child text element with a subscript.void
addChild(String text, TextGroupElement.Position position)
Add a child text element.
-
-
-
Field Detail
-
children
public final List<TextGroupElement.Child> children
The child text elements.
-
-
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 texty
- the y-coordinate of the center of the texttext
- the text to rendercolor
- 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 addposition
- 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 addsubscript
- a subscript for the childposition
- the position of the child relative to the parent
-
accept
public void accept(IRenderingVisitor v)
Converts thisTextElement
into widget specific objects.- Specified by:
accept
in interfaceIRenderingElement
- Overrides:
accept
in classTextElement
- Parameters:
v
- Toolkit specific widget factory.
-
-