ReferenceregularPolygon (Page 2)

<regularPolygon>

<regularPolygon> is a Graphical component that renders a regular polygon on a <graph>.

Examples Page 2

Attribute Example: area

The area attribute can be used to adjust the size of the regular polygon. (Note that the vertices attribute takes precedence in the case of overconstraint.)


Attribute Example: verticesDraggable

Vertices are draggable by default. Use the verticesDraggable attribute set to false to disable users from changing the size and rotation of the <regularPolygon>. The polygon as a whole can still be repositioned on the <graph>.


Attribute Example: fixed / fixLocation

This example illustrates the difference between the fixed and the fixLocation attributes. If an object is fixed it cannot be moved or changed in any way. The styleNumber, hide, and filled attributes, for example, cannot be changed or updated. This is why the <updateValue> button for polygon B is ineffective.

With fixLocation, by contrast, the object cannot be moved or resized (i.e. it automatically makes vertices not draggable), but other characteristics of the object can still be changed.


Attribute Example: Standard graphical attributes

The uses of the following standard graphical attributes are illustrated: hide, draggable, layer, styleNumber, applyStyleToLabel and labelIsName.

Layers: By adjusting the layer attribute number, geometry can be placed in front of or behind other geometry. The default layer number is 0; all higher numbers are placed in front. Due to the fact that the default styleNumbers all involve a degree of transparency, this distinction may not be readily visible.


Property Example: Attributes as properties

The above-listed attributes of the <regularPolygon> component are also accessible as properties.


Property Example: vertices

The vertices property stores/renders all the computed vertices of the regular polygon in an array. Array notation can be used to access an individual vertex or a coordinate of a vertex.


Property Example: Style properties

The styleDescription, styleDescriptionWithNoun, fillStyleDescription, and borderStyleDescription properties render a text description corresponding to the styleNumber of the component.