Repository navigation
Home
![[Japanese] Script plugin sample](https://github.com/downloads/ChangeVision/astah-script-plugin/script_dialog_ja.png)
0.9.0
Astah Community, UML, and Professional 6.5.x 以降
サンプルスクリプトの一部は、Astah UML、Astah Professionalのみで利用可能。
Astah: http://astah.change-vision.com/ja/
スクリプト言語でAstahにアクセスできます。ECMAScript(Javascript)の編集と実行が可能です。
-
Downloadから zipファイルをダウンロードし、任意のフォルダへ展開します。
-
pluginsフォルダにある "script-x.x.x.jar"ファイルを、Astahのインストールフォルダにある"plugins"フォルダに配置します。
例) Astah Professional, Windows: $USER_HOME/.astah/professional/plugins/, C:\Program Files\astah-professional\plugins\
Astah Professional, Mac OS X: /Applications/astah professional/plguins/例) Astah Community, Windows: $USER_HOME/.astah/community/plugins/, C:\Program Files\astah-community\plugins\
Astah Community, Mac OS X: /Applications/astah community/plguins/ -
Astahを起動します。
-
上部メニュー[ツール]配下に [スクリプト]が追加されています。
![[Japanese] Script Plugin Sample](https://github.com/downloads/ChangeVision/astah-script-plugin/script_plugin_menu_ja.png)
- Astahを起動し、スクリプトを実行したいプロジェクトファイル(.asta)を開きます。
- Astah上部メニュー[ツール]-[スクリプト]を選択すると、新規スクリプトダイアログが開きます。
- 上段にスクリプトを入力するか、またはスクリプトダイアログのメニュー[ファイル]-[開く]を選択し、予め用意しておいたJavaScriptのファイルを開きます。
サンプルスクリプトは後者の方法でお試しください。 - スクリプトダイアログのメニュー[アクション]-[実行]を選択します。(ショートカットキー [Ctrl+R]でも実行できます)
- 下段に結果が表示されます。
- 上段に入力したスクリプトは [ファイル]-[名前を付けて保存]で保存できます。
sample_scripts ディレクトリ(フォルダ)には、合計10ケのJavaScriptサンプルファイルが格納されています。
- addStereotypeToSelectedModel.js
- checkEdition.js
- countClasses.js
- createAndOpenDiagram.js
- exportCsv.js
- printClasses.js
- printMindmapTopics.js
- printPackageAndClassInfo.js
- searchAndEdit.js
- useJavaGUI.js
例) JavaScript: printClasses.js
importPackage(com.change_vision.jude.api.inf.model);
classes = astah.findElements(IClass);
for(var i in classes) {
println(classes[i].getName());
}- 定義済みの変数を使えます。
-
projectAccessor- It's an object of ProjectAccessor in Astah API.
-
nullif Astah has no project.
-
astah- It's same as
projectAccessor.
- It's same as
-
astahWindow- Astah メインウィンドウオブジェクト
-
scriptWindow- It's the window object of the script plugin.
-
- スクリプトで Astah APIを使えます。
- Astah API 概要
- Astah API 利用ガイド(Javadoc)
- スクリプトで Java APIを使えます。
- Astah Plug-in SDKをインストールします。http://astah.change-vision.com/ja/
git clone git://github.com/ChangeVision/astah-script-plugin.gitcd scriptastah-buildastah-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 2012 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.