Chemical Data Processing Library Python API - Version 1.1.1
Public Member Functions | Properties | List of all members
CDPL.Vis.TextLabelPrimitive2D Class Reference

A graphics primitive representing a text label. More...

+ Inheritance diagram for CDPL.Vis.TextLabelPrimitive2D:

Public Member Functions

None __init__ ()
 Construct an empty text label primitive at position (0, 0).
 
None __init__ (TextLabelPrimitive2D prim)
 Initializes a copy of the TextLabelPrimitive2D instance prim. More...
 
TextLabelPrimitive2D assign (TextLabelPrimitive2D prim)
 Replaces the current state of self with a copy of the state of the TextLabelPrimitive2D instance prim. More...
 
None setText (str txt)
 Sets the text of the label. More...
 
str getText ()
 Returns the text of the label. More...
 
None setPosition (Math.Vector2D pos)
 Sets the position of the text label. More...
 
None setPosition (float x, float y)
 Sets the position of the text label to (x, y). More...
 
Math.Vector2D getPosition ()
 Returns the position of the text label. More...
 
None setPen (Pen pen)
 Sets the pen defining the color of the text label. More...
 
Pen getPen ()
 Returns the pen defining the color of the text label. More...
 
None setFont (Font font)
 Sets the font of the text label. More...
 
Font getFont ()
 Returns the font of the text label. More...
 
- Public Member Functions inherited from CDPL.Vis.GraphicsPrimitive2D
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None render (Renderer2D renderer)
 Visualizes the graphics primitive by means of the Renderer2D instance renderer. More...
 
None getBounds (Rectangle2D bounds, FontMetrics font_metrics=0)
 Calculates the bounds of the graphics primitive. More...
 
GraphicsPrimitive2D clone ()
 Creates a dynamically allocated copy of the graphics primitive. More...
 

Properties

 text = property(getText, setText)
 
 position = property(getPosition, setPosition)
 
 pen = property(getPen, setPen)
 
 font = property(getFont, setFont)
 
- Properties inherited from CDPL.Vis.GraphicsPrimitive2D
 objectID = property(getObjectID)
 

Detailed Description

A graphics primitive representing a text label.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Vis.TextLabelPrimitive2D.__init__ ( TextLabelPrimitive2D  prim)

Initializes a copy of the TextLabelPrimitive2D instance prim.

Parameters
primThe TextLabelPrimitive2D instance to copy.

Member Function Documentation

◆ assign()

TextLabelPrimitive2D CDPL.Vis.TextLabelPrimitive2D.assign ( TextLabelPrimitive2D  prim)

Replaces the current state of self with a copy of the state of the TextLabelPrimitive2D instance prim.

Parameters
primThe TextLabelPrimitive2D instance to copy.
Returns
self

◆ setText()

None CDPL.Vis.TextLabelPrimitive2D.setText ( str  txt)

Sets the text of the label.

Parameters
txtThe text of the label.

◆ getText()

str CDPL.Vis.TextLabelPrimitive2D.getText ( )

Returns the text of the label.

Returns
The text of the label.

◆ setPosition() [1/2]

None CDPL.Vis.TextLabelPrimitive2D.setPosition ( Math.Vector2D  pos)

Sets the position of the text label.

Parameters
posThe baseline position of the text label.

◆ setPosition() [2/2]

None CDPL.Vis.TextLabelPrimitive2D.setPosition ( float  x,
float  y 
)

Sets the position of the text label to (x, y).

Parameters
xThe x-position of the text label.
yThe y-position of the baseline.

◆ getPosition()

Math.Vector2D CDPL.Vis.TextLabelPrimitive2D.getPosition ( )

Returns the position of the text label.

Returns
The position of the text label.

◆ setPen()

None CDPL.Vis.TextLabelPrimitive2D.setPen ( Pen  pen)

Sets the pen defining the color of the text label.

Parameters
penThe pen defining the color of the text label.

◆ getPen()

Pen CDPL.Vis.TextLabelPrimitive2D.getPen ( )

Returns the pen defining the color of the text label.

Returns
The pen defining the color of the text label.

◆ setFont()

None CDPL.Vis.TextLabelPrimitive2D.setFont ( Font  font)

Sets the font of the text label.

Parameters
fontThe font of the text label.

◆ getFont()

Font CDPL.Vis.TextLabelPrimitive2D.getFont ( )

Returns the font of the text label.

Returns
The font of the text label.