Expressions are used to customize the format and value of a parameter. For example, you can use an expression to do the following to an object:
An expression can be set on any attribute contained in a symbol. To use an expression on an object, do the following:
As you rotate the mouse over the symbol, the Text label is updated to show the angle of rotation.
Expressions can combine other expressions, model attributes and string literals. For example, the following expression prints the integer value of a parameter in a string.
Name |
Description |
Example |
parameter |
Any parameter in the symbol |
@rotate |
rotationValue |
Calculates the rotation angle |
rotationValue(@rotate) |
int |
Casts the parameter to an Integer |
int(@rotate&100) |
decimalFormat |
Reformats a parameter value. See java.text.DecimalFormat for more information. |
decimalFormat("#.#", pi) -> 3.1 |
childrenCount |
Returns the number of child objects below this object |
childrenCount()=0 |
simpleDateFormat |
Formats a date. See java.text.SimpleDateFormat for more information. |
simpleDateFormat("MM/dd/yyyy",@date)
This will give: 10/01/2001 |
long |
Casts to a long value |
long(@val1+@val2) |
double |
Casts to a double value |
double(@value*3) |
messageFormat |
Formats different strings to a specific message format. See java.text.MessageFormat for more information. |
messageFormat('{0}: {1,number,#.##}','result',44.2874)
This will give: 44.28" |
blinkingColor |
Specifies 2 different colors to alternate for a graphic object |
blinkingColor(green,yellow) |
concat |
Concatenation for String parameters |
concat("result is:",@result) |
float |
Casts parameter to a float value |
float(cos(@value)) |
abs |
Absolute value of the parameter |
See java.lang.Math |
acos |
Returns the arc cosine of an angle, in the range of 0.0 through pi |
See java.lang.Math |
asin |
Returns the arc sine of an angle, in the range of -pi/2 through pi/2 |
See java.lang.Math |
atan |
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2 |
See java.lang.Math |
ceil |
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer |
See java.lang.Math |
tan |
Returns the trigonometric tangent of an angle |
See java.lang.Math |
cos |
Returns the trigonometric cosine of an angle. Special cases: |
See java.lang.Math |
exp |
Returns Euler's number e raised to the power of a double value |
See java.lang.Math |
floor |
Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a mathematical integer |
See java.lang.Math |
log |
Returns the natural logarithm (base e) of a double value |
See java.lang.Math |
rint |
Returns the double value that is closest in value to the argument and is equal to a mathematical integer |
See java.lang.Math |
sin |
Returns the trigonometric sine of an angle |
See java.lang.Math |
sqrt |
Returns the correctly rounded positive square root of a double value |
See java.lang.Math |
tan |
Returns the trigonometric tangent of an angle |
See java.lang.Math |