OSDN Git Service

develop とマージ
authorOlyutorskii <olyutorskii@users.osdn.me>
Sat, 7 Jul 2018 14:31:56 +0000 (23:31 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Sat, 7 Jul 2018 14:31:56 +0000 (23:31 +0900)
45 files changed:
CHANGELOG.txt
src/main/java/jp/sfjp/jindolf/Controller.java
src/main/java/jp/sfjp/jindolf/JindolfMain.java
src/main/java/jp/sfjp/jindolf/ResourceManager.java
src/main/java/jp/sfjp/jindolf/config/CmdOption.java
src/main/java/jp/sfjp/jindolf/config/ConfigFile.java
src/main/java/jp/sfjp/jindolf/config/FileUtils.java
src/main/java/jp/sfjp/jindolf/config/InterVMLock.java
src/main/java/jp/sfjp/jindolf/config/OptionInfo.java
src/main/java/jp/sfjp/jindolf/data/Avatar.java
src/main/java/jp/sfjp/jindolf/data/LandsModel.java
src/main/java/jp/sfjp/jindolf/dxchg/WebIPC.java [deleted file]
src/main/java/jp/sfjp/jindolf/dxchg/WebIPCDialog.java
src/main/java/jp/sfjp/jindolf/glyph/FontEnv.java
src/main/java/jp/sfjp/jindolf/glyph/FontInfo.java
src/main/java/jp/sfjp/jindolf/glyph/FontSelectList.java
src/main/java/jp/sfjp/jindolf/glyph/SysEventDraw.java
src/main/java/jp/sfjp/jindolf/glyph/TalkDraw.java
src/main/java/jp/sfjp/jindolf/log/LoggingDispatcher.java
src/main/java/jp/sfjp/jindolf/summary/GameSummary.java
src/main/java/jp/sfjp/jindolf/util/GUIUtils.java
src/main/java/jp/sfjp/jindolf/util/Monodizer.java
src/main/java/jp/sfjp/jindolf/view/ActionManager.java
src/main/java/jp/sfjp/jindolf/view/FlexiIcon.java [new file with mode: 0644]
src/main/java/jp/sfjp/jindolf/view/LandsTree.java
src/main/java/jp/sfjp/jindolf/view/VillageIconRenderer.java
src/main/resources/jp/sfjp/jindolf/resources/help.txt
src/main/resources/jp/sfjp/jindolf/resources/html/help.html
src/main/resources/jp/sfjp/jindolf/resources/html/keyassign.html
src/main/resources/jp/sfjp/jindolf/resources/html/license.html
src/main/resources/jp/sfjp/jindolf/resources/html/options.html
src/main/resources/jp/sfjp/jindolf/resources/image/tb_ascend.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_descend.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_editor.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_filter.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_find.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_findnext.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_findprev.png
src/main/resources/jp/sfjp/jindolf/resources/image/tb_reload.png
src/main/resources/jp/sfjp/jindolf/resources/image/vs_cross.png
src/main/resources/jp/sfjp/jindolf/resources/image/vs_epilogue.png
src/main/resources/jp/sfjp/jindolf/resources/image/vs_gameover.png
src/main/resources/jp/sfjp/jindolf/resources/image/vs_progress.png
src/main/resources/jp/sfjp/jindolf/resources/image/vs_prologue.png
src/test/java/jp/sfjp/jindolf/config/CmdOptionTest.java

index dcfa9c0..e50cae2 100644 (file)
@@ -6,6 +6,8 @@ Jindolf 変更履歴
 
 X.XXX.X (XXXX-XX-XX)
     ・JinParser 2.101.4 に対応。
+    ・JDK9以降のWindows HiDPI環境に対応。
+    ・-nosplashオプションの廃止。
 
 3.302.4 (2017-04-09)
     ・F国URL修正に伴い JinCore 1.206.10 に対応。
index 6693a62..ac8e994 100644 (file)
@@ -547,15 +547,10 @@ public class Controller
         final LookAndFeel lnf;
         try{
             lnf = (LookAndFeel) ( lnfClass.newInstance() );
-        }catch(InstantiationException e){
-            String warnMsg = MessageFormat.format(ERRFORM_LAF, className);
-            warnDialog(ERRTITLE_LAF, warnMsg, e);
-            return;
-        }catch(IllegalAccessException e){
-            String warnMsg = MessageFormat.format(ERRFORM_LAF, className);
-            warnDialog(ERRTITLE_LAF, warnMsg, e);
-            return;
-        }catch(ClassCastException e){
+        }catch(   InstantiationException
+                | IllegalAccessException
+                | ClassCastException
+                e){
             String warnMsg = MessageFormat.format(ERRFORM_LAF, className);
             warnDialog(ERRTITLE_LAF, warnMsg, e);
             return;
@@ -1291,10 +1286,7 @@ public class Controller
                             return;
                         }
                     });
-                }catch(InvocationTargetException e){
-                    LOGGER.log(Level.SEVERE,
-                            "タブ操作で致命的な障害が発生しました", e);
-                }catch(InterruptedException e){
+                }catch(InvocationTargetException | InterruptedException e){
                     LOGGER.log(Level.SEVERE,
                             "タブ操作で致命的な障害が発生しました", e);
                 }
@@ -1314,11 +1306,9 @@ public class Controller
                                 return;
                             }
                         });
-                    }catch(InvocationTargetException e){
-                        LOGGER.log(Level.SEVERE,
-                                "ブラウザ表示で致命的な障害が発生しました",
-                                e );
-                    }catch(InterruptedException e){
+                    }catch(   InvocationTargetException
+                            | InterruptedException
+                            e){
                         LOGGER.log(Level.SEVERE,
                                 "ブラウザ表示で致命的な障害が発生しました",
                                 e );
@@ -1726,9 +1716,7 @@ public class Controller
         }else{
             try{
                 SwingUtilities.invokeAndWait(microJob);
-            }catch(InvocationTargetException e){
-                LOGGER.log(Level.SEVERE, "ビジー処理で失敗", e);
-            }catch(InterruptedException e){
+            }catch(InvocationTargetException | InterruptedException e){
                 LOGGER.log(Level.SEVERE, "ビジー処理で失敗", e);
             }
         }
index 343d8c4..972ac20 100644 (file)
@@ -9,16 +9,12 @@ package jp.sfjp.jindolf;
 
 import java.awt.Dimension;
 import java.awt.EventQueue;
-import java.awt.Window;
 import java.io.PrintStream;
 import java.lang.reflect.InvocationTargetException;
 import java.text.MessageFormat;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import javax.swing.ImageIcon;
 import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JWindow;
 import javax.swing.UIManager;
 import jp.sfjp.jindolf.config.AppSetting;
 import jp.sfjp.jindolf.config.CmdOption;
@@ -48,10 +44,6 @@ public final class JindolfMain {
     /** ロガー。 */
     private static final Logger LOGGER = Logger.getAnonymousLogger();
 
-    /** スプラッシュロゴ。 */
-    private static final String RES_LOGOICON =
-            "resources/image/logo.png";
-
     private static final String LOG_LOADED =
               "{0} は {1,date} {2,time} に"
             + "VM上のクラス {3} としてロードされました。 ";
@@ -63,10 +55,6 @@ public final class JindolfMain {
             "設定格納ディレクトリに[ {0} ]が指定されました。";
     private static final String LOG_NOCONF =
             "設定格納ディレクトリは使いません。";
-    private static final String WARNMSG_SPLASH =
-              "JRE1.6以降では、Jindolfの-nosplashオプションは無効です。"
-            + "Java実行系の方でスプラッシュ画面の非表示を"
-            + "指示してください(おそらく空の-splash:オプション)";
     private static final String FATALMSG_INITFAIL =
             "アプリケーション初期化に失敗しました";
     private static final String ERRMSG_HELP =
@@ -114,52 +102,6 @@ public final class JindolfMain {
     }
 
     /**
-     * スプラッシュウィンドウを表示する。
-     *
-     * <p>JRE1.6以降では何も表示しない。
-     *
-     * @return スプラッシュウィンドウ。JRE1.6以降ならnullを返す。
-     */
-    @SuppressWarnings("CallToThreadYield")
-    private static Window showSplash(){
-        if(JreChecker.has16Runtime()) return null;
-
-        Window splashWindow = new JWindow();
-
-        ImageIcon logo = ResourceManager.getImageIcon(RES_LOGOICON);
-        JLabel splashLabel = new JLabel(logo);
-        splashWindow.add(splashLabel);
-
-        splashWindow.pack();
-        splashWindow.setLocationRelativeTo(null); // locate center
-        splashWindow.setVisible(true);
-
-        Thread.yield();
-
-        return splashWindow;
-    }
-
-    /**
-     * スプラッシュウィンドウを隠す。
-     * @param splashWindow スプラッシュウィンドウ。nullならなにもしない。
-     */
-    private static void hideSplash(final Window splashWindow){
-        if(splashWindow == null) return;
-
-        EventQueue.invokeLater(new Runnable(){
-            /** {@inheritDoc} */
-            @Override
-            public void run(){
-                splashWindow.setVisible(false);
-                splashWindow.dispose();
-                return;
-            }
-        });
-
-        return;
-    }
-
-    /**
      * 起動時の諸々の情報をログ出力する。
      * @param appSetting  アプリ設定
      */
@@ -200,11 +142,6 @@ public final class JindolfMain {
             LOGGER.info(LOG_NOCONF);
         }
 
-        if(    JreChecker.has16Runtime()
-            && optinfo.hasOption(CmdOption.OPT_NOSPLASH) ){
-            LOGGER.warning(WARNMSG_SPLASH);
-        }
-
         return;
     }
 
@@ -269,17 +206,7 @@ public final class JindolfMain {
         }
         UIManager.put("swing.boldMetal", boldFlag);
 
-        // JRE1.5用スプラッシュウィンドウ。だけどもういらん。
-        Window splashWindow = null;
-        if( ! optinfo.hasOption(CmdOption.OPT_NOSPLASH) ){
-            splashWindow = showSplash();
-        }
-
-        try{
-            exitCode = splashedMain(optinfo);
-        }finally{
-            hideSplash(splashWindow);
-        }
+        exitCode = splashedMain(optinfo);
 
         return exitCode;
     }
@@ -287,7 +214,8 @@ public final class JindolfMain {
     /**
      * JindolfMain のスタートアップエントリ。
      *
-     * <p>スプラッシュウィンドウが出ている状態。
+     * <p>JRE1.5までの間、
+     * スプラッシュウィンドウが出ている状態として想定されていた。
      * 時間のかかる初期化処理はなるべくこの中へ。
      *
      * @param optinfo コマンドライン引数情報
@@ -339,11 +267,7 @@ public final class JindolfMain {
                     return;
                 }
             });
-        }catch(InvocationTargetException e){
-            LOGGER.log(Level.SEVERE, FATALMSG_INITFAIL, e);
-            e.printStackTrace(STDERR);
-            exitCode = 1;
-        }catch(InterruptedException e){
+        }catch(InvocationTargetException | InterruptedException e){
             LOGGER.log(Level.SEVERE, FATALMSG_INITFAIL, e);
             e.printStackTrace(STDERR);
             exitCode = 1;
index da7c51e..f360cbb 100644 (file)
@@ -19,7 +19,9 @@ import java.net.URL;
 import java.nio.charset.Charset;
 import java.util.Properties;
 import javax.imageio.ImageIO;
+import javax.swing.Icon;
 import javax.swing.ImageIcon;
+import jp.sfjp.jindolf.view.FlexiIcon;
 
 /**
  * 各種リソースファイルの管理。
@@ -56,6 +58,8 @@ public final class ResourceManager {
 
     private static final Charset CS_UTF8 = Charset.forName("UTF-8");
 
+    private static final int BTN_SZ = 24;
+
     static{
         Class<?> rootKlass = Jindolf.class;
 
@@ -247,6 +251,30 @@ public final class ResourceManager {
     }
 
     /**
+     * リソース名を用いて正方形ボタン用アイコン画像を取得する。
+     *
+     * @param resPath アイコン画像リソース名
+     * @return アイコン画像。リソースが見つからなければnull。
+     */
+    public static Icon getButtonIcon(String resPath){
+        Icon result = getSquareIcon(resPath, BTN_SZ);
+        return result;
+    }
+
+    /**
+     * リソース名を用いて正方形アイコン画像を取得する。
+     *
+     * @param resPath アイコン画像リソース名
+     * @param sz 正方形アイコン寸法
+     * @return アイコン画像。リソースが見つからなければnull。
+     */
+    public static Icon getSquareIcon(String resPath, int sz){
+        BufferedImage image = getBufferedImage(resPath);
+        Icon result = new FlexiIcon(image, sz, sz);
+        return result;
+    }
+
+    /**
      * リソース名を用いてプロパティを取得する。
      * @param resPath プロパティファイルのリソース名
      * @return プロパティ。リソースが読み込めなければnull。
index 057988b..ddc59c7 100644 (file)
@@ -24,8 +24,6 @@ public enum CmdOption {
     OPT_VERSION("-version"),
     /** UI文字制御。 */
     OPT_BOLDMETAL("-boldMetal"),
-    /** スプラッシュ制御。 */
-    OPT_NOSPLASH("-nosplash"),
     /** ウィンドウ位置指定。 */
     OPT_GEOMETRY("-geometry"),
     /** 実行環境出力。 */
@@ -51,7 +49,6 @@ public enum CmdOption {
             OPT_VERSION,
             OPT_VMINFO,
             OPT_BOLDMETAL,
-            OPT_NOSPLASH,
             OPT_CONSOLELOG,
             OPT_NOCONF
             );
index 81cb447..fe92f87 100644 (file)
@@ -399,9 +399,7 @@ public final class ConfigFile{
                     "コピーすれば、そちらの設定が優先して使われます。");
             writer.println(
                     "「lock」の名前を持つファイルはロックファイルです。");
-        }catch(IOException e){
-            abortCantWrite(file);
-        }catch(SecurityException e){
+        }catch(IOException | SecurityException e){
             abortCantWrite(file);
         }finally{
             if(writer != null){
index cd75be0..1912568 100644 (file)
@@ -8,9 +8,6 @@
 package jp.sfjp.jindolf.config;
 
 import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -20,7 +17,6 @@ import java.util.Locale;
 
 /**
  * 諸々のファイル操作ユーティリティ。
- * JRE1.6 API へのリフレクションアクセスを含む。
  */
 public final class FileUtils{
 
@@ -31,45 +27,7 @@ public final class FileUtils{
     private static final String SCHEME_FILE = "file";
     private static final String ENTITY_YEN = "&yen;";
 
-    /** JRE1.6の{@link java.io.File#setReadable(boolean,boolean)}に相当。 */
-    private static final Method METHOD_SETREADABLE;
-    /** JRE1.6の{@link java.io.File#setWritable(boolean,boolean)}に相当。 */
-    private static final Method METHOD_SETWRITABLE;
-    /** Locale.ROOT代替品。 */
-    private static final Locale ROOT = new Locale("", "", "");
-
     static{
-        Method method;
-        int modifiers;
-
-        try{
-            method = File.class.getMethod(
-                    "setReadable", Boolean.TYPE, Boolean.TYPE);
-            modifiers = method.getModifiers();
-            if( ! Modifier.isPublic(modifiers) ){
-                method = null;
-            }
-        }catch(NoSuchMethodException e){
-            method = null;
-        }catch(SecurityException e){
-            method = null;
-        }
-        METHOD_SETREADABLE = method;
-
-        try{
-            method = File.class.getMethod(
-                    "setWritable", Boolean.TYPE, Boolean.TYPE);
-            modifiers = method.getModifiers();
-            if( ! Modifier.isPublic(modifiers) ){
-                method = null;
-            }
-        }catch(NoSuchMethodException e){
-            method = null;
-        }catch(SecurityException e){
-            method = null;
-        }
-        METHOD_SETWRITABLE = method;
-
         assert ! ( isMacOSXFs() && isWindowsOSFs() );
         new FileUtils().hashCode();
     }
@@ -86,124 +44,10 @@ public final class FileUtils{
 
 
     /**
-     * パーミッション操作メソッドの下請け。
-     * リフレクション機構に関する異常系を吸収する。
-     * @param method setReadableかsetWritableのいずれかの2引数版メソッド。
-     * @param file 捜査対象のファイル
-     * @param flag 操作フラグ
-     * @param ownerOnly 対象は所有者のみか否か
-     * @return メソッドの戻り値。成功すればtrue
-     * @throws InvocationTargetException メソッドが発した異常系
-     */
-    private static boolean reflectFilePermOp(
-            Method method, File file, boolean flag, boolean ownerOnly)
-            throws InvocationTargetException {
-        Object result;
-        try{
-            result = method.invoke(file, flag, ownerOnly);
-        }catch(IllegalAccessException e){
-            assert false;
-            throw new AssertionError(e);
-        }catch(IllegalArgumentException e){
-            assert false;
-            throw new AssertionError(e);
-        }catch(ExceptionInInitializerError e){
-            assert false;
-            throw new AssertionError(e);
-        }
-
-        assert result instanceof Boolean;
-        Boolean boolResult = (Boolean) result;
-
-        return boolResult;
-    }
-
-    /**
-     * パーミッション操作メソッドの下請け。
-     * @param method setReadableかsetWritableのいずれかの2引数版メソッド。
-     * @param file 操作対象のファイル。
-     * @param flag 操作フラグ
-     * @param ownerOnly 対象は所有者のみか否か
-     * @return 成功すればtrue
-     * @throws SecurityException セキュリティ上の許可が無い場合
-     */
-    private static boolean invokeFilePermOp(
-            Method method, File file, boolean flag, boolean ownerOnly)
-            throws SecurityException{
-        boolean result;
-
-        try{
-            result = reflectFilePermOp(method, file, flag, ownerOnly);
-        }catch(InvocationTargetException e){
-            Throwable cause = e.getCause();
-            if(cause instanceof SecurityException){
-                throw (SecurityException) cause;
-            }else if(cause instanceof RuntimeException){
-                throw (RuntimeException) cause;
-            }else if(cause instanceof Error){
-                throw (Error) cause;
-            }
-
-            assert false;
-            throw new AssertionError(e);
-        }
-
-        return result;
-    }
-
-    /**
-     * ファイルの読み込みパーミッションを操作する。
-     * JRE1.6の{@link java.io.File#setReadable(boolean,boolean)}
-     * の代用品。
-     *
-     * <p>JRE1.6でなければなにもせずにfalseを返す。
-     *
-     * @param file ファイルorディレクトリ
-     * @param flag 操作フラグ
-     * @param ownerOnly 対象は所有者のみか否か
-     * @return 成功すればtrue
-     * @throws SecurityException セキュリティ上の許可が無い場合
-     */
-    public static boolean setReadable(
-            File file, boolean flag, boolean ownerOnly )
-            throws SecurityException {
-        if(file == null) throw new NullPointerException();
-        if(METHOD_SETREADABLE == null) return false;
-
-        boolean result;
-        result = invokeFilePermOp(METHOD_SETREADABLE, file, flag, ownerOnly);
-        return result;
-    }
-
-    /**
-     * ファイルの書き込みパーミッションを操作する。
-     * JRE1.6の{@link java.io.File#setWritable(boolean,boolean)}
-     * の代用品。
-     *
-     * <p>JRE1.6でなければなにもせずにfalseを返す。
-     *
-     * @param file ファイルorディレクトリ
-     * @param flag 操作フラグ
-     * @param ownerOnly 対象は所有者のみか否か
-     * @return 成功すればtrue
-     * @throws SecurityException セキュリティ上の許可が無い場合
-     */
-    public static boolean setWritable(
-            File file, boolean flag, boolean ownerOnly )
-            throws SecurityException {
-        if(file == null) throw new NullPointerException();
-        if(METHOD_SETWRITABLE == null) return false;
-
-        boolean result;
-        result = invokeFilePermOp(METHOD_SETWRITABLE, file, flag, ownerOnly);
-        return result;
-    }
-
-    /**
      * なるべく自分にだけ読み書き許可を与え
      * 自分以外には読み書き許可を与えないように
      * ファイル属性を操作する。
-     * JRE1.6環境でなければなにもしない。
+     *
      * @param file 操作対象ファイル
      * @return 成功すればtrue
      * @throws SecurityException セキュリティ上の許可が無い場合
@@ -212,17 +56,18 @@ public final class FileUtils{
             throws SecurityException{
         boolean result = true;
 
-        result &= setReadable(file, false, false);
-        result &= setReadable(file, true,  true);
+        result &= file.setReadable(false, false);
+        result &= file.setReadable(true,  true);
 
-        result &= setWritable(file, false, false);
-        result &= setWritable(file, true, true);
+        result &= file.setWritable(false, false);
+        result &= file.setWritable(true, true);
 
         return result;
     }
 
     /**
      * 任意の絶対パスの祖先の内、存在するもっとも近い祖先を返す。
+     *
      * @param file 任意の絶対パス
      * @return 存在するもっとも近い祖先。一つも存在しなければnull。
      * @throws IllegalArgumentException 引数が絶対パスでない
@@ -238,6 +83,7 @@ public final class FileUtils{
 
     /**
      * 任意の絶対パスのルートファイルシステムもしくはドライブレターを返す。
+     *
      * @param file 任意の絶対パス
      * @return ルートファイルシステムもしくはドライブレター
      * @throws IllegalArgumentException 引数が絶対パスでない
@@ -252,6 +98,7 @@ public final class FileUtils{
 
     /**
      * 相対パスの絶対パス化を試みる。
+     *
      * @param file 対象パス
      * @return 絶対パス。絶対化に失敗した場合は元の引数。
      */
@@ -271,7 +118,8 @@ public final class FileUtils{
 
     /**
      * 任意のディレクトリがアクセス可能な状態にあるか判定する。
-     * アクセス可能の条件を満たすためには、与えられたパスが
+     *
+     * <p>アクセス可能の条件を満たすためには、与えられたパスが
      * <ul>
      * <li>存在し、
      * <li>かつディレクトリであり、
@@ -279,6 +127,7 @@ public final class FileUtils{
      * <li>かつ書き込み可能
      * </ul>
      * でなければならない。
+     *
      * @param path 任意のディレクトリ
      * @return アクセス可能ならtrue
      */
@@ -298,6 +147,7 @@ public final class FileUtils{
     /**
      * クラスがローカルファイルからロードされたのであれば
      * そのファイルを返す。
+     *
      * @param klass 任意のクラス
      * @return ロード元ファイル。見つからなければnull。
      */
@@ -330,6 +180,7 @@ public final class FileUtils{
 
     /**
      * すでに存在するJARファイルか判定する。
+     *
      * @param file 任意のファイル
      * @return すでに存在するJARファイルであればtrue
      */
@@ -349,6 +200,7 @@ public final class FileUtils{
     /**
      * クラスがローカルJARファイルからロードされたのであれば
      * その格納ディレクトリを返す。
+     *
      * @param klass 任意のクラス
      * @return ロード元JARファイルの格納ディレクトリ。
      *     JARが見つからない、もしくはロード元がJARファイルでなければnull。
@@ -367,6 +219,7 @@ public final class FileUtils{
     /**
      * このクラスがローカルJARファイルからロードされたのであれば
      * その格納ディレクトリを返す。
+     *
      * @return ロード元JARファイルの格納ディレクトリ。
      *     JARが見つからない、もしくはロード元がJARファイルでなければnull。
      */
@@ -376,7 +229,9 @@ public final class FileUtils{
 
     /**
      * ホームディレクトリを得る。
-     * システムプロパティuser.homeで示されたホームディレクトリを返す。
+     *
+     * <p>システムプロパティuser.homeで示されたホームディレクトリを返す。
+     *
      * @return ホームディレクトリ。何らかの事情でnullを返す場合もあり。
      */
     public static File getHomeDirectory(){
@@ -394,6 +249,7 @@ public final class FileUtils{
 
     /**
      * MacOSX環境か否か判定する。
+     *
      * @return MacOSX環境ならtrue
      */
     public static boolean isMacOSXFs(){
@@ -408,7 +264,7 @@ public final class FileUtils{
 
         if(osName == null) return false;
 
-        osName = osName.toLowerCase(ROOT);
+        osName = osName.toLowerCase(Locale.ROOT);
 
         if(osName.startsWith("mac os x")){
             return true;
@@ -419,6 +275,7 @@ public final class FileUtils{
 
     /**
      * Windows環境か否か判定する。
+     *
      * @return Windows環境ならtrue
      */
     public static boolean isWindowsOSFs(){
@@ -433,7 +290,7 @@ public final class FileUtils{
 
         if(osName == null) return false;
 
-        osName = osName.toLowerCase(ROOT);
+        osName = osName.toLowerCase(Locale.ROOT);
 
         if(osName.startsWith("windows")){
             return true;
@@ -444,7 +301,8 @@ public final class FileUtils{
 
     /**
      * アプリケーション設定ディレクトリを返す。
-     * 存在の有無、アクセスの可否は関知しない。
+     *
+     * <p>存在の有無、アクセスの可否は関知しない。
      *
      * <p>WindowsやLinuxではホームディレクトリ。
      * Mac OS X ではさらにホームディレクトリの下の
@@ -470,7 +328,9 @@ public final class FileUtils{
 
     /**
      * ファイル名を表示するためのJLabel用HTML文字列を生成する。
-     * Windows日本語環境では、バックスラッシュ記号が円通貨記号に置換される。
+     *
+     * <p>Windows日本語環境では、バックスラッシュ記号が円通貨記号に置換される。
+     *
      * @param file 対象ファイル
      * @return HTML文字列断片
      */
index 383d39b..964225f 100644 (file)
@@ -210,9 +210,7 @@ public class InterVMLock{
             boolean created = false;
             try{
                 created = this.lockFile.createNewFile();
-            }catch(IOException e){
-                assert true;   // IGNORE
-            }catch(SecurityException e){
+            }catch(IOException | SecurityException e){
                 assert true;   // IGNORE
             }finally{
                 if(created){
index 9f265e7..bef7def 100644 (file)
@@ -19,7 +19,8 @@ import java.util.regex.Pattern;
 
 /**
  * コマンドラインオプション情報。
- * public static void main()の引数から展開される。
+ *
+ * <p>public static void main()の引数から展開される。
  */
 public class OptionInfo{
 
@@ -74,21 +75,20 @@ public class OptionInfo{
     /**
      * 文字列が可変引数のいずれかと英字大小無視で等しいか判定する。
      *
-     * <p>※ JRE1.6のString#equalsIgnoreCase の代替も兼ねる。
-     *
      * @param text 文字列
      * @param names 文字列の可変引数
      * @return 等しい物があればtrue
      */
     private static boolean equalsIgnoreCase(String text, String ... names){
         for(String name : names){
-            if(text.compareToIgnoreCase(name) == 0) return true;
+            if(text.equalsIgnoreCase(name)) return true;
         }
         return false;
     }
 
     /**
      * 真偽二値をとるオプション解析の下請け。
+     *
      * @param info オプション情報格納先
      * @param option オプション種別
      * @param optTxt オプション名文字列
@@ -168,6 +168,7 @@ public class OptionInfo{
 
     /**
      * 引数付きオプションを解析する。
+     *
      * @param info オプション情報
      * @param optTxt オプション文字列
      * @param option オプション種別
@@ -203,6 +204,7 @@ public class OptionInfo{
 
     /**
      * オプション文字列を解析する。
+     *
      * @param args main()に渡されるオプション文字列
      * @return 解析済みのオプション情報。
      * @throws IllegalArgumentException 構文エラー
@@ -238,6 +240,7 @@ public class OptionInfo{
 
     /**
      * 全引数のリストを返す。
+     *
      * @return 全引数のリスト
      */
     public List<String> getInvokeArgList(){
@@ -246,6 +249,7 @@ public class OptionInfo{
 
     /**
      * オプションが指定されていたか否か判定する。
+     *
      * @param option オプション
      * @return 指定されていたらtrue
      */
@@ -256,7 +260,9 @@ public class OptionInfo{
 
     /**
      * 真偽値をとるオプション値を返す。
-     * 複数回指定された場合は最後の値。
+     *
+     * <p>複数回指定された場合は最後の値。
+     *
      * @param option オプション
      * @return 真偽値。オプション指定がなかった場合はnull
      * @throws IllegalArgumentException 真偽値を取るオプションではない。
@@ -274,7 +280,9 @@ public class OptionInfo{
 
     /**
      * 文字列引数をとるオプション値を返す。
-     * 複数回指定された場合は最後の値。
+     *
+     * <p>複数回指定された場合は最後の値。
+     *
      * @param option オプション
      * @return 文字列。オプション指定がなかった場合はnull
      */
@@ -285,7 +293,9 @@ public class OptionInfo{
 
     /**
      * 排他的オプションのいずれかが指定されたか判定する。
-     * 後から指定された方が有効となる。
+     *
+     * <p>後から指定された方が有効となる。
+     *
      * @param options 排他的オプション群
      * @return いずれかのオプション。どれも指定されなければnull
      */
@@ -304,6 +314,7 @@ public class OptionInfo{
 
     /**
      * 初期のフレーム幅を返す。
+     *
      * @return 初期のフレーム幅。オプション指定されてなければnull
      */
     public Integer initialFrameWidth(){
@@ -312,6 +323,7 @@ public class OptionInfo{
 
     /**
      * 初期のフレーム高を返す。
+     *
      * @return 初期のフレーム高。オプション指定されてなければnull
      */
     public Integer initialFrameHeight(){
@@ -320,6 +332,7 @@ public class OptionInfo{
 
     /**
      * 初期のフレーム位置のX座標を返す。
+     *
      * @return 初期のフレーム位置のX座標。オプション指定されてなければnull
      */
     public Integer initialFrameXpos(){
@@ -328,6 +341,7 @@ public class OptionInfo{
 
     /**
      * 初期のフレーム位置のY座標を返す。
+     *
      * @return 初期のフレーム位置のY座標。オプション指定されてなければnull
      */
     public Integer initialFrameYpos(){
index ffe904a..4925e09 100644 (file)
@@ -41,13 +41,11 @@ public class Avatar implements Comparable<Avatar> {
         try{
             DocumentBuilder builder = XmlUtils.createDocumentBuilder();
             predefs = PreDefAvatar.buildPreDefAvatarList(builder);
-        }catch(IOException e){
-            throw new ExceptionInInitializerError(e);
-        }catch(ParserConfigurationException e){
-            throw new ExceptionInInitializerError(e);
-        }catch(SAXException e){
-            throw new ExceptionInInitializerError(e);
-        }catch(URISyntaxException e){
+        }catch(   IOException
+                | ParserConfigurationException
+                | SAXException
+                | URISyntaxException
+                e){
             throw new ExceptionInInitializerError(e);
         }
 
index 9a3805d..7804e03 100644 (file)
@@ -99,16 +99,11 @@ public class LandsModel implements TreeModel{ // ComboBoxModelも付けるか?
         try{
             DocumentBuilder builder = XmlUtils.createDocumentBuilder();
             landDefList = LandDef.buildLandDefList(builder);
-        }catch(IOException e){
-            LOGGER.log(Level.SEVERE, "failed to load land list", e);
-            return;
-        }catch(SAXException e){
-            LOGGER.log(Level.SEVERE, "failed to load land list", e);
-            return;
-        }catch(URISyntaxException e){
-            LOGGER.log(Level.SEVERE, "failed to load land list", e);
-            return;
-        }catch(ParserConfigurationException e){
+        }catch(   IOException
+                | SAXException
+                | URISyntaxException
+                | ParserConfigurationException
+                e){
             LOGGER.log(Level.SEVERE, "failed to load land list", e);
             return;
         }
diff --git a/src/main/java/jp/sfjp/jindolf/dxchg/WebIPC.java b/src/main/java/jp/sfjp/jindolf/dxchg/WebIPC.java
deleted file mode 100644 (file)
index e1b7e29..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Inter Process Communication with Web browser
- *
- * License : The MIT License
- * Copyright(c) 2009 olyutorskii
- */
-
-package jp.sfjp.jindolf.dxchg;
-
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URI;
-
-/**
- * Webブラウザとのプロセス間通信。
- * java.awt.Desktopの代用品。
- * JRE1.6でしか使えない。がしかし、JRE1.5でもコンパイル&ロード可能。
- * ※参照: java.awt.Desktop
- */
-public final class WebIPC{
-
-    private static final Class<?> DESKTOP_KLASS;
-    private static final Method   METHOD_ISDESKTOPSUPPORTED;
-    private static final Method   METHOD_GETDESKTOP;
-    private static final Method   METHOD_ISSUPPORTED;
-    private static final Method   METHOD_BROWSE;
-
-    private static final Class<?> DESKTOP_ACTION_KLASS;
-    private static final Enum<?>  BROWSE_ENUM;
-
-    static{
-        DESKTOP_KLASS       = getClass("java.awt.Desktop");
-        DESKTOP_ACTION_KLASS = getInnerClass(DESKTOP_KLASS,
-                                           "java.awt.Desktop.Action");
-
-        METHOD_ISDESKTOPSUPPORTED = getMethod("isDesktopSupported");
-        METHOD_GETDESKTOP         = getMethod("getDesktop");
-        METHOD_ISSUPPORTED        = getMethod("isSupported",
-                                             DESKTOP_ACTION_KLASS);
-        METHOD_BROWSE             = getMethod("browse",
-                                             URI.class);
-
-        BROWSE_ENUM = getEnumMember(DESKTOP_ACTION_KLASS, "BROWSE");
-    }
-
-
-    private final Object desktop;
-
-
-    /**
-     * 見えないコンストラクタ。
-     * @throws HeadlessException GUI環境が未接続
-     * @throws UnsupportedOperationException 未サポート
-     */
-    private WebIPC()
-            throws HeadlessException,
-                   UnsupportedOperationException {
-        super();
-
-        try{
-            this.desktop = METHOD_GETDESKTOP.invoke(null, (Object[]) null);
-        }catch(InvocationTargetException e){
-            Throwable targetException = e.getTargetException();
-
-            if(targetException instanceof RuntimeException){
-                throw (RuntimeException) targetException;
-            }
-            if(targetException instanceof Error){
-                throw (Error) targetException;
-            }
-
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }catch(IllegalAccessException e){
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }
-
-        return;
-    }
-
-
-    /**
-     * クラス名からClassインスタンスを探す。
-     * @param klassName クラス名
-     * @return Classインスタンス。クラスが見つからなければnull。
-     */
-    private static Class<?> getClass(String klassName){
-        Class<?> result;
-        try{
-            result = Class.forName(klassName);
-        }catch(ClassNotFoundException e){
-            result = null;
-        }
-        return result;
-    }
-
-    /**
-     * 内部クラス名からClassインスタンスを探す。
-     * @param parent 囲む親クラス。
-     * @param canonical 内部クラスのカノニカル名
-     * @return Classインスタンス。クラスが見つからなければnull。
-     */
-    private static Class<?> getInnerClass(Class<?> parent,
-                                            String canonical){
-        if(parent == null) return null;
-
-        Class<?> result = null;
-
-        Class<?>[] innerKlasses = parent.getClasses();
-        for(Class<?> klass : innerKlasses){
-            if(klass.getCanonicalName().equals(canonical)){
-                result = klass;
-                break;
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Desktopクラスのメソッド名からMethodインスタンスを探す。
-     * @param methodName メソッド名
-     * @param paramTypes 引数型並び
-     * @return Methodインスタンス。見つからなければnull。
-     */
-    private static Method getMethod(String methodName,
-                                     Class<?>... paramTypes){
-        if(DESKTOP_KLASS == null) return null;
-
-        Method result;
-
-        try{
-            result = DESKTOP_KLASS.getMethod(methodName, paramTypes);
-        }catch(NoSuchMethodException e){
-            result = null;
-        }
-
-        return result;
-    }
-
-    /**
-     * Enumのメンバを探す。
-     * @param parent Enumの型
-     * @param memberName メンバ名
-     * @return Enumインスタンス。見つからなければnull。
-     */
-    private static Enum<?> getEnumMember(Class<?> parent,
-                                           String memberName){
-        if(parent == null) return null;
-
-        Field field;
-        try{
-            field = parent.getField(memberName);
-        }catch(NoSuchFieldException e){
-            return null;
-        }
-
-        Object value;
-        try{
-            value = field.get(null);
-        }catch(IllegalAccessException e){
-            return null;
-        }catch(IllegalArgumentException e){
-            return null;
-        }
-
-        if( ! (value instanceof Enum) ) return null;
-
-        return (Enum<?>) value;
-    }
-
-    /**
-     * JRE1.6より提供されたjava.awt.Desktopが利用可能か判定する。
-     * ※参照: java.awt.DesktopのisDesktopSupported()
-     * @return Desktopが利用可能ならtrue。JRE1.5以前だとたぶんfalse。
-     */
-    public static boolean isDesktopSupported(){
-        if(METHOD_ISDESKTOPSUPPORTED == null) return false;
-
-        Object invokeResult;
-        try{
-            invokeResult = METHOD_ISDESKTOPSUPPORTED.invoke(null,
-                                                            (Object[]) null);
-        }catch(InvocationTargetException e){
-            Throwable targetException = e.getTargetException();
-
-            if(targetException instanceof RuntimeException){
-                throw (RuntimeException) targetException;
-            }else if(targetException instanceof Error){
-                throw (Error) targetException;
-            }
-
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }catch(IllegalAccessException e){
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }
-
-        if( ! (invokeResult instanceof Boolean) ){
-            assert false;
-            return false;
-        }
-
-        boolean result = (Boolean) invokeResult;
-
-        return result;
-    }
-
-    /**
-     * WebIPCインスタンスを得る。
-     * ※参照: java.awt.DesktopのgetDesktop()
-     * @return インスタンス
-     * @throws java.awt.HeadlessException スクリーンデバイスが見つからない
-     * @throws java.lang.UnsupportedOperationException 未サポートの機能
-     */
-    public static WebIPC getWebIPC()
-            throws HeadlessException,
-                   UnsupportedOperationException {
-        if(GraphicsEnvironment.isHeadless()) throw new HeadlessException();
-        if( ! isDesktopSupported() ){
-            throw new UnsupportedOperationException();
-        }
-
-        WebIPC webIPC = new WebIPC();
-
-        return webIPC;
-    }
-
-    /**
-     * Webブラウザに任意のURIを表示させる。
-     * ※参照: java.awt.Desktopのbrowse(java.net.URI)
-     * @param uri URI
-     * @throws NullPointerException 引数がnull
-     * @throws UnsupportedOperationException 未サポートの機能
-     * @throws IOException ブラウザが見つからない
-     * @throws SecurityException セキュリティ違反
-     * @throws IllegalArgumentException URI形式が変
-     */
-    public void browse(URI uri)
-            throws NullPointerException,
-                   UnsupportedOperationException,
-                   IOException,
-                   SecurityException,
-                   IllegalArgumentException {
-        if(uri == null) throw new NullPointerException();
-        if( ! isSupported(Action.BROWSE) ){
-            throw new UnsupportedOperationException();
-        }
-
-        try{
-            METHOD_BROWSE.invoke(this.desktop, uri);
-        }catch(InvocationTargetException e){
-            Throwable targetException = e.getTargetException();
-
-            if(targetException instanceof IOException){
-                throw (IOException) targetException;
-            }
-            if(targetException instanceof RuntimeException){
-                throw (RuntimeException) targetException;
-            }
-            if(targetException instanceof Error){
-                throw (Error) targetException;
-            }
-
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }catch(IllegalAccessException e){
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }
-
-        return;
-    }
-
-    /**
-     * 指定した機能(アクション)がサポートされているか否か判定する。
-     * ※参照: java.awt.Desktop#isSupported(java.awt.Desktop.Action)
-     * @param action アクション
-     * @return アクションがサポートされていればtrue。
-     */
-    public boolean isSupported(Action action){
-        switch(action){
-        case BROWSE:
-            break;
-        default:
-            return false;
-        }
-
-        Object invokeResult;
-        try{
-            invokeResult = METHOD_ISSUPPORTED.invoke(this.desktop,
-                                                     BROWSE_ENUM);
-        }catch(InvocationTargetException e){
-            Throwable targetException = e.getTargetException();
-
-            if(targetException instanceof RuntimeException){
-                throw (RuntimeException) targetException;
-            }
-            if(targetException instanceof Error){
-                throw (Error) targetException;
-            }
-
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }catch(IllegalAccessException e){
-            AssertionError thw = new AssertionError();
-            thw.initCause(e);
-            throw thw;
-        }
-
-        if( ! (invokeResult instanceof Boolean) ){
-            assert false;
-            return false;
-        }
-
-        boolean result = (Boolean) invokeResult;
-
-        return result;
-    }
-
-    /**
-     * 各種デスクトップアクション。
-     * ※参照 java.awt.Desktop.Action
-     */
-    public static enum Action{
-        /** Webブラウザでのブラウズ。 */
-        BROWSE,
-    //  EDIT,
-    //  MAIL,
-    //  OPEN,
-    //  PRINT,
-    }
-
-}
index ff65200..1a81f60 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Dialog for WebIPC
+ * Dialog for Desktop
  *
  * License : The MIT License
  * Copyright(c) 2009 olyutorskii
@@ -8,6 +8,7 @@
 package jp.sfjp.jindolf.dxchg;
 
 import java.awt.Container;
+import java.awt.Desktop;
 import java.awt.Frame;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
@@ -22,21 +23,21 @@ import java.awt.event.WindowEvent;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.text.MessageFormat;
 import java.util.logging.Logger;
 import javax.swing.BorderFactory;
-import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.JRootPane;
 import javax.swing.JTextArea;
 import javax.swing.SwingConstants;
 import javax.swing.TransferHandler;
 import javax.swing.border.Border;
 import javax.swing.border.EtchedBorder;
-import jp.sfjp.jindolf.JreChecker;
 import jp.sfjp.jindolf.VerInfo;
 import jp.sfjp.jindolf.util.GUIUtils;
 import jp.sfjp.jindolf.util.Monodizer;
@@ -45,18 +46,42 @@ import jp.sfjp.jindolf.util.Monodizer;
  * Webブラウザ起動用の専用ダイアログ。
  */
 @SuppressWarnings("serial")
-public class WebIPCDialog
-        extends JDialog
-        implements ActionListener {
+public class WebIPCDialog extends JDialog {
+
+    /** logger. */
+    protected static final Logger LOGGER = Logger.getAnonymousLogger();
+
+    /** browse command. */
+    protected static final String CMD_BROWSE   = "browse";
+    /** clipboard copy command. */
+    protected static final String CMD_CLIPCOPY = "clipcopy";
+    /** cancel command. */
+    protected static final String CMD_CANCEL   = "cancel";
+
+    private static final String MSG_NODESKTOP =
+            "何らかの理由でこの機能は利用不可になっています";
+    private static final String MSG_DND =
+            "URL {0} がどこかへドラッグ&ドロップされました";
+    private static final String MSG_CLIPCOPY =
+            "文字列「{0}」をクリップボードにコピーしました";
+    private static final String MSG_BROWSE =
+            "URL {0} へのアクセスをWebブラウザに指示しました";
 
     private static final String TITLE_WWW =
             VerInfo.getFrameTitle("URLへのアクセス確認");
 
+    private static final DragIgniter DNDIGNITER = new DragIgniter();
 
-    private static final Logger LOGGER = Logger.getAnonymousLogger();
+    private static final URI URI_EMPTY;
 
+    static{
+        try{
+            URI_EMPTY = new URI("");
+        }catch(URISyntaxException e){
+            throw new ExceptionInInitializerError(e);
+        }
+    }
 
-    private final String warnMessage;
 
     private final JLabel info =
             new JLabel("以下のURLへのアクセスが指示されました。");
@@ -71,104 +96,102 @@ public class WebIPCDialog
     private final JButton cancel =
             new JButton("閉じる");
 
-    private final WebIPC ipc;
+    private final Desktop desktop;
 
     private URI uri;
 
 
     /**
      * コンストラクタ。
+     *
      * @param owner オーナーフレーム
      */
-    public WebIPCDialog(Frame owner){
+    protected WebIPCDialog(Frame owner){
         super(owner);
-        setModal(true);
-
-        GUIUtils.modifyWindowAttributes(this, true, false, true);
 
-        WebIPC webipc = null;
-        if(WebIPC.isDesktopSupported()){
-            webipc = WebIPC.getWebIPC();
-            if( ! webipc.isSupported(WebIPC.Action.BROWSE) ){
-                webipc = null;
-            }
+        this.desktop = getBrowserCntl();
+        if(this.desktop == null){
+            this.browse.setEnabled(false);
         }
-        this.ipc = webipc;
-
-        if(this.ipc == null){
-            if( ! JreChecker.has16Runtime() ){
-                this.warnMessage =
-                        "この機能を利用するには、JRE1.6以上が必要です";
-            }else{
-                this.warnMessage =
-                        "何らかの理由でこの機能は利用不可になっています";
-            }
-        }else{
-            this.warnMessage = "";
-        }
-
-        Border inside =
-                BorderFactory.createEmptyBorder(1, 4, 1, 4);
-        Border outside =
-                BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
-        Border border =
-                BorderFactory.createCompoundBorder(outside, inside);
-        this.urltext.setBorder(border);
-        this.urltext.setEditable(false);
-        this.urltext.setLineWrap(true);
-        this.urltext.setComponentPopupMenu(new TextPopup());
-        Monodizer.monodize(this.urltext);
 
-        this.dndLabel.setIcon(GUIUtils.getWWWIcon());
-        this.dndLabel.setHorizontalTextPosition(SwingConstants.LEFT);
-        this.dndLabel.setTransferHandler(new DnDHandler());
-        this.dndLabel.addMouseListener(new DragIgniter());
+        buildUrlLabel();
+        buildEventCatcher();
+        buildDnDLabel();
 
         Container container = getContentPane();
         design(container);
 
-        this.browse  .addActionListener(this);
-        this.clipcopy.addActionListener(this);
-        this.cancel  .addActionListener(this);
+        return;
+    }
 
-        getRootPane().setDefaultButton(this.browse);
-        this.browse.requestFocusInWindow();
 
-        if(this.ipc == null){
-            this.browse.setToolTipText(this.warnMessage);
-        }
+    /**
+     * ブラウザ制御オブジェクトを返す。
+     *
+     * @return ブラウザ制御オブジェクト。サポートされなければnull。
+     */
+    private static Desktop getBrowserCntl(){
+        if( ! Desktop.isDesktopSupported()) return null;
 
-        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
-        addWindowListener(new WindowAdapter(){
-            @Override
-            public void windowClosing(WindowEvent event){
-                actionCancel();
-                return;
-            }
-        });
+        Desktop result = Desktop.getDesktop();
+        assert result != null;
 
-        return;
+        if( ! result.isSupported(Desktop.Action.BROWSE) ) return null;
+
+        return result;
     }
 
     /**
      * Webブラウザ起動用のモーダルダイアログを表示する。
+     *
      * @param owner オーナーフレーム
      * @param url URL文字列
      */
     public static void showDialog(Frame owner, String url){
-        WebIPCDialog dialog = new WebIPCDialog(owner);
+        WebIPCDialog dialog = createDialog(owner);
 
-        dialog.setTitle(TITLE_WWW);
         dialog.setUrlText(url);
+
         dialog.pack();
-        dialog.setLocationRelativeTo(owner);
         dialog.setVisible(true);
 
         return;
     }
 
     /**
+     * ダイアログを生成する。
+     *
+     * @param owner オーナーフレーム
+     * @return ダイアログ
+     */
+    protected static WebIPCDialog createDialog(Frame owner){
+        WebIPCDialog dialog = new WebIPCDialog(owner);
+
+        decorateDialog(dialog);
+        dialog.setLocationRelativeTo(owner);
+
+        return dialog;
+    }
+
+    /**
+     * ダイアログを装飾する。
+     *
+     * @param dialog ダイアログ
+     */
+    protected static void decorateDialog(WebIPCDialog dialog){
+        dialog.setResizable(true);
+        dialog.setLocationByPlatform(true);
+
+        dialog.setTitle(TITLE_WWW);
+
+        dialog.setModalityType(ModalityType.APPLICATION_MODAL);
+
+        return;
+    }
+
+    /**
      * 有効なURIか判定する。
+     *
      * @param uri URI
      * @return 有効ならtrue
      */
@@ -178,9 +201,8 @@ public class WebIPCDialog
         if( ! uri.isAbsolute() ) return false;
 
         String scheme = uri.getScheme();
-        if(scheme == null) return false;
-        if(    ! scheme.equalsIgnoreCase("http")
-            && ! scheme.equalsIgnoreCase("https") ) return false;
+        if(    ! "http".equalsIgnoreCase(scheme)
+            && ! "https".equalsIgnoreCase(scheme) ) return false;
 
         String host = uri.getHost();
         if(host == null) return false;
@@ -188,31 +210,94 @@ public class WebIPCDialog
         return true;
     }
 
+
+    /**
+     * URL表示部を構成する。
+     */
+    private void buildUrlLabel(){
+        Border inside =
+                BorderFactory.createEmptyBorder(1, 4, 1, 4);
+        Border outside =
+                BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
+        Border border =
+                BorderFactory.createCompoundBorder(outside, inside);
+
+        this.urltext.setBorder(border);
+
+        this.urltext.setEditable(false);
+        this.urltext.setLineWrap(true);
+        this.urltext.setComponentPopupMenu(new TextPopup());
+
+        Monodizer.monodize(this.urltext);
+
+        return;
+    }
+
+    /**
+     * ボタンを構成する。
+     */
+    private void buildEventCatcher(){
+        this.browse  .setActionCommand(CMD_BROWSE);
+        this.clipcopy.setActionCommand(CMD_CLIPCOPY);
+        this.cancel  .setActionCommand(CMD_CANCEL);
+
+        EventCatcher catcher = new EventCatcher();
+        this.browse  .addActionListener(catcher);
+        this.clipcopy.addActionListener(catcher);
+        this.cancel  .addActionListener(catcher);
+
+        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+        addWindowListener(catcher);
+
+        JRootPane pane = getRootPane();
+        pane.setDefaultButton(this.browse);
+        this.browse.requestFocusInWindow();
+
+        if(this.desktop == null){
+            this.browse.setToolTipText(MSG_NODESKTOP);
+        }
+
+        return;
+    }
+
+    /**
+     * DragAndDropラベルを構成する。
+     */
+    private void buildDnDLabel(){
+        this.dndLabel.setIcon(GUIUtils.getWWWIcon());
+        this.dndLabel.setHorizontalTextPosition(SwingConstants.LEFT);
+        this.dndLabel.setTransferHandler(new DnDHandler());
+        this.dndLabel.addMouseListener(DNDIGNITER);
+        return;
+    }
+
     /**
      * レイアウトを行う。
+     *
      * @param container レイアウトコンテナ
      */
     private void design(Container container){
         GridBagLayout layout = new GridBagLayout();
-        GridBagConstraints constraints = new GridBagConstraints();
         container.setLayout(layout);
 
-        JComponent buttonPanel = buildButtonPanel();
-
+        GridBagConstraints constraints = new GridBagConstraints();
         constraints.gridwidth = GridBagConstraints.REMAINDER;
         constraints.fill      = GridBagConstraints.HORIZONTAL;
         constraints.insets    = new Insets(5, 5, 5, 5);
 
-        container.add(this.info,   constraints);
+        JComponent buttonPanel = buildButtonPanel();
+
+        container.add(this.info,    constraints);
         container.add(this.urltext, constraints);
-        container.add(buttonPanel,    constraints);
-        container.add(this.cancel,   constraints);
+        container.add(buttonPanel,  constraints);
+        container.add(this.cancel,  constraints);
 
         return;
     }
 
     /**
      * ボタンパネルを生成する。
+     *
      * @return ボタンパネル
      */
     private JComponent buildButtonPanel(){
@@ -224,9 +309,10 @@ public class WebIPCDialog
         buttonPanel.setBorder(border);
 
         GridBagLayout layout = new GridBagLayout();
-        GridBagConstraints constraints = new GridBagConstraints();
         buttonPanel.setLayout(layout);
 
+        GridBagConstraints constraints = new GridBagConstraints();
+
         constraints.gridwidth = GridBagConstraints.REMAINDER;
         constraints.fill      = GridBagConstraints.HORIZONTAL;
         constraints.insets    = new Insets(3, 3, 3, 3);
@@ -243,20 +329,33 @@ public class WebIPCDialog
 
     /**
      * URL文字列を設定する。
+     *
      * @param url URL文字列
      */
     public void setUrlText(String url){
-        URI uriarg = null;
+        URI argUri;
         try{
-            uriarg = new URI(url);
+            argUri = new URI(url);
         }catch(URISyntaxException e){
-            // NOTHING
+            argUri = null;
         }
 
-        this.uri = uriarg;
-        if(this.uri == null) return;
+        setUri(argUri);
+
+        return;
+    }
 
-        if( ! isValidURI(this.uri) ) return;
+    /**
+     * URIを設定する。
+     *
+     * @param uriArg URI
+     */
+    public void setUri(URI uriArg){
+        if(isValidURI(uriArg)){
+            this.uri = uriArg;
+        }else{
+            this.uri = URI_EMPTY;
+        }
 
         String uriText = this.uri.toASCIIString();
         this.urltext.setText(uriText);
@@ -268,89 +367,76 @@ public class WebIPCDialog
     }
 
     /**
-     * ボタン押下リスナ。
-     * @param event ボタン押下イベント
+     * URIを返す。
+     *
+     * @return URI
      */
-    @Override
-    public void actionPerformed(ActionEvent event){
-        Object source = event.getSource();
-        if(source == this.browse){
-            actionBrowse();
-        }else if(source == this.clipcopy){
-            actionClipboardCopy();
-        }else if(source == this.cancel){
-            actionCancel();
+    public URI getURI(){
+        return this.uri;
+    }
+
+    /**
+     * WebブラウザでURLを表示。
+     *
+     * <p>ダイアログは必ず閉じられる。
+     */
+    protected void actionBrowse(){
+        try{
+            actionBrowseImpl();
+        }finally{
+            closeDialog();
         }
-        return;
     }
 
     /**
      * WebブラウザでURLを表示。
      */
-    private void actionBrowse(){
-        if(this.uri == null){
-            close();
+    private void actionBrowseImpl(){
+        if( ! isValidURI(this.uri) ){
             return;
         }
 
-        if(this.ipc == null){
-            String title;
-            if( ! JreChecker.has16Runtime() ){
-                title = "新しいJavaを入手しましょう";
-            }else{
-                title = "報告";
-            }
+        if(this.desktop == null){
+            String title = "報告";
             JOptionPane.showMessageDialog(
                     this,
-                    this.warnMessage, title,
+                    MSG_NODESKTOP, title,
                     JOptionPane.INFORMATION_MESSAGE);
             return;
         }
 
         try{
-            try{
-                this.ipc.browse(this.uri);
-            }catch(NullPointerException e){
-                assert false;
-            }catch(UnsupportedOperationException e){
-                // NOTHING
-            }catch(IOException e){
-                // NOTHING
-            }catch(SecurityException e){
-                // NOTHING
-            }catch(IllegalArgumentException e){
-                // NOTHING
-            }
-            String logmsg =   "URL "
-                            + this.uri.toASCIIString()
-                            + " へのアクセスをWebブラウザに指示しました";
-            LOGGER.info(logmsg);
-        }finally{
-            close();
+            this.desktop.browse(this.uri);
+        }catch(IOException e){
+            return;
         }
 
+        String uriText = this.uri.toASCIIString();
+        String logMessage =
+                MessageFormat.format(MSG_BROWSE, uriText);
+        LOGGER.info(logMessage);
+
         return;
     }
 
     /**
      * URLをクリップボードにコピーする。
      */
-    private void actionClipboardCopy(){
-        if(this.uri == null){
-            close();
+    protected void actionClipboardCopy(){
+        if( ! isValidURI(this.uri) ){
+            closeDialog();
             return;
         }
 
-        String uristring = this.uri.toASCIIString();
+        String uriText = this.uri.toASCIIString();
 
         try{
-            ClipboardAction.copyToClipboard(uristring);
-            String logmsg =  "文字列「"
-                           + uristring
-                           + "」をクリップボードにコピーしました";
-            LOGGER.info(logmsg);
+            ClipboardAction.copyToClipboard(uriText);
+            String logMessage =
+                    MessageFormat.format(MSG_CLIPCOPY, uriText);
+            LOGGER.info(logMessage);
         }finally{
-            close();
+            closeDialog();
         }
 
         return;
@@ -359,19 +445,81 @@ public class WebIPCDialog
     /**
      * 何もせずダイアログを閉じる。
      */
-    private void actionCancel(){
-        close();
+    protected void actionCancel(){
+        closeDialog();
         return;
     }
 
     /**
      * ダイアログを閉じる。
      */
-    private void close(){
+    protected void closeDialog(){
         setVisible(false);
+        dispose();
         return;
     }
 
+
+    /**
+     * イベント受信リスナ。
+     */
+    private class EventCatcher
+            extends WindowAdapter
+            implements ActionListener {
+
+        /**
+         * コンストラクタ。
+         */
+        EventCatcher(){
+            super();
+            return;
+        }
+
+        /**
+         * ボタン押下受信。
+         *
+         * <p>{@inheritDoc}
+         *
+         * @param event {@inheritDoc}
+         */
+        @Override
+        public void actionPerformed(ActionEvent event){
+            String cmd = event.getActionCommand();
+            if(cmd == null) return;
+
+            switch(cmd){
+            case CMD_BROWSE:
+                actionBrowse();
+                break;
+            case CMD_CLIPCOPY:
+                actionClipboardCopy();
+                break;
+            case CMD_CANCEL:
+                actionCancel();
+                break;
+            default:
+                break;
+            }
+
+            return;
+        }
+
+        /**
+         * ウィンドウクローズ受信。
+         *
+         * <p>{@inheritDoc}
+         *
+         * @param event {@inheritDoc}
+         */
+        @Override
+        public void windowClosing(WindowEvent event){
+            actionCancel();
+            return;
+        }
+
+    }
+
+
     /**
      * Drag&amp;Dropの転送処理を管理。
      */
@@ -380,14 +528,16 @@ public class WebIPCDialog
         /**
          * コンストラクタ。
          */
-        public DnDHandler(){
+        DnDHandler(){
             super();
             return;
         }
 
         /**
-         * {@inheritDoc}
          * コピー動作のみをサポートすることを伝える。
+         *
+         * <p>{@inheritDoc}
+         *
          * @param comp {@inheritDoc}
          * @return {@inheritDoc}
          */
@@ -397,54 +547,48 @@ public class WebIPCDialog
         }
 
         /**
-         * {@inheritDoc}
          * URIエクスポータを生成する。
-         * URIも指定される。
+         *
+         * <p>URIも指定される。
+         *
+         * <p>{@inheritDoc}
+         *
          * @param comp {@inheritDoc}
          * @return {@inheritDoc}
          */
         @Override
         protected Transferable createTransferable(JComponent comp){
-            UriExporter result = new UriExporter(WebIPCDialog.this.uri);
+            UriExporter result = new UriExporter(getURI());
             return result;
         }
 
         /**
-         * {@inheritDoc}
          * D&Dに成功したらダイアログを閉じる。
+         *
+         * <p>{@inheritDoc}
+         *
          * @param source {@inheritDoc}
          * @param data {@inheritDoc}
          * @param action {@inheritDoc}
          */
         @Override
         protected void exportDone(JComponent source,
-                                   Transferable data,
-                                   int action ){
+                                  Transferable data,
+                                  int action ){
             if(action == NONE) return;
 
-            String logmsg =   "URL "
-                            + WebIPCDialog.this.uri.toASCIIString()
-                            + " がどこかへドラッグ&ドロップされました";
+            String uriAscii = getURI().toASCIIString();
+            String logmsg = MessageFormat.format(MSG_DND, uriAscii);
             LOGGER.info(logmsg);
 
-            close();
+            closeDialog();
 
             return;
         }
 
-        /**
-         * {@inheritDoc}
-         * ※ SunのJRE1.6.0_11前後では、BugID 4816922のため決して呼ばれない。
-         * @param tx {@inheritDoc}
-         * @return {@inheritDoc}
-         */
-        @Override
-        public Icon getVisualRepresentation(Transferable tx){
-            return GUIUtils.getWWWIcon();
-        }
-
     }
 
+
     /**
      * ドラッグ開始イベント処理。
      */
@@ -453,21 +597,27 @@ public class WebIPCDialog
         /**
          * コンストラクタ。
          */
-        public DragIgniter(){
+        DragIgniter(){
             super();
             return;
         }
 
         /**
-         * {@inheritDoc}
          * ドラッグ開始イベント受信。
+         *
+         * <p>{@inheritDoc}
+         *
          * @param event {@inheritDoc}
          */
         @Override
         public void mousePressed(MouseEvent event){
-            JComponent comp = (JComponent) event.getSource();
+            Object source = event.getSource();
+            assert source instanceof JComponent;
+            JComponent comp = (JComponent) source;
+
             TransferHandler handler = comp.getTransferHandler();
             handler.exportAsDrag(comp, event, TransferHandler.COPY);
+
             return;
         }
 
index ddf348b..2a51110 100644 (file)
@@ -30,13 +30,9 @@ import java.util.concurrent.Future;
  * <li>任意の文字列を表示可能な全フォントを列挙すること
  * </ul>
  *
- * <p>
- * この二つをバックグラウンドで非同期に収集する。
- * </p>
+ * <p>この二つをバックグラウンドで非同期に収集する。
  *
- * <p>
- * 各種フォント環境収集メソッドの遅さをカバーするのが実装目的。
- * </p>
+ * <p>各種フォント環境収集メソッドの遅さをカバーするのが実装目的。
  */
 public class FontEnv {
 
@@ -45,9 +41,6 @@ public class FontEnv {
      */
     public static final FontEnv DEFAULT;
 
-    /** {@link java.awt.Font#DIALOG} 代替品。 */
-    private static final String FAMILY_DIALOG = "Dialog";
-
     /** フォントファミリ選択肢。 */
     private static final String[] INIT_FAMILY_NAMES = {
         "Hiragino Kaku Gothic Pro",  // for MacOS X
@@ -62,9 +55,6 @@ public class FontEnv {
     /** JIS X0208:1990 表示確認用文字列。 */
     private static final String JPCHECK_CODE = "あ凜熙峠ゑアアヴヰ┼ЖΩ9A";
 
-    /** {@link java.util.Locale#ROOT} 代替品。 */
-    private static final Locale LOCALE_ROOT = new Locale("", "", "");
-
     private static final int POOL_SZ = 2;
     private static final int STRIDE = 15;
 
@@ -82,7 +72,9 @@ public class FontEnv {
 
     /**
      * コンストラクタ。
-     * 完了と同時に裏でフォント情報収集タスクが走る。
+     *
+     * <p>完了と同時に裏でフォント情報収集タスクが走る。
+     *
      * @param proveChars 表示判定用文字列
      * @param fontFamilyList フォント候補
      * @throws NullPointerException 引数がnull
@@ -113,7 +105,9 @@ public class FontEnv {
 
     /**
      * コンストラクタ。
-     * 完了と同時に裏でフォント情報収集タスクが走る。
+     *
+     * <p>完了と同時に裏でフォント情報収集タスクが走る。
+     *
      * @param proveChars 表示判定用文字列
      * @param fontFamilyList フォント候補
      * @throws NullPointerException 引数がnull
@@ -166,6 +160,7 @@ public class FontEnv {
 
     /**
      * システムに存在する有効なファミリ名か判定する。
+     *
      * @param familyName フォントファミリ名。
      * @return 存在する有効なファミリ名ならtrue
      */
@@ -174,7 +169,7 @@ public class FontEnv {
         int size = 1;
         Font dummyFont = new Font(familyName, style, size);
 
-        String dummyFamilyName = dummyFont.getFamily(LOCALE_ROOT);
+        String dummyFamilyName = dummyFont.getFamily(Locale.ROOT);
         if(dummyFamilyName.equals(familyName)) return true;
 
         String dummyLocalFamilyName = dummyFont.getFamily();
@@ -185,12 +180,14 @@ public class FontEnv {
 
     /**
      * 複数の候補から利用可能なフォントを一つ選び、生成する。
-     * 候補から適当なファミリが見つからなかったら"Dialog"が選択される。
+     *
+     * <p>候補から適当なファミリが見つからなかったら"Dialog"が選択される。
+     *
      * @param fontList フォントファミリ名候補
      * @return フォント
      */
     protected static String availableFontFamily(Iterable<String> fontList){
-        String defaultFamilyName = FAMILY_DIALOG;
+        String defaultFamilyName = Font.DIALOG;
         for(String familyName : fontList){
             if(isValidFamilyName(familyName)){
                 defaultFamilyName = familyName;
@@ -204,6 +201,7 @@ public class FontEnv {
 
     /**
      * フォントファミリー名のリストを返す。
+     *
      * @return フォントファミリー名のリスト
      * @throws IllegalStateException 収集タスクに異常が発生
      */
@@ -212,9 +210,7 @@ public class FontEnv {
 
         try{
             result = this.listLoadFuture.get();
-        }catch(ExecutionException e){
-            throw new IllegalStateException(e);
-        }catch(InterruptedException e){
+        }catch(ExecutionException | InterruptedException e){
             throw new IllegalStateException(e);
         }
 
@@ -223,6 +219,7 @@ public class FontEnv {
 
     /**
      * 利用可能なフォントファミリ名を返す。
+     *
      * @return フォントファミリー名
      * @throws IllegalStateException 収集タスクに異常が発生
      */
@@ -231,9 +228,7 @@ public class FontEnv {
 
         try{
             result = this.fontSelectFuture.get();
-        }catch(ExecutionException e){
-            throw new IllegalStateException(e);
-        }catch(InterruptedException e){
+        }catch(ExecutionException | InterruptedException e){
             throw new IllegalStateException(e);
         }
 
@@ -256,6 +251,7 @@ public class FontEnv {
 
         /**
          * {@inheritDoc}
+         *
          * @return {@inheritDoc}
          */
         @Override
@@ -289,6 +285,7 @@ public class FontEnv {
 
         /**
          * {@inheritDoc}
+         *
          * @return {@inheritDoc}
          */
         @Override
index 293e274..e457832 100644 (file)
@@ -31,8 +31,6 @@ public class FontInfo{
     /** デフォルトのフォントスタイル。 */
     public static final int DEF_STYLE = 0x00 | Font.PLAIN;
 
-    /** {@link java.util.Locale#ROOT}代替品。 */
-    private static final Locale LOCALE_ROOT = new Locale("", "", "");
     /** MSリコー系日本語ベクトルフォント下限ポイントサイズ。 */
     private static final int MS_VEC_LIMIT = 24;
     /** 二重引用符。 */
@@ -53,7 +51,8 @@ public class FontInfo{
 
     /**
      * コンストラクタ。
-     * デフォルトフォントとそれに適した描画属性が指定される。
+     *
+     * <p>デフォルトフォントとそれに適した描画属性が指定される。
      */
     public FontInfo(){
         this((Font) null, (FontRenderContext) null);
@@ -62,6 +61,7 @@ public class FontInfo{
 
     /**
      * コンストラクタ。
+     *
      * @param font フォント
      * @param context 描画設定
      */
@@ -86,7 +86,7 @@ public class FontInfo{
      * @return 見当が付けばtrue
      */
     protected static boolean isMsRicohJpFont(Font font){
-        String rootFamilyName = font.getFamily(LOCALE_ROOT);
+        String rootFamilyName = font.getFamily(Locale.ROOT);
         if(rootFamilyName.startsWith("MS")){
             if(rootFamilyName.contains("Gothic")) return true;
             if(rootFamilyName.contains("Mincho")) return true;
@@ -145,6 +145,7 @@ public class FontInfo{
 
     /**
      * ファミリ名を返す。
+     *
      * @return ファミリ名
      */
     private String getFamilyName(){
@@ -161,6 +162,7 @@ public class FontInfo{
 
     /**
      * フォントを返す。
+     *
      * @return フォント
      */
     public Font getFont(){
@@ -173,6 +175,7 @@ public class FontInfo{
 
     /**
      * 描画属性を返す。
+     *
      * @return 描画属性
      */
     public FontRenderContext getFontRenderContext(){
@@ -185,6 +188,7 @@ public class FontInfo{
 
     /**
      * アンチエイリアス機能を使うか判定する。
+     *
      * @return アンチエイリアス機能を使うならtrue
      */
     public boolean isAntiAliased(){
@@ -195,6 +199,7 @@ public class FontInfo{
 
     /**
      * サブピクセル精度を使うか判定する。
+     *
      * @return サブピクセル精度を使うならtrue
      */
     public boolean usesFractionalMetrics(){
@@ -205,6 +210,7 @@ public class FontInfo{
 
     /**
      * フォントの最大寸法を返す。
+     *
      * @return 最大寸法
      * @see java.awt.Font#getMaxCharBounds(FontRenderContext)
      */
@@ -218,6 +224,7 @@ public class FontInfo{
 
     /**
      * フォントのみ異なる設定を派生させる。
+     *
      * @param newFont 新フォント
      * @return 新設定
      */
@@ -228,6 +235,7 @@ public class FontInfo{
 
     /**
      * 描画属性のみ異なる設定を派生させる。
+     *
      * @param newContext 新描画設定
      * @return 新設定
      */
@@ -238,6 +246,7 @@ public class FontInfo{
 
     /**
      * 描画属性のみ異なる設定を派生させる。
+     *
      * @param isAntiAliases アンチエイリアス設定
      * @param useFractional サブピクセル精度設定
      * @return 新設定
@@ -257,6 +266,7 @@ public class FontInfo{
 
     /**
      * 文字列からグリフ集合を生成する。
+     *
      * @param iterator 文字列
      * @return グリフ集合
      */
@@ -269,19 +279,23 @@ public class FontInfo{
 
     /**
      * ロケール中立なフォントファミリ名を返す。
-     * JRE1.5対策
+     *
+     * <p>JRE1.5対策
+     *
      * @return ファミリ名
      * @see Font#getFamily(Locale)
      */
     public String getRootFamilyName(){
         Font thisFont = getFont();
-        String result = thisFont.getFamily(LOCALE_ROOT);
+        String result = thisFont.getFamily(Locale.ROOT);
         return result;
     }
 
     /**
      * Font#decode()用の名前を返す。
-     * 空白が含まれる場合は二重引用符で囲まれる。
+     *
+     * <p>空白が含まれる場合は二重引用符で囲まれる。
+     *
      * @return {@link java.awt.Font#decode(String)}用の名前
      * @see java.awt.Font#decode(String)
      */
@@ -312,6 +326,7 @@ public class FontInfo{
 
     /**
      * {@inheritDoc}
+     *
      * @param obj {@inheritDoc}
      * @return {@inheritDoc}
      */
@@ -337,6 +352,7 @@ public class FontInfo{
 
     /**
      * {@inheritDoc}
+     *
      * @return {@inheritDoc}
      */
     @Override
index 222b726..87298d1 100644 (file)
@@ -40,7 +40,7 @@ public class FontSelectList extends JList<String>
     }
 
     /**
-     * {@link setModel(ListModel)} の下請けメソッド。
+     * {@link #setModel(ListModel)} の下請けメソッド。
      * 与えられたモデルの更新は監視対象となる。
      * @param model リストモデル
      */
index c52ed71..27a6733 100644 (file)
@@ -11,6 +11,7 @@ import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Point;
 import java.awt.Rectangle;
+import java.awt.RenderingHints;
 import java.io.IOException;
 import jp.osdn.jindolf.parser.content.DecodedContent;
 import jp.sfjp.jindolf.data.DialogPref;
@@ -211,6 +212,17 @@ public class SysEventDraw extends AbstractTextRow{
     public void paint(Graphics2D g){
         g.setColor(this.fgColor);
 
+        RenderingHints.Key aaHintKey = RenderingHints.KEY_ANTIALIASING;
+        Object aaHintTemp = RenderingHints.VALUE_ANTIALIAS_OFF;
+        Object aaHintOrig = g.getRenderingHint(aaHintKey);
+
+        RenderingHints.Key strokeHintKey = RenderingHints.KEY_STROKE_CONTROL;
+        Object strokeHintTemp = RenderingHints.VALUE_STROKE_NORMALIZE;
+        Object strokeHintOrig = g.getRenderingHint(strokeHintKey);
+
+        g.setRenderingHint(aaHintKey, aaHintTemp);
+        g.setRenderingHint(strokeHintKey, strokeHintTemp);
+
         if(this.dialogPref.isSimpleMode()){
             g.drawLine(this.bounds.x,                     this.bounds.y,
                        this.bounds.x + this.bounds.width, this.bounds.y );
@@ -221,6 +233,9 @@ public class SysEventDraw extends AbstractTextRow{
                        this.bounds.height - UNDER_MARGIN);
         }
 
+        g.setRenderingHint(aaHintKey, aaHintOrig);
+        g.setRenderingHint(strokeHintKey, strokeHintOrig);
+
         this.sysMessage.paint(g);
 
         return;
index b5f1e55..d6cbf2d 100644 (file)
@@ -494,8 +494,23 @@ public class TalkDraw extends AbstractTextRow{
         this.caption.paint(g);
 
         if(this.dialogPref.isSimpleMode() ){
+            RenderingHints.Key aaHintKey = RenderingHints.KEY_ANTIALIASING;
+            Object aaHintTemp = RenderingHints.VALUE_ANTIALIAS_OFF;
+            Object aaHintOrig = g.getRenderingHint(aaHintKey);
+
+            RenderingHints.Key strokeHintKey =
+                    RenderingHints.KEY_STROKE_CONTROL;
+            Object strokeHintTemp = RenderingHints.VALUE_STROKE_NORMALIZE;
+            Object strokeHintOrig = g.getRenderingHint(strokeHintKey);
+
+            g.setRenderingHint(aaHintKey, aaHintTemp);
+            g.setRenderingHint(strokeHintKey, strokeHintTemp);
+
             g.drawLine(xPos,                     this.bounds.y,
                        xPos + this.bounds.width, this.bounds.y );
+
+            g.setRenderingHint(aaHintKey, aaHintOrig);
+            g.setRenderingHint(strokeHintKey, strokeHintOrig);
         }else{
             g.drawImage(this.faceImage,
                         xPos + this.imageOrigin.x,
index 710c195..6c73628 100644 (file)
@@ -64,14 +64,11 @@ public class LoggingDispatcher extends EventQueue{
     protected void dispatchEvent(AWTEvent event){
         try{
             super.dispatchEvent(event);
-        }catch(RuntimeException e){
+        }catch(RuntimeException | Error e){
             logThrowable(e);
             throw e;
         }catch(Exception e){
             logThrowable(e);
-        }catch(Error e){
-            logThrowable(e);
-            throw e;
         }
         // TODO Toolkit#beep()もするべきか
         // TODO モーダルダイアログを出すべきか
index dc5f5d7..299afdc 100644 (file)
@@ -708,9 +708,7 @@ public class GameSummary{
                 URL url = new URL(urlText);
                 URI uri = url.toURI();
                 urlText = uri.toASCIIString();
-            }catch(MalformedURLException e){
-                // NOTHING
-            }catch(URISyntaxException e){
+            }catch(MalformedURLException | URISyntaxException e){
                 // NOTHING
             }
             // PukiWikiではURL内の&のエスケープは不要?
index 87d4526..8a25302 100644 (file)
@@ -201,7 +201,7 @@ public final class GUIUtils{
             return wwwIcon;
         }
 
-        wwwIcon = ResourceManager.getImageIcon(RES_WWWICON);
+        wwwIcon = ResourceManager.getSquareIcon(RES_WWWICON, 16);
 
         return wwwIcon;
     }
@@ -234,11 +234,10 @@ public final class GUIUtils{
 
         try{
             SwingUtilities.invokeAndWait(TASK_NOTHING);
-        }catch(InterruptedException e){
-            // IGNORE
-        }catch(InvocationTargetException e){
+        }catch(InterruptedException | InvocationTargetException e){
             // IGNORE
         }
+        // IGNORE
 
         return;
     }
index 1dced96..d54633a 100644 (file)
@@ -21,7 +21,8 @@ import javax.swing.text.JTextComponent;
 
 /**
  * Swingコンポーネントのフォント等幅化。
- * L&amp;F変更にも対処。
+ *
+ * <p>L&amp;F変更にも対処。
  */
 public final class Monodizer implements PropertyChangeListener{
 
@@ -29,11 +30,9 @@ public final class Monodizer implements PropertyChangeListener{
     public static final String PROPNAME_FONT = "font";
     /** L&amp;F変更時のプロパティ名。 */
     public static final String PROPNAME_UI = "UI";
-    /** Font.MONOSPACED代替品。 */
-    public static final String FAMILY_MONO = "Monospaced";
 
     private static final Map<TextAttribute, String> TEXTATTR_MONO =
-            Collections.singletonMap(TextAttribute.FAMILY, FAMILY_MONO);
+            Collections.singletonMap(TextAttribute.FAMILY, Font.MONOSPACED);
 
     private static final Monodizer CHANGER = new Monodizer();
 
@@ -49,6 +48,7 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * 等幅フォントか否か判定する。
+     *
      * @param font フォント
      * @return 等幅フォントならtrue
      */
@@ -59,14 +59,16 @@ public final class Monodizer implements PropertyChangeListener{
         if( ! (attr instanceof String) ) return false;
 
         String family = (String) attr;
-        if(family.equals(FAMILY_MONO)) return true;
+        if(family.equals(Font.MONOSPACED)) return true;
 
         return false;
     }
 
     /**
      * 任意のフォントの等幅化を行う。
-     * 等幅以外の属性は可能な限り保持する。
+     *
+     * <p>等幅以外の属性は可能な限り保持する。
+     *
      * @param font 任意のフォント
      * @return 等幅フォント
      */
@@ -77,7 +79,9 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * 任意のコンポーネントをフォント等幅化する。
-     * L&amp;F変更に対処するためのリスナ組み込みも行われる。
+     *
+     * <p>L&amp;F変更に対処するためのリスナ組み込みも行われる。
+     *
      * @param comp コンポーネント
      */
     public static void monodize(JComponent comp){
@@ -97,6 +101,7 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * コンポーネントに微修正を加える。
+     *
      * @param comp コンポーネント
      */
     private static void modifyComponent(JComponent comp){
@@ -113,6 +118,7 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * テキストコンポーネントへの微修正を行う。
+     *
      * @param textComp テキストコンポーネント
      */
     private static void modifyTextComponent(JTextComponent textComp){
@@ -126,6 +132,7 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * コンボボックスのエディタを等幅化する。
+     *
      * @param comboBox コンボボックス
      */
     private static void modifyComboBox(JComboBox<?> comboBox){
@@ -147,6 +154,7 @@ public final class Monodizer implements PropertyChangeListener{
 
     /**
      * フォント変更イベントの受信。
+     *
      * @param event フォント変更イベント
      */
     @Override
index 2865083..b7f8220 100644 (file)
@@ -122,22 +122,22 @@ public class ActionManager{
 
     static{
         ICON_FIND =
-            ResourceManager.getImageIcon("resources/image/tb_find.png");
+            ResourceManager.getButtonIcon("resources/image/tb_find.png");
 
         ICON_SEARCH_PREV =
-            ResourceManager.getImageIcon("resources/image/tb_findprev.png");
+            ResourceManager.getButtonIcon("resources/image/tb_findprev.png");
 
         ICON_SEARCH_NEXT =
-            ResourceManager.getImageIcon("resources/image/tb_findnext.png");
+            ResourceManager.getButtonIcon("resources/image/tb_findnext.png");
 
         ICON_RELOAD =
-            ResourceManager.getImageIcon("resources/image/tb_reload.png");
+            ResourceManager.getButtonIcon("resources/image/tb_reload.png");
 
         ICON_FILTER =
-            ResourceManager.getImageIcon("resources/image/tb_filter.png");
+            ResourceManager.getButtonIcon("resources/image/tb_filter.png");
 
         ICON_EDITOR =
-            ResourceManager.getImageIcon("resources/image/tb_editor.png");
+            ResourceManager.getButtonIcon("resources/image/tb_editor.png");
     }
 
     private final Set<AbstractButton> actionItems =
diff --git a/src/main/java/jp/sfjp/jindolf/view/FlexiIcon.java b/src/main/java/jp/sfjp/jindolf/view/FlexiIcon.java
new file mode 100644 (file)
index 0000000..a415476
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Flexible Icon
+ *
+ * License : The MIT License
+ * Copyright(c) 2018 olyutorskii
+ */
+
+package jp.sfjp.jindolf.view;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+/**
+ * 任意の寸法でイメージ描画を行うIcon。
+ *
+ * <p>Swingでのみサポート。
+ */
+public class FlexiIcon implements Icon{
+
+    private BufferedImage image = null;
+    private int iconWidth  = -1;
+    private int iconHeight = -1;
+
+
+    /**
+     * コンストラクタ。
+     *
+     * <p>イメージと寸法は未設定となる。
+     */
+    public FlexiIcon(){
+        this(null, -1, -1);
+        ImageIcon.class.hashCode();
+        VolatileImage.class.hashCode();
+        return;
+    }
+
+    /**
+     * コンストラクタ。
+     *
+     * <p>寸法はイメージから受け継がれる。
+     *
+     * @param image 描画イメージ
+     */
+    public FlexiIcon(BufferedImage image){
+        this(image, image.getWidth(), image.getHeight());
+        return;
+    }
+
+    /**
+     * コンストラクタ。
+     *
+     * @param image 描画イメージ
+     * @param width 幅
+     * @param height 高さ
+     */
+    public FlexiIcon(BufferedImage image, int width, int height){
+        super();
+        this.image = image;
+        this.iconWidth  = width;
+        this.iconHeight = height;
+        return;
+    }
+
+
+    /**
+     * 描画イメージを設定する。
+     *
+     * <p>寸法は変わらない。
+     *
+     * @param image 描画イメージ
+     */
+    public void setImage(BufferedImage image){
+        this.image = image;
+        return;
+    }
+
+    /**
+     * アイコン寸法の幅を設定する。
+     *
+     * @param width 幅
+     */
+    public void setIconWidth(int width){
+        this.iconWidth = width;
+        return;
+    }
+
+    /**
+     * アイコン寸法の高さを設定する。
+     *
+     * @param height 高さ
+     */
+    public void setIconHeight(int height){
+        this.iconHeight = height;
+        return;
+    }
+
+    /**
+     * アイコン寸法の幅を返す。
+     *
+     * @return 幅
+     */
+    @Override
+    public int getIconWidth(){
+        return this.iconWidth;
+    }
+
+    /**
+     * アイコン寸法の高さを返す。
+     *
+     * @return 高さ
+     */
+    @Override
+    public int getIconHeight(){
+        return this.iconHeight;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @param comp {@inheritDoc}
+     * @param g {@inheritDoc}
+     * @param x {@inheritDoc}
+     * @param y {@inheritDoc}
+     */
+    @Override
+    public void paintIcon(Component comp, Graphics g, int x, int y){
+        assert g instanceof Graphics2D;
+        Graphics2D g2 = (Graphics2D)g;
+
+        RenderingHints.Key hintKey = RenderingHints.KEY_INTERPOLATION;
+        Object hintVal = RenderingHints.VALUE_INTERPOLATION_BICUBIC;
+        g2.setRenderingHint(hintKey, hintVal);
+
+        g2.drawImage(
+                this.image,
+                x, y,
+                this.iconWidth, this.iconHeight,
+                comp
+        );
+
+        return;
+    }
+
+}
index 117a2e1..e663533 100644 (file)
@@ -13,7 +13,7 @@ import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
+import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JPanel;
@@ -41,14 +41,14 @@ public class LandsTree
     private static final String TIP_ASCEND = "押すと降順に";
     private static final String TIP_DESCEND = "押すと昇順に";
     private static final String TIP_ORDER = "選択中の国の村一覧を読み込み直す";
-    private static final ImageIcon ICON_ASCEND;
-    private static final ImageIcon ICON_DESCEND;
+    private static final Icon ICON_ASCEND;
+    private static final Icon ICON_DESCEND;
 
     static{
         ICON_ASCEND =
-            ResourceManager.getImageIcon("resources/image/tb_ascend.png");
+            ResourceManager.getButtonIcon("resources/image/tb_ascend.png");
         ICON_DESCEND =
-            ResourceManager.getImageIcon("resources/image/tb_descend.png");
+            ResourceManager.getButtonIcon("resources/image/tb_descend.png");
     }
 
     private final JButton orderButton = new JButton();
@@ -72,8 +72,8 @@ public class LandsTree
         this.orderButton.setActionCommand(ActionManager.CMD_SWITCHORDER);
         this.orderButton.addActionListener(this);
 
-        ImageIcon icon =
-                ResourceManager.getImageIcon("resources/image/tb_reload.png");
+        Icon icon = ResourceManager
+                .getButtonIcon("resources/image/tb_reload.png");
         this.reloadButton.setIcon(icon);
         this.reloadButton.setToolTipText(TIP_ORDER);
         this.reloadButton.setMargin(new Insets(1, 1, 1, 1));
index ed3999b..6f02fd0 100644 (file)
@@ -8,7 +8,7 @@
 package jp.sfjp.jindolf.view;
 
 import java.awt.Component;
-import javax.swing.ImageIcon;
+import javax.swing.Icon;
 import javax.swing.JTree;
 import javax.swing.tree.DefaultTreeCellRenderer;
 import jp.sfjp.jindolf.ResourceManager;
@@ -20,23 +20,25 @@ import jp.sfjp.jindolf.data.Village;
 @SuppressWarnings("serial")
 public class VillageIconRenderer extends DefaultTreeCellRenderer{
 
-    private static final ImageIcon ICON_PROLOGUE;
-    private static final ImageIcon ICON_PROGRESS;
-    private static final ImageIcon ICON_EPILOGUE;
-    private static final ImageIcon ICON_GAMEOVER;
-    private static final ImageIcon ICON_INVALID;
+    private static final Icon ICON_PROLOGUE;
+    private static final Icon ICON_PROGRESS;
+    private static final Icon ICON_EPILOGUE;
+    private static final Icon ICON_GAMEOVER;
+    private static final Icon ICON_INVALID;
+
+    private static final int MARK_SZ = 16;
 
     static{
-        ICON_PROLOGUE =
-            ResourceManager.getImageIcon("resources/image/vs_prologue.png");
-        ICON_PROGRESS =
-            ResourceManager.getImageIcon("resources/image/vs_progress.png");
-        ICON_EPILOGUE =
-            ResourceManager.getImageIcon("resources/image/vs_epilogue.png");
-        ICON_GAMEOVER =
-            ResourceManager.getImageIcon("resources/image/vs_gameover.png");
-        ICON_INVALID =
-            ResourceManager.getImageIcon("resources/image/vs_cross.png");
+        ICON_PROLOGUE = ResourceManager
+                .getSquareIcon("resources/image/vs_prologue.png", MARK_SZ);
+        ICON_PROGRESS = ResourceManager
+                .getSquareIcon("resources/image/vs_progress.png", MARK_SZ);
+        ICON_EPILOGUE = ResourceManager
+                .getSquareIcon("resources/image/vs_epilogue.png", MARK_SZ);
+        ICON_GAMEOVER = ResourceManager
+                .getSquareIcon("resources/image/vs_gameover.png", MARK_SZ);
+        ICON_INVALID = ResourceManager
+                .getSquareIcon("resources/image/vs_cross.png", MARK_SZ);
     }
 
     /**
@@ -70,7 +72,7 @@ public class VillageIconRenderer extends DefaultTreeCellRenderer{
             boolean hasFocus ){
         if(leaf && value instanceof Village){
             Village village = (Village) value;
-            ImageIcon icon = null;
+            Icon icon = null;
             switch(village.getState()){
             case PROLOGUE: icon = ICON_PROLOGUE; break;
             case PROGRESS: icon = ICON_PROGRESS; break;
index c06f9af..b8343d0 100644 (file)
@@ -48,10 +48,6 @@ Jindolfは、人狼BBSを閲覧するために開発された、GUIを利用す
 -?
     このヘルプ表示を出力して即時終了する。
 
--nosplash
-    スプラッシュ画面を表示しない。
-    ※JRE1.5以前のJava実行系のみ有効
-
 -version
     バージョン情報を出力して即時終了する。
 
index dd1d58c..9b6eaac 100644 (file)
@@ -8,7 +8,6 @@
 
 <html lang="ja-JP">
     <head>
-        <meta http-equiv="Content-Style-Type" content="text/css">
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Jindolf ヘルプ</title>
         <link rel="stylesheet" type="text/css" href="./help.css">
             J i n d o l f ヘ ル プ
         </div>
         <div class="centering">
-            <img src="../image/logo.png">
+            <img src="../image/logo.png" alt="logo">
         </div>
         <div>
             <h1>Jindolfとは</h1>
             <p>
                 人狼BBSっていうのは、
-                インターネットを介してWebブラウザで遊ぶ、
-                今最高にナウくてCoolなCGIゲームなんだ。
+                昔から「人狼」の名で知られているパーティーゲームが
+                Webブラウザで遊べるようになったWebサイトなんだ。
             </p>
             <p>
                 Jindolfは、
@@ -33,8 +32,9 @@
                 専用のプログラムだよ。
             </p>
             <p>
-                今、巷で大ブームのリッチクライアントってやつだね!
-                これならママも安心さ!
+                Jindolf開発から10年経って、
+                先行きが不透明になってきたJavaクライアントアプリ界隈だけど、
+                もう少しの間、頑張るよ!
             </p>
         </div>
         <div>
index d04c153..537858d 100644 (file)
@@ -8,7 +8,6 @@
 
 <html lang="ja-JP">
     <head>
-        <meta http-equiv="Content-Style-Type" content="text/css">
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Jindolf キーアサイン</title>
         <link rel="stylesheet" type="text/css" href="./help.css">
index 9e739d8..2028858 100644 (file)
@@ -8,7 +8,6 @@
 
 <html lang="ja-JP">
     <head>
-        <meta http-equiv="Content-Style-Type" content="text/css">
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Jindolf ライセンス表記</title>
         <link rel="stylesheet" type="text/css" href="./help.css">
index 019599f..fe3cada 100644 (file)
@@ -8,7 +8,6 @@
 
 <html lang="ja-JP">
     <head>
-        <meta http-equiv="Content-Style-Type" content="text/css">
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Jindolf 起動オプション一覧</title>
         <link rel="stylesheet" type="text/css" href="./help.css">
@@ -64,9 +63,6 @@
                 <dt>--help</dt>
                 <dt>-?</dt>
                 <dd>ヘルプ表示を出力して即時終了する。</dd>
-                <dt>-nosplash</dt>
-                <dd>スプラッシュ画面を表示しない。<br>
-                ※JRE1.5以前のJava実行系のみ有効</dd>
                 <dt>-version</dt>
                 <dd>バージョン情報を出力して即時終了する。</dd>
                 <dt>-vminfo</dt>
index e16cdf7..0d6f9d8 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_ascend.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_ascend.png differ
index 3837b00..d52eec7 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_descend.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_descend.png differ
index ce956a1..87c95c7 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_editor.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_editor.png differ
index 33e9dff..30344d4 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_filter.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_filter.png differ
index f2ce100..c6b080c 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_find.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_find.png differ
index 4ba1d1b..df2d4e4 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_findnext.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_findnext.png differ
index cb0b7bc..f52d2e6 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_findprev.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_findprev.png differ
index 987633e..30ae4f0 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/tb_reload.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/tb_reload.png differ
index 4dcac30..2057298 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/vs_cross.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/vs_cross.png differ
index 0c4deaf..c8742bd 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/vs_epilogue.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/vs_epilogue.png differ
index 773e640..8c32420 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/vs_gameover.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/vs_gameover.png differ
index 0851575..52fcd8b 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/vs_progress.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/vs_progress.png differ
index 3aa4695..34c51d8 100644 (file)
Binary files a/src/main/resources/jp/sfjp/jindolf/resources/image/vs_prologue.png and b/src/main/resources/jp/sfjp/jindolf/resources/image/vs_prologue.png differ
index b8adca2..468e72f 100644 (file)
@@ -50,7 +50,7 @@ public class CmdOptionTest {
 
         CmdOption[] values = CmdOption.values();
 
-        assertEquals(12, values.length);
+        assertEquals(11, values.length);
 
         List<CmdOption> list = Arrays.asList(values);
 
@@ -58,7 +58,6 @@ public class CmdOptionTest {
         testList.add(CmdOption.OPT_HELP);
         testList.add(CmdOption.OPT_VERSION);
         testList.add(CmdOption.OPT_BOLDMETAL);
-        testList.add(CmdOption.OPT_NOSPLASH);
         testList.add(CmdOption.OPT_GEOMETRY);
         testList.add(CmdOption.OPT_VMINFO);
         testList.add(CmdOption.OPT_CONSOLELOG);
@@ -151,7 +150,6 @@ public class CmdOptionTest {
 
         assertTrue(CmdOption.OPT_VERSION.matches("-version"));
         assertTrue(CmdOption.OPT_BOLDMETAL.matches("-boldMetal"));
-        assertTrue(CmdOption.OPT_NOSPLASH.matches("-nosplash"));
         assertTrue(CmdOption.OPT_GEOMETRY.matches("-geometry"));
         assertTrue(CmdOption.OPT_VMINFO.matches("-vminfo"));
         assertTrue(CmdOption.OPT_CONSOLELOG.matches("-consolelog"));
@@ -177,7 +175,6 @@ public class CmdOptionTest {
             case OPT_VERSION:
             case OPT_VMINFO:
             case OPT_BOLDMETAL:
-            case OPT_NOSPLASH:
             case OPT_CONSOLELOG:
             case OPT_NOCONF:
                 assertTrue(opt.isIndepOption());
@@ -223,7 +220,6 @@ public class CmdOptionTest {
         assertEquals("-help", CmdOption.OPT_HELP.toString());
         assertEquals("-version", CmdOption.OPT_VERSION.toString());
         assertEquals("-boldMetal", CmdOption.OPT_BOLDMETAL.toString());
-        assertEquals("-nosplash", CmdOption.OPT_NOSPLASH.toString());
         assertEquals("-geometry", CmdOption.OPT_GEOMETRY.toString());
         assertEquals("-vminfo", CmdOption.OPT_VMINFO.toString());
         assertEquals("-consolelog", CmdOption.OPT_CONSOLELOG.toString());