Astah Legend Plug-in

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.

Details

Compatible with
Latest Version
1.0.1 (January 29, 2024)
Support

 

Plugin Overview:

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.
Legend Plugin in Astah

 

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
  • Scripting capability in Groovy
  • Quick edit with double-click
  • Automatic color assignment for new items
colorful divider

 

Installation Instructions:

  1. Download the latest .jar from the release page.
  2. In Astah, navigate to [Plugin] -> [Installed Plugins].
  3. In the dialogue box, click [Install], then select the downloaded .jar file.
  4. Restart Astah and either start a new project or open an existing file.
  5. The installation is successful if you see the [Legend] tab beneath the diagram editor.
    Legend Plugin installed in Astah SysML

 

colorful divider

 

How to use:

1. Creating Legend:

  1. Open [Legend] and enter legend name
    Legend Creation in Astah
  2.   

  3. 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.Legend Configuration Sample

 

2. Creating Legend Items:

  1. Open [Legend items] tab
  2.  

  3. Click [Add] button to add a legend item
    Create Legend Items
  4. A new legend item will be added. Double-click it or click [Edit] button to edit the legend item, set name, colors, and script
    Edit Legend Items
  5.  

  6. 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.
    Applying Legend
  7.  

 

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:
    1. presentation: represents the presentation element (of type IPresentation).
    2. 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”.
  • For the latest rules, please refer to the developer’s documentation.
  • For sample scripts, please refer to this page.

 

4. Saving the Legends:

Go to [Legend] tab and press [Save] button to save all the configured Legend items.
Saving Legends

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.

Back to Plugin List

What are you looking for?