Navigation
Synopsis Overview of all visual properties that apply to figures.
Types
  • FProperty
  • alias FProperties = list[FProperty];
  • alias computedInt = int();
  • alias computedReal = real();
  • alias computedNum = num();
  • alias computedStr = str();
  • alias computedColor = Color();
Description All figures may have an (optional) list of properties.

A property:
  • is represented by the type FProperty,
  • has a standard value, unless it is explicitly defined for a figure,
  • describes a property of the figure in which it is declared, but
  • the standard value of each property may be redefined for all figures that are contained in a figure.
Several properties have variants that act on one or two dimensions. We call them 2D properties and use the following naming scheme:
  • P(num xy) sets the value for property P in both dimensions to the same value xy.
  • P(num x, num y) sets the value for property P to distinct values x, respectively, y.
  • hP(num x) sets the horizontal value for property P to x.
  • vP(num y) sets the vertical value for property P to y.
The properties width and height are synonyms for hsize, respectively, vsize.

Most properties have typed arguments but they come in several versions:
  • A version with an argument of type int, real, num, str or Color. The values of these arguments are computed when the property is constructed, i.e., when the Figure is constructed.
  • A version with computed argument like computedInt, computedReal, computedNum, computedStr or computedColor. These are functions that return a value. These functions are called during the rendering of the figure to which this property is attached. In this way, properties can be changed.
Properties can be classified as follows: Most properties use dimensions that are relative to their parent or children. The exceptions are If the figure in which these properties occur is not resizable, then the given absolute values are respected. Otherwise they act as minimal value and may become larger in the resized figure.
Examples Just a few examples to show the spirit:
  • size(10, 20) sets the size property to 10 (horizontally), respectively 20 (vertically).
  • hsize(10) sets the hsize property to the value 10.
  • hsize(int(){return 10;}) sets the hsize property to the result of executing the argument function int(){return 10;} which is, indeed, not a big deal. This usage becomes more interesting when the argument function returns different values for each call.
  • fillColor("blue") sets the fill color of the current figure.
  • std(fillColor("blue")) sets the standard fill color for the current figure and for all of its children.
See the more detailed description of each property for examples.

The following table specifies which properties have an effect on which figures.

X box button checkbox combo computeFigure ellipse fswitch graph grid hvcat outline overlay packscaleSlider scrollable space text textfield tree
align2D X X X X X X X X X X X X X X X X X X
aspectRatio X X X X X X X X X X X X X X X X X
connect2D X X X X X X X X X X X X X X X X X X
endGap2D X
fillColor X X X X X X X X X X
font X X X X X X
unknown: Rascal:fontBaseline X
fontColor X X X X X X
fontBold X X X X X X
fontSize X X X X X X
fontItalic X X X X X X
gap2D X X X X X X X X
grow2D X X X X
hint X
ialign X X
id X X X X X X X X X X X X X X X X X X X
justify X
lineColor X X X X X X X
lineStyle X X X X X X X
lineWidth X X X X X X X
manhattan X
mouseOver X X X X X X X X X X X X X
onKeyDown X X X X X X X X X X X X X
onKeyUp X X X X X X X X X X X X X
onMouseDown X X X X X X X X X X X X X
onMouseUp X X X X X X X X X X X X X
onMouseUp X X X X X X X X X X X X X
orientation
resizable2D X X X X X X X X X X X X X X X X X X
shadow X X X X
shadowColor X X X X
shadowPos2D X X X X
shapeClosed X
shapeConnected X
shapeCurved X
shrink2D X X X X X X X X X X X X X X X X X X
size2D X X X X X X X X X X X X X X X X X X
startGap2D X
textAngle X
Benefits
  • Values of properties are defined by an inheritance-like approach: values can be nested and more nested declarations overrule more global ones. Default values can be set locally.
Pitfalls
  • As described above, each argument of a property may be specified in various manners. To avoid clutter, we only show the simplest version, but be aware that all versions are allowed.
  • A figure may inherit an undesired value for a property; the solution is to redeclare that property locally with the desired value.
[Edit] | [New Subconcept] | [Recompile Course] | [Warnings] 1 warning in this concept
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.