Display Element/Connector Properties
A common component of a customized shape is a text string, which can include the name and value of one of the properties of the element or connector. To display the text, you use one of the commands:
These all take a string parameter representing the text to be displayed. The element or connector property can be added to the text using the substitution macro #<propertyname>#; for example:
println("name: #NAME#");
You can display several properties by issuing the commands several times, once for each property. The element and connector properties you can display are listed below. Additionally, you can display Tagged Values by prefixing the tag name with TAG, as shown:
print("#TAG:condition#");
You can also test for and display an element's custom properties in the same way as you do the system-named properties; for example:
if(hasproperty("Name","Value"))
...
and:
print("#Name#");
Properties for Element Shape Scripts
· | addin - returns a value from an invoked Add-In function; syntax:
addin:<addin_name>, <function_name>, <parameter> [, <parameter> ...]
Note that in the hasproperty() argument, Enterprise Architect requires the hash characters for addin values:
if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) {
|
· | incomingedge (returns "none", "left", "right", "top", "bottom", or "multiple") |
· | outgoingedge (returns "none", "left", "right", "top", "bottom", or "multiple") |
· | parentedge ("right", "left", "top", "bottom") |
· | partition (returns "vertical" or "horizontal") |
· | showcomposeddiagram (returns "true" or "false") |
Properties for Connector Shape Scripts
· | addin - returns a value from an invoked Add-In function; syntax:
addin:<addin_name>, <function_name>, <parameter> [, <parameter> ...]
Note that in the hasproperty() argument, Enterprise Architect requires the hash characters for addin values:
if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) {
|
· | diagram.connectornotation |
· | rotationdirection ("up", "down", "left", "right") |
· | source.element.stereotype |
· | source.multiplicityisordered |
· | target.element.stereotype |
· | target.multiplicityisordered |
Learn more
The material ("material" includes all pages, documents and on-line graphics) on this web site is protected by copyright law. (C) 1998-2015 Sparx Systems Pty Ltd.