Auto-layout of GSN


With Astah Script Plug-in, you can automatically lay out the GSN nicely. This feature is very useful at the finish-up.
(Added on Jan.11,2018 : this feature is now included in Astah GSN version 1.1 released in 2015/06/24)

(1) Download the script from here.

(2) Unzip the downloaded file and save this layoutGSN.js file.

(3) Launch Astah GSN and go to [Tool] – [Script]. (To add this menu, you need to install Script plug-in first.)
Astah_Script_Open_Window

(4) A [Script] window opens. Select [Script] – [Open], and select the .js file you downloaded at step (2) .
Astah_Script_Window2

(5) Script appears in the window above, click [Action] – [Run] or click the [Play] button in red box below.
Astah_Script_Plugin3

(6) Then GSN should automatically be shaped nicely!


smarter2 Warning

This script is available for Astah GSN version 1.0.
With Astah GSN Version 1.1, we updated required Java version to 8 from 7. The sample script provided here works only on Astah with Java7 (Astah GSN ver1.0). To enable this script with newer version, you need to modify the scripts guided as below.

importPackage

There are three ways to do so:

Before
importPackage(com.change_vision.jude.api.inf.editor);
//use the classes in the package
After

1. Use JavaImporter

with(new JavaImporter(com.change_vision.jude.api.inf.editor)) {
//use the classes in the package
}

2. Load “nashorn:mozilla_compat.js”

load("nashorn:mozilla_compat.js");
importPackage(com.change_vision.jude.api.inf.editor);
//use the classes in the package

3. Use Java.type

var TransactionManager = Java.type("com.change_vision.jude.api.inf.editor.TransactionManager");
//use the class

println

There are two ways to do so:

Before
println("astah*");
After

1. Replace “println” with “print”

print("astah*");

2. Add println=print;

println = print;
println("astah*");

smarter2 Other script you can use in Astah GSN

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s