OSDN Git Service

add install interface in GUI mode
authortama3 <tama3@acee48c3-7b26-0410-bdac-b3d0e5314bbc>
Mon, 22 Dec 2008 03:54:51 +0000 (03:54 +0000)
committertama3 <tama3@acee48c3-7b26-0410-bdac-b3d0e5314bbc>
Mon, 22 Dec 2008 03:54:51 +0000 (03:54 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/stigmata/trunk@361 acee48c3-7b26-0410-bdac-b3d0e5314bbc

12 files changed:
src/main/java/jp/sourceforge/stigmata/StigmataCommand.java
src/main/java/jp/sourceforge/stigmata/command/AbstractStigmataCommand.java
src/main/java/jp/sourceforge/stigmata/command/InstallCommand.java
src/main/java/jp/sourceforge/stigmata/ui/swing/StigmataFrame.java
src/main/resources/resources/about.html
src/main/resources/resources/about.html.ja
src/main/resources/resources/images/cup_add.png [new file with mode: 0755]
src/main/resources/resources/images/cup_delete.png [new file with mode: 0755]
src/main/resources/resources/images/script_add.png [deleted file]
src/main/resources/resources/images/script_delete.png [deleted file]
src/main/resources/resources/messages.properties
src/main/resources/resources/messages_ja.source

index 321d28d..ac828ad 100644 (file)
@@ -1,10 +1,21 @@
 package jp.sourceforge.stigmata;
 
+/*
+ * $Id$
+ */
+
+/**
+ *
+ * @author Haruaki Tamada
+ * @version $Revision$
+ */
 public interface StigmataCommand{
     public boolean isAvailableArguments(String[] args);
 
     public void perform(Stigmata stigmata, BirthmarkContext context, String[] args);
 
+    public void perform(Stigmata stigmata, String[] args);
+
     public void setUp(BirthmarkEnvironment env);
 
     public void tearDown(BirthmarkEnvironment env);
index fd2a4dd..931f7a5 100644 (file)
@@ -4,6 +4,7 @@ package jp.sourceforge.stigmata.command;
  * $Id$
  */
 
+import jp.sourceforge.stigmata.Stigmata;
 import jp.sourceforge.stigmata.BirthmarkEnvironment;
 import jp.sourceforge.stigmata.StigmataCommand;
 import jp.sourceforge.stigmata.hook.Phase;
@@ -15,6 +16,13 @@ import jp.sourceforge.stigmata.hook.StigmataHookManager;
  * @version $Revision$
  */
 public abstract class AbstractStigmataCommand implements StigmataCommand{
+    /**
+     * {@link perform(Stigmata, BirthmarkContext, String[]) <code>perform(stigmata, stigmata.createContext(), args)</code>}.
+     */
+    public void perform(Stigmata stigmata, String[] args){
+        perform(stigmata, stigmata.createContext(), args);
+    }
+
     public boolean isAvailableArguments(String[] args){
         return true;
     }
index aa8ca7e..b1d04d4 100644 (file)
@@ -43,7 +43,8 @@ public class InstallCommand extends AbstractStigmataCommand{
             }
             if(pluginDest.exists()){
                 String override = env.getProperty("override.exists.plugin");
-                if(override != null && (override.equalsIgnoreCase("true") || override.equalsIgnoreCase("yes"))){
+                if(override != null &&
+                   (override.equalsIgnoreCase("true") || override.equalsIgnoreCase("yes"))){
                     pluginDest.delete();
                 }
                 else{
index c370fe1..c8742b4 100644 (file)
@@ -52,6 +52,8 @@ import jp.sourceforge.stigmata.ComparisonResultSet;
 import jp.sourceforge.stigmata.ExtractionResultSet;
 import jp.sourceforge.stigmata.Main;
 import jp.sourceforge.stigmata.Stigmata;
+import jp.sourceforge.stigmata.StigmataCommand;
+import jp.sourceforge.stigmata.command.StigmataCommandFactory;
 import jp.sourceforge.stigmata.event.BirthmarkEngineAdapter;
 import jp.sourceforge.stigmata.event.BirthmarkEngineEvent;
 import jp.sourceforge.stigmata.event.WarningMessages;
@@ -407,7 +409,7 @@ public class StigmataFrame extends JFrame{
 
     private void clearSettings(){
         Utility.deleteDirectory(new File(BirthmarkEnvironment.getStigmataHome()));
-        reloadSettings(new String[] { "--reset-config", "--mode", "gui", });
+        reloadSettings(new String[] { "--reset-config", "gui", });
     }
 
     private void initLayouts(){
@@ -440,6 +442,34 @@ public class StigmataFrame extends JFrame{
         }
     }
 
+    private void installPlugin(){
+        File pluginFile = getOpenFile(
+            new String[] { "jar", },
+            messages.get("installplugin.fileopen.description")
+        );
+        if(pluginFile != null && pluginFile.exists()){
+            StigmataCommandFactory factory = StigmataCommandFactory.getInstance();
+            StigmataCommand command = factory.getCommand("install");
+            String path = pluginFile.getPath();
+            command.perform(getStigmata(), new String[] { path });
+        }
+
+        int flag = JOptionPane.showConfirmDialog(
+            this, getMessages().get("reload.after.installplugin"),
+            getMessages().get("reload.after.installplugin.title"),
+            JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE
+        );
+
+        if(flag == JOptionPane.YES_OPTION){
+            reloadSettings(new String[] { "gui", });
+        }
+        else{
+            JOptionPane.showMessageDialog(
+                this, getMessages().get("reload.manually")
+            );
+        }
+    }
+
     private void initComponents(){
         setDefaultUI();
         JMenuBar menubar = new JMenuBar();
@@ -490,6 +520,7 @@ public class StigmataFrame extends JFrame{
         JMenuItem exportMenu = GUIUtility.createJMenuItem(getMessages(), "exportsetting");
         JMenuItem clearMenu = GUIUtility.createJMenuItem(getMessages(), "clearsetting");
         JMenuItem refreshMenu = GUIUtility.createJMenuItem(getMessages(), "refreshsetting");
+        JMenuItem installMenu = GUIUtility.createJMenuItem(getMessages(), "installplugin");
         JMenuItem closeTabMenu = GUIUtility.createJMenuItem(getMessages(), "closetab");
         JMenuItem closeMenu = GUIUtility.createJMenuItem(getMessages(), "closeframe");
         JMenuItem exitMenu = GUIUtility.createJMenuItem(getMessages(), "exit");
@@ -504,6 +535,8 @@ public class StigmataFrame extends JFrame{
         fileMenu.add(refreshMenu);
         fileMenu.add(clearMenu);
         fileMenu.add(new JSeparator());
+        fileMenu.add(installMenu);
+        fileMenu.add(new JSeparator());
         fileMenu.add(closeTabMenu);
         fileMenu.add(closeMenu);
         fileMenu.add(new JSeparator());
@@ -539,9 +572,14 @@ public class StigmataFrame extends JFrame{
                 clearSettings();
             }
         });
+        installMenu.addActionListener(new ActionListener(){
+            public void actionPerformed(ActionEvent evt){
+                installPlugin();
+            }
+        });
         refreshMenu.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent evt){
-                reloadSettings(new String[] { "--mode", "gui", });
+                reloadSettings(new String[] { "gui", });
             }
         });
 
index 5ba387c..5b8d4ff 100755 (executable)
@@ -4,28 +4,34 @@
 Stigmata version: ${implementation.version}\r
 </p><p>\r
 Copyright (C) by Haruaki Tamada, Ph.D.,\r
-${implementation.vendor} 2004-2007,\r
+${implementation.vendor} 2004-2008,\r
 All right reserved.\r
 </p><p>\r
 Latest version is available at\r
 <a href="http://stigmata.sourceforge.jp/">http://stigmata.sourceforge.jp/</a>.\r
-Stigmata is developed on Java SE 5.\r
+Stigmata is developed on Java SE 6.\r
 </p>\r
 <h2>Dependencies</h2>\r
-Stigmata uses ASM library for engineering Java bytecode.<br>\r
+Stigmata uses ASM 3.1 for engineering Java bytecode.<br>\r
 <a href="http://asm.objectweb.org/">http://asm.objectweb.org/</a>\r
 </p><p>\r
-Stigmata uses libraries developed by Apache Software Foundation.<br>\r
+Stigmata uses following libraries developed by Apache Software Foundation.<br>\r
 <a href="http://www.apache.org/">http://www.apache.org/</a>\r
-</p><p>\r
+</p>\r
+<ul>\r
+  <li><a href="http://commons.apache.org/cli">CLI 1.1</a></li>\r
+  <li><a href="http://commons.apache.org/beanutils">Bean Utils 1.7.0</a></li>\r
+  <li><a href="http://commons.apache.org/dbutils">DBUtils 1.1</a></li>\r
+  <li><a href="http://commons.apache.org/logging">Commons Logging 1.0.3</a></li>\r
+</ul>\r
+<p>\r
 Stigmata uses Jama (Java matrix package) in calculating MDS.<br>\r
 <a href="http://math.nist.gov/javanumerics/jama/">http://math.nist.gov/javanumerics/jama/</a>\r
 </p><p>\r
-Stigmata uses BrowserLauncher2 for showing clicked URL in browser<br>\r
-<a href="http://browserlaunch2.sourceforge.net/">http://browserlaunch2.sourceforge.net/</a>\r
-</p><p>\r
 Stigmata uses icons provided by FAMFAMFAM.<br>\r
 <a href="http://www.famfamfam.com/">http://www.famfamfam.com/</a>\r
+</p>\r
+\r
 <h2>License &amp; Copyright</h2>\r
 Copyright 2004-2007 Haruaki Tamada\r
 </p><p>\r
index b886006..93b9293 100755 (executable)
@@ -4,38 +4,44 @@
 Stigmata \83o\81[\83W\83\87\83\93: ${implementation.version}\r
 </p><p>\r
 Copyright (C) by Haruaki Tamada, Ph.D.,\r
-${implementation.vendor} 2004-2007,\r
+${implementation.vendor} 2004-2008,\r
 All right reserved.\r
 </p><p>\r
 Stigmata \82Ì\8dÅ\90V\83o\81[\83W\83\87\83\93\82Í\r
 <a href="http://stigmata.sourceforge.jp/">http://stigmata.sourceforge.jp/</a>\r
-\82©\82ç\8eæ\93¾\89Â\94\\82Å\82·\81D\82Ü\82½\81CStigmata \82Í Java SE 5 \82Å\8aJ\94­\82³\82ê\82Ä\82¢\82Ü\82·\81D\r
+\82©\82ç\8eæ\93¾\89Â\94\\82Å\82·\81D\82Ü\82½\81CStigmata \82Í Java SE 6 \82Å\8aJ\94­\82³\82ê\82Ä\82¢\82Ü\82·\81D\r
 </p>\r
 <h2>\88Ë\91\83\89\83C\83u\83\89\83\8a</h2>\r
-Stigmata\82Í Java \83o\83C\83g\83R\81[\83h\82ð\88µ\82¤\82½\82ß\81CASM\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
+Stigmata\82Í Java \83o\83C\83g\83R\81[\83h\82ð\88µ\82¤\82½\82ß\81CASM 3.1\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
 <a href="http://asm.objectweb.org/">http://asm.objectweb.org/</a>\r
 </p><p>\r
-Stigmata\82ÍApache Software Foundation\82ª\8aJ\94­\82µ\82½\82¢\82­\82Â\82©\82Ì\83\89\83C\83u\83\89\83\8a\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
+Stigmata\82ÍApache Software Foundation\82ª\8aJ\94­\82µ\82½\88È\89º\82Ì\83\89\83C\83u\83\89\83\8a\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
 <a href="http://www.apache.org/">http://www.apache.org/</a>\r
-</p><p>\r
+</p>\r
+<ul>\r
+  <li><a href="http://commons.apache.org/cli">CLI 1.1</a></li>\r
+  <li><a href="http://commons.apache.org/beanutils">Bean Utils 1.7.0</a></li>\r
+  <li><a href="http://commons.apache.org/dbutils">DBUtils 1.1</a></li>\r
+  <li><a href="http://commons.apache.org/logging">Commons Logging 1.0.3</a></li>\r
+</ul>\r
+<p>\r
+<p>\r
 Stigmata\82ÍMDS(Multi-Dimensional Scaling)\82Ì\8cv\8eZ\82Ì\82½\82ß\82ÉJama (Java matrix package)\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
 <a href="http://math.nist.gov/javanumerics/jama/">http://math.nist.gov/javanumerics/jama/</a>\r
 </p><p>\r
-Stigmata\82ÍURL\83\8a\83\93\83N\82ð\83u\83\89\83E\83U\82É\95\\8e¦\82³\82¹\82é\82½\82ß\81CBrowserLauncher2\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
-<a href="http://browserlaunch2.sourceforge.net/">http://browserlaunch2.sourceforge.net/</a>\r
-</p><p>\r
 Stigmata\82ÍFAMFAMFAM\82ª\92ñ\8b\9f\82µ\82Ä\82¢\82é\83A\83C\83R\83\93\82ð\97\98\97p\82µ\82Ä\82¢\82Ü\82·\81D<br>\r
 <a href="http://www.famfamfam.com/">http://www.famfamfam.com/</a>\r
 </p>\r
+\r
 <h2>\83\89\83C\83Z\83\93\83X&amp;\92\98\8dì\8c </h2>\r
 <p>\r
-Copyright 2004-2007 \8bÊ\93\8ft\8fº (Haruaki Tamada)\r
+Copyright 2004-2008 \8bÊ\93\8ft\8fº (Haruaki Tamada)\r
 </p><p>\r
 Apache License Version 2.0\81i\81u\96{\83\89\83C\83Z\83\93\83X\81v\81j\82É\8aî\82Ã\82¢\82Ä\83\89\83C\83Z\83\93\83X\82³\82ê\82Ü\82·\81B\82 \82È\82½\82ª\82±\82Ì\83t\83@\83C\83\8b\82ð\8eg\97p\82·\82é\82½\82ß\82É\82Í\81A\96{\83\89\83C\83Z\83\93\83X\82É\8f]\82í\82È\82¯\82ê\82Î\82È\82è\82Ü\82¹\82ñ\81B\96{\83\89\83C\83Z\83\93\83X\82Ì\83R\83s\81[\82Í\89º\8bL\82Ì\8fê\8f\8a\82©\82ç\93ü\8eè\82Å\82«\82Ü\82·\81B\r
 </p><p>\r
 <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>\r
 </p><p>\r
-\93K\97p\82³\82ê\82é\96@\97¥\82Ü\82½\82Í\8f\91\96Ê\82Å\82Ì\93¯\88Ó\82É\82æ\82Á\82Ä\96½\82\82ç\82ê\82È\82¢\8cÀ\82è\81A\96{\83\89\83C\83Z\83\93\83X\82É\8aî\82Ã\82¢\82Ä\94Ð\95z\82³\82ê\82é\83\\83t\83g\83E\83F\83A\82Í\81A\96¾\8e¦\96Ù\8e¦\82ð\96â\82í\82¸\81A\82¢\82©\82È\82é\95Û\8fØ\82à\8fð\8c\8f\82à\82È\82µ\82É\81u\8c»\8fó\82Ì\82Ü\82Ü\81v\94Ð\95z\82³\82ê\82Ü\82·\81B\96{\83\89\83C\83Z\83\93\83X\82Å\82Ì\8c \97\98\82Æ\90§\8cÀ\82ð\8bK\92è\82µ\82½\95\8c¾\82É\82Â\82¢\82Ä\82Í\81A\96{\83\89\83C\83Z\83\93\83X\82ð\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B \r
+\93K\97p\82³\82ê\82é\96@\97¥\82Ü\82½\82Í\8f\91\96Ê\82Å\82Ì\93¯\88Ó\82É\82æ\82Á\82Ä\96½\82\82ç\82ê\82È\82¢\8cÀ\82è\81A\96{\83\89\83C\83Z\83\93\83X\82É\8aî\82Ã\82¢\82Ä\94Ð\95z\82³\82ê\82é\83\\83t\83g\83E\83F\83A\82Í\81A\96¾\8e¦\96Ù\8e¦\82ð\96â\82í\82¸\81A\82¢\82©\82È\82é\95Û\8fØ\82à\8fð\8c\8f\82à\82È\82µ\82É\81u\8c»\8fó\82Ì\82Ü\82Ü\81v\94Ð\95z\82³\82ê\82Ü\82·\81B\96{\83\89\83C\83Z\83\93\83X\82Å\82Ì\8c \97\98\82Æ\90§\8cÀ\82ð\8bK\92è\82µ\82½\95\8c¾\82É\82Â\82¢\82Ä\82Í\81A\96{\83\89\83C\83Z\83\93\83X\82ð\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B\r
 </p>\r
 \r
 </body>\r
diff --git a/src/main/resources/resources/images/cup_add.png b/src/main/resources/resources/images/cup_add.png
new file mode 100755 (executable)
index 0000000..4ecaece
Binary files /dev/null and b/src/main/resources/resources/images/cup_add.png differ
diff --git a/src/main/resources/resources/images/cup_delete.png b/src/main/resources/resources/images/cup_delete.png
new file mode 100755 (executable)
index 0000000..59a6d9c
Binary files /dev/null and b/src/main/resources/resources/images/cup_delete.png differ
diff --git a/src/main/resources/resources/images/script_add.png b/src/main/resources/resources/images/script_add.png
deleted file mode 100755 (executable)
index d650552..0000000
Binary files a/src/main/resources/resources/images/script_add.png and /dev/null differ
diff --git a/src/main/resources/resources/images/script_delete.png b/src/main/resources/resources/images/script_delete.png
deleted file mode 100755 (executable)
index e6500ce..0000000
Binary files a/src/main/resources/resources/images/script_delete.png and /dev/null differ
index 77c4df2..349ff96 100755 (executable)
@@ -44,6 +44,15 @@ newframe.menuitem.label=New Frame
 newframe.menuitem.tooltip=Create New Frame\r
 newframe.menuitem.icon=application_add.png\r
 \r
+installplugin.menuitem.label=Install Plugin...\r
+installplugin.menuitem.tooltip=Install stigmata plugin\r
+installplugin.menuitem.icon=cup_add.png\r
+installplugin.fileopen.description=Stigmata plugin jar file.\r
+reload.after.installplugin=Finish plugin installation.\r
+To use installed plugin, restart Stigmata for using installed plugin.\r
+reload.after.installplugin.title=Restart Stigmata NOW?\r
+reload.manually=Restart stigmata manualy.\r
+\r
 savesetting.menuitem.label=Save settings\r
 savesetting.menuitem.tooltip=Save current settings\r
 savesetting.menuitem.icon=page_save.png\r
@@ -437,10 +446,10 @@ definition.tab.tooltip=Define new birthmarks
 \r
 removeservice.button.label=Remove\r
 removeservice.button.tooltip=Remove selected service from context\r
-removeservice.button.icon=script_delete.png\r
+removeservice.button.icon=cup_delete.png\r
 newservice.button.label=New service\r
 newservice.button.tooltip=Add new service to context\r
-newservice.button.icon=script_add.png\r
+newservice.button.icon=cup_add.png\r
 \r
 define.type.tooltip=Used for distinguishing other birthmarks\r
 define.type.border=Birthmark type\r
index d749388..a6869ce 100755 (executable)
@@ -34,6 +34,13 @@ fileMenu.menu.label=
 newframe.menuitem.label=\90V\8bK\83t\83\8c\81[\83\80\r
 newframe.menuitem.tooltip=\90V\82µ\82¢\83t\83\8c\81[\83\80\82ð\8dì\90¬\82µ\82Ü\82·\r
 \r
+installplugin.menuitem.label=\83v\83\89\83O\83C\83\93\82Ì\83C\83\93\83X\83g\81[\83\8b...\r
+installplugin.menuitem.tooltip=Stigmata\82Ì\83v\83\89\83O\83C\83\93\82ð\83C\83\93\83X\83g\81[\83\8b\82µ\82Ü\82·\81D\r
+installplugin.fileopen.description=Stigmata\82Ì\83v\83\89\83O\83C\83\93jar\83t\83@\83C\83\8b\r
+reload.after.installplugin=<html><body><p>\83v\83\89\83O\83C\83\93\82Ì\83C\83\93\83X\83g\81[\83\8b\82Í\8fI\97¹\82µ\82Ü\82µ\82½\81D<br>\83C\83\93\83X\83g\81[\83\8b\82µ\82½\83v\83\89\83O\83C\83\93\82ð\8eg\82¤\82½\82ß\82É\82Í\81CStigmata\82ð\8dÄ\8bN\93®\82·\82é\95K\97v\82ª\82 \82è\82Ü\82·\81D<br>\8dÄ\8bN\93®\82µ\82Ü\82·\82©\81D</p></body></html>\r
+reload.after.installplugin.title=Stigmata\82Ì\8dÄ\8bN\93®\r
+reload.manually=\83C\83\93\83X\83g\81[\83\8b\82µ\82½\83v\83\89\83O\83C\83\93\82ÍStigmata\82Ì\8dÄ\8bN\93®\8cã\81C\8eg\82¦\82é\82æ\82¤\82É\82È\82è\82Ü\82·\81D\r
+\r
 savesetting.menuitem.label=\90Ý\92è\82ð\95Û\91\r
 savesetting.menuitem.tooltip=\8c»\8dÝ\82Ì\90Ý\92è\82ð\95Û\91\82µ\82Ü\82·\r
 \r