Element: Polygon.
Icon:
Text: An interactive curve or polygon.
Description: A Polygon is a drawing element that draws a poligonal curve specified by the coordinates of their vertices points. If the "Closed" property holds the value true, then the points are taken as the vertices of a closed polygon.
The vertices of the polygon (or of the curve) respond to user interaction either moving the whole polygon (default behavior) or resizing it (property "Resizable"), invoking up to three different actions.
Table of properties |
||
Name | Description | Values accepted |
Input | ||
Points | The number of vertices of the polygon. | 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. |
Z | The Z 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. |
Position Z | The Z 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. |
Size Z | The size of the element in the Z direction. | 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. |
Movable | Whether the element moves when the user drags its points. | A boolean variable or one of the constants true or false. |
Resizable | Whether the coordinates of the vertices can be changed interactively. | 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):
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 polygons or curves. | A unidimensional array of type boolean with the correct number of points (as indicated by the Points property), with one value for each element. |
Closed | Whether the set of vertices corresponds to a closed polygon. | A boolean variable or one of the constants true or false. |
Fixed Corners | Whether one or more vertex resize or not when being dragged (if the Resizable property is also true). | A constant or variable of type int.
That vertex won't resize.
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 element. The special value null draws an empty 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. |
Line Color | The color used for the lines of the element. The special value null draws the element without an edge. | See the values for the Fill Color property. |
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. |