The Astah Legend Plug-in enhances your modeling tool experience by seamlessly incorporating legend capabilities. The plugin enables coloring of diagram elements based on rules described in Groovy language.
Astah Legend is an innovative plugin designed to enhance your diagramming experience in Astah SysML and Astah System Safety by seamlessly incorporating legend capabilities. The plugin enables coloring of diagram elements based on rules described in Groovy language to make your diagrams more informative and easier to understand.
Features:
Reset, load, and save Legends in YAML format
Visual attributes for legends and legend items
Easy legend item management with add, remove, modify, and reorder options
In Astah, navigate to [Plugin] -> [Installed Plugins].
In the dialogue box, click [Install], then select the downloaded .jar file.
Restart Astah and either start a new project or open an existing file.
The installation is successful if you see the [Legend] tab beneath the diagram editor.
How to use:
1. Creating Legend:
Open [Legend] and enter legend name
Modify legend style by pressing the Configure button. The style will be used in the diagram when you apply the configured legends to the diagram.
2. Creating Legend Items:
Open [Legend items] tab
Click [Add] button to add a legend item
A new legend item will be added. Double-click it or click [Edit] button to edit the legend item, set name, colors, and script
Once you created all the legend items, click [Apply on diagram] button. The presentation of the model elements will be updated based on the specific criteria.
Script rules
The script should be written in Groovy.
It is required to output a boolean value (true or false).
A true result signifies that the legend item will be applied, while false indicates that the legend item will not be applied.
If the Elements only checkbox is selected, the script will not be executed for presentation elements lacking a corresponding model element (e.g., line, rectangle, image).
The script receives two variables:
presentation: represents the presentation element (of type IPresentation).
element: represents a model element referenced by the presentation element (of type IElement).
Example usage: “Test”.equals(element.name). This condition will color each element on the diagram whose name equals “Test”.
Go to [Legend] tab and press [Save] button to save all the configured Legend items.
It will be saved as .yaml file.
You can distribute this .yaml file to your team members to apply the configured legends on their environment by selecting the distributed .yaml file from [Open] menu.