Element: Line.

Icon: 

Text: A two-dimensional control line.

Description: A Line is a two-dimensional drawing element that draws a line with possible diferent end points. The line can be positioned and resized interactively.


The different possibilities for the end points of a line.

Table of properties

Name Description Values accepted
Input
Points The number of vertex of the element. Minimum is 2. Any constant or variable of type int.
X The X coordinates of the vertices of the element. A unidimensional array of type double with the correct number of points (as indicated by the Points property), with one value for each element.
Alternatively, a constant or variable of type double or int, that sets the same value to all the elements of the set.
Y The Y coordinates of the vertices of the element. A unidimensional array of type double with the correct number of points (as indicated by the Points property), with one value for each element.
Alternatively, a constant or variable of type double or int, that sets the same value to all the elements of the set.
Position and Size
Position X The X coordinate of the base position of the element. Any constant or variable of type double or int.
Position 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.

Visibility and Interactivity

Visible Whether the element is visible. A boolean variable or one of the constants true or false.
Movable Whether the element moves as a whole when the user drags any of its vertex. A boolean variable or one of the constants true or false.
Resizable Whether the element resizes when the user drags any of its vertex. 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. 
Point Selected The index of the vertex affected by the interaction.. A variable of type int
Configuration
Start Type The type of decoration at the beginning of the line. One of the following constants. They correspond to the types shown in the picture above (from left to right, first row first):
  • PLAIN. No decoration. (Equivalent integer: 0).
  • CIRCLE. A hollow circle. (Equivalent integer: 1).
  • DIAMOND. A hollow diamond. (Equivalent integer: 2).
  • SQUARE. A hollow square.(Equivalent integer: 3).
  • ARROW. A hollow arrow head.(Equivalent integer: 4).
  • LINE. A prependicular line. (Equivalent integer: 5).
  • FILLED_CIRCLE. A filled circle. (Equivalent integer: 6).
  • FILLED_DIAMOND. A filled diamond. (Equivalent integer: 7).
  • FILLED_SQUARE. A filled square.(Equivalent integer: 8).
  • FILLED_ARROW. A filled arrow head.(Equivalent integer: 9).

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

Start Size The size of the decoration at the beginning of the line. Any constant or variable of type double or int.
End Type The type of decoration at the end of the line. See the values for the Start Type property.
End Size The size of the decoration at the end of the line. Any constant or variable of type double or int.
Neumatic Line If different from zero, a dash of the given size is drawn at each segment of the line. The sign decides the direction of the dash. Any constant or variable of type double or int.
Connected An array of booleans that set whether each point is connected with the previous one. This allows the creation of disconnected lines. A unidimensional array of type boolean with the correct number of points (as indicated by the Points property), with one value for each element.
Graphical Aspect
Fill Color The color used to fill the decorations.

See the values for the Line Color property.

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.