OSDN Git Service

meven
[hayashilib/hayashi.git] / src / hayashi / yuu / tools / mail / gui / SendMailGUI.java
diff --git a/src/hayashi/yuu/tools/mail/gui/SendMailGUI.java b/src/hayashi/yuu/tools/mail/gui/SendMailGUI.java
deleted file mode 100755 (executable)
index 743576e..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-package hayashi.yuu.tools.mail.gui;\r
-\r
-import hayashi.yuu.tools.logger.LoggerFactory;\r
-import hayashi.yuu.tools.mail.SendMail;\r
-import hayashi.yuu.tools.mail.SiteData;\r
-import hayashi.yuu.tools.properties.Encrypt;\r
-\r
-import java.awt.*;\r
-import java.awt.event.*;\r
-import java.io.FileNotFoundException;\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.swing.JFrame;\r
-import javax.swing.JLabel;\r
-import javax.swing.JMenu;\r
-import javax.swing.JMenuBar;\r
-import javax.swing.JMenuItem;\r
-import javax.swing.JPanel;\r
-import javax.swing.JScrollPane;\r
-import javax.swing.JTextArea;\r
-import javax.swing.WindowConstants;\r
-\r
-\r
-@SuppressWarnings("serial")\r
-public class SendMailGUI extends JFrame implements ActionListener\r
-{\r
-    public static SendMailGUI mainFrame;\r
-    boolean fComponentsAdjusted;\r
-    JPanel headPanel;\r
-    JMenuBar mainMenuBar;      // [メニュー]\r
-    JMenu menuFile;                    // [メニュー]->[ファイル(F)]\r
-    JMenuItem miSetting;       // [メニュー]->[ファイル(F)]->[設定...]\r
-    JMenuItem miExit;          // [メニュー]->[ファイル(F)]->[終了(X)]\r
-    \r
-    public Logger logger;\r
-    public static SiteData mailProp;\r
-    public static String propertiesFileName;\r
-    \r
-    /**\r
-     * 「メール送信(SendMail)」\r
-     * 起動オプション:\r
-     *  第一: メールアカウントの設定ファイル名\r
-     * @param args     properties File Name\r
-     * @throws Exception       error\r
-     */\r
-    public static void main(String args[]) throws Exception {\r
-               String fileName = "sendmail.properties";\r
-       if (args.length > 0) {\r
-               fileName = args[0];\r
-       }\r
-        (new SendMailGUI(fileName)).setVisible(true);\r
-    }\r
-    \r
-    public SendMailGUI(String propertiesName) throws Exception {\r
-       Encrypt.PASSWORD_KEY = "hayashihimitukagi";\r
-        logger = LoggerFactory.getInstance();  // Loggerオブジェクトの生成\r
-       SendMailGUI.propertiesFileName = propertiesName;\r
-        SendMailGUI.mailProp = new SiteData(SendMailGUI.propertiesFileName);\r
-\r
-        // ログ出力\r
-        logger.info("SendMailGUI - プログラム起動");\r
-        \r
-        // 初期設定\r
-        fComponentsAdjusted = false;\r
-        setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);\r
-        Container container = getContentPane();\r
-        container.setLayout(new BorderLayout());\r
-        setTitle("SendMail GUI");\r
-        \r
-        mainFrame = this;\r
-        \r
-        // [メニュー]->[ファイル(F)]\r
-        menuFile = new JMenu("ファイル(F)");\r
-        menuFile.setMnemonic('F');\r
-        menuFile.setFont(new Font("Dialog", 0, 12));\r
-        \r
-        // [メニュー]->[ファイル(F)]->[設定...]\r
-        miSetting = new JMenuItem("設定...");\r
-        miSetting.addActionListener(this);\r
-        miSetting.setFont(new Font("Dialog", 0, 12));\r
-        menuFile.add(miSetting);\r
-        \r
-        // [メニュー]->[ファイル(F)]->[------------]\r
-        menuFile.addSeparator();\r
-\r
-        // [メニュー]->[ファイル(F)]->[終了(X)]\r
-        miExit = new JMenuItem("終了(X)");\r
-        miExit.addActionListener(this);\r
-        miExit.setMnemonic('X');\r
-        miExit.setFont(new Font("Dialog", 0, 12));\r
-        menuFile.add(miExit);\r
-        \r
-        // [メニュー]\r
-        mainMenuBar = new JMenuBar();\r
-        mainMenuBar.add(menuFile);\r
-        getRootPane().setJMenuBar(mainMenuBar);\r
-\r
-        // 上部にヘッダパネル\r
-        headPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));\r
-        getContentPane().add(BorderLayout.NORTH, headPanel);\r
-        JLabel label1 = new JLabel("SendMail GUI - サンプルプログラム", JLabel.CENTER);\r
-        label1.setBounds(10,10,340,20);\r
-        \r
-        // 中央に、メインパネルを配置\r
-        JPanel mainPanel = new JPanel(new FlowLayout());\r
-        //mainPanel.setPreferredSize(new Dimension(500, 400));\r
-        getContentPane().add(mainPanel, BorderLayout.CENTER);\r
-        \r
-        JTextArea textArea = new JTextArea(20, 60);\r
-        textArea.setEditable(false);\r
-        textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));\r
-               textArea.append("メール送信設定 サンプルプログラム\n");\r
-               textArea.setCaretPosition(0);\r
-               JScrollPane scrollPane = new JScrollPane(textArea);\r
-               scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\r
-               mainPanel.add(scrollPane, BorderLayout.CENTER);\r
-        \r
-        // 下部にコピーライトを配置\r
-        JPanel southPanel = new JPanel(new FlowLayout());\r
-        getContentPane().add(BorderLayout.SOUTH, southPanel);\r
-        \r
-        JLabel label2 = new JLabel("All rights reserved.Copyright(c) 2010,, Hayashi,Yuu.", JLabel.CENTER);\r
-        label2.setBounds(10,40,340,20);\r
-        southPanel.add(label2);\r
-        \r
-               pack();\r
-               setLocationRelativeTo(null);\r
-               setVisible(true);\r
-    }\r
-    \r
-    public SendMail getMailInstance() {\r
-               return new SendMail(SendMailGUI.mailProp);\r
-    }\r
-    \r
-    public static String getPropertiesFileName() {\r
-       return propertiesFileName;\r
-    }\r
-\r
-       public void addNotify() {\r
-        Dimension d = getSize();\r
-        super.addNotify();\r
-        if (fComponentsAdjusted) {\r
-            return;\r
-        }\r
-        setSize(getInsets().left + getInsets().right + d.width, getInsets().top + getInsets().bottom + d.height);\r
-        Component components[] = getComponents();\r
-        for (int i = 0; i < components.length; i++) {\r
-            Point p = components[i].getLocation();\r
-            p.translate(getInsets().left, getInsets().top);\r
-            components[i].setLocation(p);\r
-        }\r
-\r
-        fComponentsAdjusted = true;\r
-    }\r
-\r
-       /**\r
-        * [メニュー]アクション: \r
-        * @param event         イベント\r
-        */\r
-       public void actionPerformed(ActionEvent event) {\r
-        Object object = event.getSource();\r
-        if(object == miExit) {\r
-            miExit_Action(event);\r
-        }\r
-        else if (object == miSetting) {\r
-            miSetting_Action(event);\r
-        }\r
-    }\r
-       \r
-    /**\r
-     * アクション:\r
-     * [メニュー]->[ファイル]->[終了]\r
-     * \r
-     * @param event\r
-     */\r
-    void miExit_Action(ActionEvent event) {\r
-       setVisible(false);\r
-        logger.info("SendMailGUI - プログラム終了");\r
-        System.exit(0);\r
-    }\r
-\r
-    /**\r
-     * アクション:\r
-     * [メニュー]->[ファイル]->[設定...]\r
-     * \r
-     * @param event\r
-     */\r
-    void miSetting_Action(ActionEvent event) {\r
-        try {\r
-                       (new SettingDialog(this, true, SendMailGUI.getPropertiesFileName(), logger)).setVisible(true);\r
-               }\r
-        catch (FileNotFoundException e) {\r
-                       // 回復不能な重大なエラー\r
-                       e.printStackTrace();\r
-               }\r
-        catch (IOException e) {\r
-                       // 回復不能な重大なエラー\r
-                       e.printStackTrace();\r
-               }\r
-    }\r
-}\r