MarvinSketch 画面構成のカスタマイズ - サーバ側の設定

Customization ドキュメントでは、画面構成の対話的なカスタマイズ方法を紹介していますが、このドキュメントでは、MarvinSketchをサーバ上のappletJavaBeanとして使用する場合の画面構成のカスタマイズ方法について紹介します。

注: APIとXSDも近いうちに使用可能になる予定です。

configurationファイル

MarvinSketchは、画面構成に関する情報を、USER_HOME/CHEMAXON_DIR/VERSION/ にあるconfigurationファイルに保存しています。 ファイル保存場所の例:
Windows: C:\Documents and Settings\USERNAME\chemaxon\5.0.0\customization.xml
Unix/Linux: /home/USERNAME/.chemaxon/5.0.0/customization.xml

アプレットのカスタマイズ

  1. バックアップをとった後に、configurationファイルを削除します。
  2. MarvinSketchをクライアント側から起動します。
  3. Customization ドキュメントに記述されている方法を使用して、画面構成をカスタマイズします。
  4. 新しく作成されたconfigurationファイルをMarvinSketchアプレットのサーバ(例: http://example-server.org/marvin/customization.xml)にアップロードします。
  5. "menuconfig" applet parameter に、configurationファイルのURLを設定します。
    例:
    msketch_param("menuconfig", "http://example-server.org/marvin/configuration.xml");
    または
    msketch_param("menuconfig", "files/marvin/configuration.xml");

JavaBeanでのカスタマイズ

  1. バックアップをとった後に、configurationファイルを削除します。
  2. MarvinSketchをクライアント側から起動します。
  3. Customization ドキュメントに記述されている方法を使用して、画面構成をカスタマイズします。
  4. 新しく作成されたconfigurationファイルを、アプリケーションのclasspath内にコピーします。
  5. beanのインスタンス作成用に、UserSettingsを行います:
    
            UserSettings userSettings=new UserSettings();
            userSettings.tryToLoad();
            userSettings.put("menuconfig", "org/example/configuration.xml");
            MSketchPane sketchPane=new MSketchPane(userSettings);
            

例 1 : ISIS/Draw-like configuration をデフォルトの設定にする

Configurations ドキュメントでは、個人用の画面構成を定義するconfigurationを別途作成する方法について記述しています。
あるconfigurationをデフォルトの設定にする場合は、そのconfigurationに対応するidentifierをxmlファイル内で指定する必要があります。

使用できるconfigurationのidentifierは以下になります:

Configuration Identifier
Marvin default
Classic Marvin classic
ISIS/Draw-like config1
ChemDraw-like config2

configurationファイルの中身です:

    <?xml version="1.0" encoding="UTF-8"?>
    <customization active="config1">
    </customization>

例 2: 独自のツールパレットを作成する

この例では、以下のような独自の画面構成をconfigurationファイルに設定します:

画面構成の変更後は次のようになります:


configurationファイルは次のようになります:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <customization active="default">
      <scheme id="default">
        <modify path="toolbar/atoms/atom.N" visible="false"/>
        <modify path="toolbar/atoms/atom.S" visible="false"/>
        <modify path="toolbar/atoms/atom.F" visible="false"/>

        <modify path="toolbar/atoms/atom.P" visible="false"/>
        <modify path="toolbar/atoms/atom.Cl" visible="false"/>
        <modify path="toolbar/atoms/atom.I" visible="false"/>
        <add path="toolbar/atoms">
          <item id="increaseCharge"/>
          <item id="decreaseCharge"/>

        </add>
        <order itemorder="periodicSystem/atom.H/atom.C/atom.N/atom.O/atom.S/atom.F/atom.P/atom.Cl/atom.Br/atom.I/increaseCharge/decreaseCharge" path="toolbar/atoms"/>
        <modify index="1" path="toolbar/tools" row="0" visible="false"/>
        <toolbar anchor="west" id="CustomToolbar-0" index="0" name="Custom-Tools-Palette" row="0">
          <item id="bondGroup"/>
          <item id="insertElectronFlow"/>

          <item id="insertElectronFlow2"/>
          <item id="insertRectangle"/>
          <item id="insertArrow"/>
          <item id="insertTwoHeadedArrow"/>
        </toolbar>
      </scheme>

    </customization>

現在、configurationファイルはappletまたはbeansへの適用に限られますが、近いうちにAPIでも使用できるようになる予定です。

MarvinViewとMarvinSpaceの画面構成は、現時点では変更できません。