Customizing the metamodel : Specifying the display of values on symbols : Syntax of the DISPLAY command
  
Syntax of the DISPLAY command
There is a limit of eight display statements for one definition. The syntax of the DISPLAY command is as follows:
DISPLAY { FORMAT [ STRING | LIST | KEY | NONKEY |
COMPONENT_SCRIPT | COLUMN_SCRIPT | SCRIPT ] LEGEND " (how the block is labeled in the symbol) " }
STRING
This is the default. It causes the values of the property to appear on the symbol exactly as they are typed. This choice is a good one if you want comments to be displayed.
LIST
Causes items to be displayed on the symbol in a list. Each whitespace character causes a new line, unless the whitespace falls within double quotes.
KEY
Use this keyword for properties designated as keys. They are displayed in a separate section of the symbol. See the KEY keyword for an example.
NONKEY
You may use this keyword for non-key properties. They will be displayed in a separate section of the symbol. This keyword was originally used for entities and tables in System Architect's data modeling support. See the NONKEY keyword for an example.
COMPONENT_SCRIPT
Calls a script that displays the property value on the symbol in a special format, devised by the script. The script itself is either hard-coded in the product, or written by the user using System Architect Basic language. By convention, the script itself is named with one of the following prefixes:
fmtxxx
The function itself exists in hard code and cannot be modified. Most functions in SAPROPS.CFG are this way. Hard-coding the function is done to make System Architect's overall response faster.
_fmtxxx
Exists in the fmtscript.bas file within System Architect’s main executable directory, and is coded using SA Basic.
The component scripts are used for ListOf and ExpressionOf properties. The action taken by the script works against each item in the list. For example, a Component Script is used to look at each class attribute in a class definition, and construct how it will be displayed on the class symbol: providing a - (hyphen) before the name if the attribute’s access property is set to private, or + (plus sign) if it is public, and displaying the attribute's return type after the attribute name, preceded by a colon. Similarly, a Component Script constructs the way a method is displayed, with + (plus sign) preceding the name if its access is public, and - (hyphen) if its access is private, and in addition displays its parameters and their type in parenthesis after the method’s name.
For more information, see COMPONENT_SCRIPT and SCRIPT.
COLUMN_SCRIPT
Works like COMPONENT_SCRIPT, calling a script to apply a special formatting to a property value displayed on a symbol. The script is either a hard-coded script or one written by the user using SA Basic (and placed in the fmtscript.bas file within System Architect's main executable directory). The column scripts are used for displaying columns in table symbols in a physical data model. The action taken by the script works against each column in the list. See COLUMN_SCRIPT for more information.
SCRIPT
Works like COLUMN_SCRIPT and COMPONENT_SCRIPT, calling a script to apply a special formatting to a property value displayed on a symbol. The SCRIPT command calls scripts used for properties that are neither ListOf nor ExpressionOf. The script itself is either a hard-coded script or one written by the user using SA Basic (and placed in the fmtscript.bas file within System Architect's main executable directory). See the SCRIPT keyword for more information.
LEGEND
Each property group that is displayed is separated from each other by a dividing line. You can specify a label, or “legend” to appear on the dividing line, using the LEGEND command. If a LEGEND is not supplied, the property name itself is the label. The following LEGEND commands are available:
LEGEND "<Your Text>"f
Whatever text you place in the quotation marks will be displayed on the symbol above the entry, only if there is a value for the entry.
LEGEND ""
Displays a straight line without any words, only if there is a value for the entry.
LEGEND "$$FORCE$$"
Displays a horizontal line above the entry on the symbol. This line acts as a divider. The "$$FORCE$$" keyword is different than simply using " ", in that it forces display of a horizontal line even if the property display is suppressed through the display mode dialog.
LEGEND "$$NONE$$"
Does not display a horizontal line above the entry on the symbol, whether or not there are values for the entry. This line normally acts as a divider.
LEGEND "$$VFORCE$$"
Enables you lay out properties from left to right inside symbols, and draws vertical lines between them.
See VFORCE keyword for the example USRPROPS.TXT that creates the picture above.
LEGEND "$$VNONE$$"
Enables you to lay out properties from left to right, but does not provide a dividing line. See VNONE keyword for an example.
Set the font of the legends by using Format > Diagram Format > Notation.
Example
In the following example, we specify a new diagram type, new symbol type, and new definition type. We specify that the new symbol type is defined by the new definition type, and assign the new symbol type to the new diagram type. We create a property for the definition, called “My Important Property”. We specify that the legend “My Important Property Displayed” should be displayed on the symbol on the dividing line above the displayed value.
RENAME DIAGRAM "User 1" TO "My Diagram"
RENAME SYMBOL "User 1" TO "My Symbol 1"
SYMBOL "My Symbol 1"
{
DEFINED BY "My Definition 3"
ASSIGN TO "My Diagram"
}
DEFINITION "My Definition 3"
{
PROPERTY "My Important Property" { EDIT Text Length 20 DISPLAY { FORMAT String LEGEND "My Important Property Displayed" }}
}
The figure below shows a subsequent symbol drawn on such a diagram, and the displayed value typed into the property field.
Line symbol with properties displayed and not displayed