Element: Valve.

Icon: 

Text: A two-dimensional valve.

Description: A Valve is a two-dimensional drawing element that draws a valve with an optional display of a value (which represents how much open the valve is). Interaction includes positioning and changing the displayed value.


Continuous valve connecting two pipes and three other types of valves.

Table of properties

Name Description Values accepted
Position and Size
X The X coordinate of the base position of the element. Any constant or variable of type double or int.
Y The Y coordinate of the base position of the element. Any constant or variable of type double or int.
Size X The size of the element in the X direction. Any constant or variable of type double or int.
Size Y The size of the element in the Y direction. Any constant or variable of type double or int.
Angle 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.

Value

Value The value displayed by the valve. Any constant or variable of type double or int.
Show Value Whether to display the value. A boolean variable or one of the constants true or false.
Increment The base increment used to change the value when dragging on it. Any constant or variable of type double or int.
Format The format for the visualization of the value. Any value acepted by the class java.text.DecimalFormat. See additional info. The default format is 0.000.
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.

Color The color used to draw the value. 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.

Input

Enabled Whether the displayed value can be changed interactively. A boolean variable or one of the constants true or false.
Movable Whether the element can be repositioned. A boolean variable or one of the constants true or false.
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
Type The graphical shape used to display the element. One of the following constants:
  • CONTINUOUS. A continuous valve with two ends. (Equivalent integer: 0)
  • DISCRETE. A discrete valve with two ends. (Equivalent integer: 1)
  • TRIPLE_CONTINUOUS. A continuous valve with three ends. (Equivalent integer: 10)
  • TRIPLE_DISCRETE. A discrete valve with three ends. (Equivalent integer: 11)

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

Filled Whether the element is filled with liquid. A boolean variable or one of the constants true or false.
Line Color The color used for the lines of 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.

Stroke The thickness for the lines of the element. Any constant or variable of type double or int. The default value is 1.

Object variables of the class  java.awt.Stroke are also accepted.

Fill Color The color used for the liquid inside the valve.

See the values for the Line Color property.

Handle Color The color used to fill the handle of the valve.

See the values for the Line Color property.