Show in Frame No Frame
Up Previous Next Title Page Index Contents Search

3.2.1 Rectangle

Rectangle elements are used for filled and unfilled rectangles and rounded rectangles.

To create a rectangle:
1)Press the Rectangle button in the toolbar.
2)Move the cursor in the drawing area to where you want a corner of the rectangle to be.
3)Press and hold down the left mouse button, drag the cursor into the point where you want to place the opposite corner, and release the mouse button.

The resulting rectangle is displayed in the drawing area. You can drag the yellow handle at the top-left corner towards the center of the rectangle to round the corners of the rectangle.

The default formatting for rectangle is solid, black 1 pixel line and white fill. To change the formatting, select the rectangle, press the right mouse button to open its pop-up menu, and then select Format... from the menu. Double-clicking the rectangle or pressing Enter when it is selected will achieve the same result. A Format Dialog as shown in Figure 3–5 will open.

Line and Fill dialog

Figure 3–5. Format Dialog for line shape.

There are three tabs in the dialog. The first one, Line and Fill (as shown in Figure 3–5), enables you to change the color, style and weight of the line of the rectangle, and the fill color inside the rectangle. You can pick the line color from the Color pull-down list. If there is no suitable color available in the pre-defined color palette, choose Select a New Color... and define the color of your choice in the dialog that opens (Figure 3–6). Select a color by clicking a colored square, using the sliders on the top and the right or entering the values in HSV, RGG or HTML fields, and press OK.

Select Color

Figure 3–6. Selecting color.

The line widths from hairline to 10 pixels can be chosen from the Weight menu. The line style (dotted, dashed etc.) can be set from the Style menu.

The second tab in the Format Dialog, Position and Size, contains the values for the position, size and scale of the element (Figure 3–7). You can change these freely either by entering new values into the fields or by using the spin buttons next to the fields. If you want the element to retain its original aspect ratio when you are changing size or scale, check the Lock aspect ratio box.

Position and Size dialog

Figure 3–7. Format Dialog for shape’s position and size.

The final tab, Condition, controls the visibility of the symbol element (Figure 3–8). All elements except Connectables can have a condition that must be met for the element to be displayed.

Condition

Figure 3–8. Condition dialog.

The conditions are matched against either property values or generator outputs and the matching is done with plain strings or regular expressions. The condition source is defined on the top part of the Condition tab. For property condition source, check the Property radio button and select the source property from the pull-down list next to it (the menu includes all the property types defined for symbol’s non-property type). For generator source, check the Generator radio button and enter the MERL code for the generator body (no name or header) into the text field next to it (for more information about defining generators, see Section 5). Checking the Generator radio button will enable the Editor button – pressing this button will open the Generator Editor for editing the MERL code for the generator.

The symbol element will be shown if the value of the selected property or the output of the generator matches the condition string or regular expression that is entered in the Condition text box in the lower part of the dialog. The type of the required match, either String or RegExp, is defined by checking the appropriate radio button and selecting the desired match operator from the accompanying pull-down list. The possible match operators for String are = (exact comparison), =~ (wildcard comparison), <>, <, >, <= and >=; and for RegExp = and <>. In String wildcard comparisons # (any single character) and * (0 or more characters) can be used. More complex partial matches can be done with regular expressions. For more information about how to use regular expression, see Appendix A: Regular expressions.

When using Boolean properties as the condition source, note that you should compare to T for Boolean value true and F for false (i.e. checkbox checked and not checked).

To remove a condition completely, press the Clear button.

Show in Frame No Frame
Up Previous Next Title Page Index Contents Search