1.0.4
astah* community, UML, and professional 6.5.x 以降 astah* SysML 1.2以降, astah* GSN 1.0以降
astah*: http://astah.change-vision.com/ja/
スクリプト言語でastah*にアクセスできます。ECMAScript(JavaScript)の編集と実行が可能です。
(※astah* GSNのみ、インストール方法が異なります)
-
Downloadから zipファイルをダウンロードし、任意のフォルダへ展開し、jarファイルを以下のpluginsフォルダに保存します。
例) Astah Professional, Windows:
$USER_HOME/.astah/professional/plugins/
,C:¥Program Files¥astah-professional¥plugins¥
Astah Professional, Mac OS X:/Applications/astah professional/plugins/
例) Astah Community, Windows:
$USER_HOME/.astah/community/plugins/
,C:¥Program Files¥astah-community¥plugins¥
Astah Community, Mac OS X:/Applications/astah community/plugins/
例) Astah SysML, Windows:
$USER_HOME/.astah/sysml/plugins/
,C:¥Program Files¥astah-sysml¥plugins¥
Astah SysML, Mac OS X:/Applications/astah sysml/plugins/
-
Astahを起動します。
-
上部メニュー[ツール]配下に [スクリプト]が追加されています。
- Astahを起動し、スクリプトを実行したいプロジェクトファイル(.asta)を開きます。
- Astah上部メニュー[ツール]-[スクリプト]を選択すると、新規スクリプトダイアログが開きます。
- 上段にスクリプトを入力するか、またはスクリプトダイアログのメニュー[ファイル]-[開く]を選択し、予め用意しておいたJavaScriptのファイルを開きます。
サンプルスクリプトは後者の方法でお試しください。 - スクリプトダイアログのメニュー[アクション]-[実行]を選択します。(ショートカットキー [Ctrl+R]でも実行できます)
- 下段に結果が表示されます。
- 上段に入力したスクリプトは [ファイル]-[名前を付けて保存]で保存できます。
sample_scripts
フォルダには、合計15ケのJavaScriptサンプルファイルが格納されています。
- addSetterGetter.js
- addStereotypeToSelectedModel.js
- checkEdition.js
- countClasses.js
- createAndOpenDiagram.js
- createEREntities.js
- exportCsv.js
- printClasses.js
- printERIndex.js
- printMindmapTopics.js
- printPackageAndClassInfo.js
- printPresentationProperties.js
- searchAndEdit.js
- searchMessagesWithoutOperation.js
- useJavaGUI.js
例) JavaScript: printClasses.js
with(new JavaImporter(
com.change_vision.jude.api.inf.model)) {
classes = astah.findElements(IClass.class);
for(var i in classes) {
print(classes[i].getName());
}
}
- 定義済みの変数を使えます。
projectAccessor
- Astah APIのProjectAccessorのオブジェクトです。
null
if Astah has no project.
astah
projectAccessor
と同じです。
astahWindow
- Astahメインウィンドウオブジェクトです。
scriptWindow
- スクリプトプラグインのウィンドウオブジェクトです。
- スクリプトで Astah APIを使えます。
- Astah API 概要
- Astah API 利用ガイド (Javadoc)
- スクリプトでJava APIを使えます。
- Astah Plug-in SDKをインストールします。 - http://astah.change-vision.com/ja/plugins.html
git clone git://github.com/ChangeVision/astah-script-plugin.git
cd script
astah-build
astah-launch
-
Generating config to load classpath for Eclipse
astah-mvn eclipse:eclipse
OSGi JSR223準拠の他のスクリプト言語を使用できます。
- 使用したいスクリプト言語の jarファイルをダウンロードします。(例. groovy-all.jar, jruby-###.jar)
- Astah plugins フォルダに 1のjarファイルをコピーします。(‾/.astah/plugins)
- Astahを起動します
Copyright 2015 Change Vision, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- RSyntaxTextArea is licensed under modified BSD License. Please see the included license file.
- AutoComplete is licensed under modified BSD License. Please see the included license file.