Element: Text.

Icon: 

Text: An interactive string.

Description: A Text is a drawing element that displays a string at given coordinates of the parent drawing panel. The string is drawn with the specified font.

Texts admit subscripts and superscripts, as well as greek letters. Thus, setting the text to F_{N} = m$\omega$^{2}R  results in the following display.

Texts respond to user interaction on their position coordinates (changing their position), invoking up to three different actions. The precise drawing position of the geometrical shape with respect to the given coordinates can be chosen among several standard values.

Table of properties

Name Description Values accepted
Position and Size
X The X coordinate of the element. Any constant or variable of type double or int.
Y The Y coordinate of the element. Any constant or variable of type double or int.
Z The Z coordinate of the element. Any constant or variable of type double or int.

Visibility and Interaction

Visible The visibility of the element. A boolean variable or one of the constants true or false.
Enabled Whether the element responds to user interaction. A boolean variable or one of the constants true or false.

Actions

On Press The action to invoke when the element is pressed. The Java code to invoke for the action. 
On Drag The action to invoke when the element is moved. The Java code to invoke for the action. 
On Release The action to invoke when the element is released. The Java code to invoke for the action. 
On Enter The action to invoke when the pointer enters the element. The Java code to invoke for the action. 
On Exit The action to invoke when the pointer leaves the element. The Java code to invoke for the action. 
Graphical Aspect
Text The string with the text to draw. Any constant or variable of type String.
Position The exact drawing position of the string relative to the element's coordinates. One of the following constants:
  • CENTERED. The shape is drawn with its center point on the element's coordinates. (Equivalent integer: 0).
  • NORTH. The shape is drawn with its top middle point on the element's coordinates. (Equivalent integer: 1).
  • SOUTH. The shape is drawn with its bottom middle point on the element's coordinates.  (Equivalent integer: 2).
  • EAST. The shape is drawn with its middle right point on the element's coordinates. (Equivalent integer: 3).
  • WEST. The shape is drawn with its middle left point on the element's coordinates.(Equivalent integer: 4).
  • NORTH_EAST. The shape is drawn with its top right point on the element's coordinates. (Equivalent integer: 5).
  • NORTH_WEST. The shape is drawn with its top left point on the element's coordinates. (Equivalent integer: 6).
  • SOUTH_EAST. The shape is drawn with its bottom right point on the element's coordinates. (Equivalent integer: 7).
  • SOUTH_WEST. The shape is drawn with its bottom left point on the element's coordinates. (Equivalent integer: 8).

Integer constants and variables are also accepted, using any of the values indicated in the parentheses above. This allows changing the position in run-time.

Rotate The (counter-clockwise) rotation angle to apply to the element. A constant or variable of type double for an angle in radians, or a constant or variable of type int for an angle in degrees.
Color The color used to draw the element. An Object variable of the class java.awt.Color or one of the predefined colors: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow.

A color can also be specified providing its integer RGB coordinates (between 0 and 255), plus an optional transparency coordinate.

The default value is decided by the system.

Font The font used for the text displayed by the element. An Object variable of the class java.awt.Font or a set of family, style and size, separated by commas. The style must be one of  plain, bold, italic, bold | italic. Example: Monospaced,italic,18.

The default value is decided by the system.