亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? accountpanel.java

?? 該系統是一個基于p2p的即時聊天系統
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * @(#) AccountPanel.java * Copyright 2004 HWStudio. All rights reserved. */package hws.item.smart.panel.function.mail;//導入核心Java類庫import java.awt.Insets;import java.awt.Component;import java.awt.FlowLayout;import java.awt.GridBagLayout;import java.awt.GridBagConstraints;import java.util.List;import javax.swing.JTree;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JButton;import javax.swing.JTextField;import javax.swing.JSplitPane;import javax.swing.JScrollPane;import javax.swing.JOptionPane;import javax.swing.JPasswordField;import javax.swing.tree.DefaultTreeModel;import javax.swing.tree.DefaultMutableTreeNode;import javax.swing.tree.DefaultTreeCellRenderer;import javax.swing.tree.DefaultTreeSelectionModel;import javax.swing.event.TreeSelectionEvent;import javax.swing.event.TreeSelectionListener;//導入自定義Java類庫import hws.item.smart.Smart;import hws.item.smart.misc.XMLConfig;import hws.item.smart.misc.ImageShop;import hws.item.smart.misc.ColorShop;import hws.item.smart.misc.SBChanger;import hws.item.smart.misc.BorderShop;import hws.item.smart.misc.StringShop;import hws.item.smart.misc.ActionCenter;import hws.item.smart.action.mail.account.AddAccountAction;import hws.item.smart.action.mail.account.ApplyChangeAction;import hws.item.smart.action.mail.account.EditAccountAction;import hws.item.smart.action.mail.account.DeleteAccountAction;import hws.item.smart.utility.mail.POP3Info;import hws.item.smart.utility.mail.SMTPInfo;import hws.item.smart.utility.mail.AccountInfo;import hws.item.smart.utility.mail.PersonalInfo;/** * 賬號設置面板 * * @version 0.1 2005-08-22 * @author Hwerz */public class AccountPanel extends JPanel {    /*------------------------------------------------------------------------*     *                                屬性定義                                *     *------------------------------------------------------------------------*/    /**     * 賬號管理樹根節點     */    private static final DefaultMutableTreeNode ACCOUNT_ROOT =        new DefaultMutableTreeNode("郵箱賬號");    /**     * 該類自身的一個靜態引用     */    private static AccountPanel panel;    /**     * 賬號視圖面板     */    private AccountViewPanel accountViewPanel;    /**     * 賬號信息面板     */    private AccountInfoPanel accountInfoPanel;    /*------------------------------------------------------------------------*     *                                構造函數                                *     *------------------------------------------------------------------------*/    /**     * 構造函數為私有,這樣在整個運行過程中該類就只能有一個實例     */    private AccountPanel() {        super(new GridBagLayout());        //工具欄面板        GridBagConstraints constraints = new GridBagConstraints(            //gridx, gridy            0, 0,            //gridwidth, gridheight            1, 1,            //weightx, weighty            1.0, 0.0,            //anchor            GridBagConstraints.NORTH,            //fill            GridBagConstraints.HORIZONTAL,            //insets            new Insets(5, 0, 0, 0),            //ipadx, ipady            0, 0);        add(new Toolbar(), constraints);        //分割條面板        accountInfoPanel = new AccountInfoPanel();        accountViewPanel = new AccountViewPanel();        JSplitPane spliter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false,            accountViewPanel, accountInfoPanel);        spliter.setOneTouchExpandable(true);        spliter.setDividerLocation(200);        constraints.gridy = 1;        constraints.weighty = 1.0;        constraints.fill = GridBagConstraints.BOTH;        constraints.insets = new Insets(5, 5, 5, 5);        add(spliter, constraints);    }    /*------------------------------------------------------------------------*     *                                公共方法                                *     *------------------------------------------------------------------------*/    /**     * 對該類提供的一個全局訪問點,用來實例化該對象     *     * @return 該類唯一的一個實例     */    public static AccountPanel getInstance() {        if (panel == null) {            panel = new AccountPanel();        }        return panel;    }    /**     * 激活賬號面板上的所有文本框     */    public void activate() {        accountInfoPanel.activate();    }    /**     * 禁用賬號面板上的所有文本框     */    public void inactivate() {        accountInfoPanel.inactivate();    }    /**     * 提交賬號變化     */    public void apply() {        AccountInfo oldInfo = accountViewPanel.getSelectedAccount();        AccountInfo newInfo = null;        PersonalInfoPanel panel1 = accountInfoPanel.getPersonalInfoPanel();        SMTPInfoPanel panel2 = accountInfoPanel.getSMTPInfoPanel();        POP3InfoPanel panel3 = accountInfoPanel.getPOP3InfoPanel();        if (panel1.getName().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "姓名不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else if (panel1.getEmail().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "電子郵件地址不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else if (panel2.getURL().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "發送郵件服務器不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else if (panel2.getUserID().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "SMTP郵箱賬號不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else if (panel3.getURL().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "接收郵件服務器不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else if (panel3.getUserID().length() == 0) {            JOptionPane.showMessageDialog(Smart.getInstance(),                "POP3郵箱賬號不可為空!", StringShop.HINT_TITLE,                JOptionPane.INFORMATION_MESSAGE);        } else {            PersonalInfo info1 = new PersonalInfo(panel1.getName(),                panel1.getOrganization(), panel1.getEmail(), panel1.getReply());            SMTPInfo info2 = new SMTPInfo(panel2.getURL(), panel2.getPort(),                panel2.getUserID(), panel2.getPassword());            POP3Info info3 = new POP3Info(panel3.getURL(), panel3.getPort(),                panel3.getUserID(), panel3.getPassword());            newInfo = new AccountInfo(info1, info2, info3);        }        //添加賬號        if (oldInfo == null && newInfo != null) {            accountViewPanel.addAccount(newInfo);        }        //編輯賬號        if (oldInfo != null && newInfo != null) {            accountViewPanel.editAccount(oldInfo, newInfo);        }    }    /**     * 刪除選中賬號     */    public void delete() {        accountViewPanel.deleteSelectedAccount();    }    /*------------------------------------------------------------------------*     *                                 內部類                                 *     *------------------------------------------------------------------------*/    /**     * 工具欄面板     */    class Toolbar extends JPanel {        /**         * Create a new instance of this class         */        public Toolbar() {            super(new FlowLayout(FlowLayout.CENTER, 5, 0));            //添加            JButton button = new JButton(AddAccountAction.getInstance());            button.setIcon(ImageShop.ADD_IMAGEICON);            button.addMouseListener(new SBChanger(                AddAccountAction.getInstance().getHintInfo(), false));            add(button);            //刪除            button = new JButton(DeleteAccountAction.getInstance());            button.setIcon(ImageShop.DELETE_IMAGEICON);            button.addMouseListener(new SBChanger(                DeleteAccountAction.getInstance().getHintInfo(), false));            add(button);            //編輯            button = new JButton(EditAccountAction.getInstance());            button.setIcon(ImageShop.EDIT_IMAGEICON);            button.addMouseListener(new SBChanger(                EditAccountAction.getInstance().getHintInfo(), false));            add(button);            //應用            button = new JButton(ApplyChangeAction.getInstance());            button.setIcon(ImageShop.APPLY_IMAGEICON);            button.addMouseListener(new SBChanger(                ApplyChangeAction.getInstance().getHintInfo(), false));            add(button);        }    }    /**     * 賬號視圖面板     */    class AccountViewPanel extends JPanel implements TreeSelectionListener {        /**         * 賬號管理樹         */        private JTree accountManagerTree;        /**         * 賬號管理樹的模型         */        private DefaultTreeModel accountManagerModel;        /**         * Create a new instance of this class         */        public AccountViewPanel() {            super(new GridBagLayout());            //賬號視圖標簽            GridBagConstraints constraints = new GridBagConstraints(                //gridx, gridy                0, 0,                //gridwidth, gridheight                1, 1,                //weightx, weighty                0.0, 0.0,                //anchor                GridBagConstraints.NORTHWEST,                //fill                GridBagConstraints.NONE,                //insets                new Insets(0, 5, 0, 0),                //ipadx, ipady                0, 0);            add(new JLabel("賬號視圖"), constraints);            //賬號管理樹            accountManagerModel = new DefaultTreeModel(ACCOUNT_ROOT);            accountManagerTree = new JTree(accountManagerModel);            accountManagerTree.addTreeSelectionListener(this);            loadAccounts();            setTree();            setTreeCellRenderer();            JScrollPane scroller = new JScrollPane(accountManagerTree,                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);            constraints.gridy = 1;            constraints.weightx = 1.0;            constraints.weighty = 1.0;            constraints.fill = GridBagConstraints.BOTH;            constraints.insets = new Insets(0, 0, 0, 0);            add(scroller, constraints);        }        /**         * 返回選中的賬號         *         * @return 選中的賬號         */        public AccountInfo getSelectedAccount() {            AccountInfo accountInfo = null;            DefaultMutableTreeNode node = (DefaultMutableTreeNode)                accountManagerTree.getSelectionPath().getLastPathComponent();            if (node != ACCOUNT_ROOT) {                accountInfo = (AccountInfo) node.getUserObject();            }            return accountInfo;        }        /**         * 添加賬號         *         * @param info 待添加的賬號信息         */        public void addAccount(AccountInfo info) {            boolean exist = false;            List accounts = XMLConfig.getAllAccounts();            for (int i = 0; i < accounts.size(); i++) {                AccountInfo account = (AccountInfo) accounts.get(i);                if (account.equals(info)) {                    exist = true;                    break;                }            }            if (exist == true) {                JOptionPane.showMessageDialog(Smart.getInstance(),                    "您要添加的賬號已經存在,不能添加!", StringShop.HINT_TITLE,                    JOptionPane.INFORMATION_MESSAGE);                accountInfoPanel.setValue(null);                accountInfoPanel.inactivate();                ActionCenter.getInstance().setActionWhenSelectAccountManager();            } else {                XMLConfig.addAccount(info, true);                DefaultMutableTreeNode child = new DefaultMutableTreeNode(info);                int index = ACCOUNT_ROOT.getChildCount();                accountManagerModel.insertNodeInto(child, ACCOUNT_ROOT, index);                accountManagerTree.setSelectionRow(index + 1);            }        }        /**         * 編輯賬號         *         * @param oldInfo 編輯前的賬號信息         * @param newInfo 編輯后的賬號信息         */        public void editAccount(AccountInfo oldInfo, AccountInfo newInfo) {            boolean exist = false;            List accounts = XMLConfig.getAllAccounts();            int i;            for (i = 0; i < accounts.size(); i++) {                AccountInfo account = (AccountInfo) accounts.get(i);                if (account.equals(oldInfo)) {                    break;                }            }            for (int j = 0; j < accounts.size(); j++) {                if (j != i) {                    AccountInfo account = (AccountInfo) accounts.get(j);                    if (account.equals(newInfo)) {                        exist = true;                        break;                    }                }            }            if (exist == true) {                JOptionPane.showMessageDialog(Smart.getInstance(),                    "您編輯后的賬號已經存在,不能編輯!", StringShop.HINT_TITLE,                    JOptionPane.INFORMATION_MESSAGE);            } else {                accounts.remove(i);                accounts.add(i, newInfo);                XMLConfig.deleteAllAccounts(false);                XMLConfig.addAllAccounts(accounts, true);            }            int row = accountManagerTree                .getRowForPath(accountManagerTree.getSelectionPath());            reloadAccounts();            accountManagerTree.setSelectionRow(row);        }        /**         * 刪除選中的賬號         */        public void deleteSelectedAccount() {            DefaultMutableTreeNode node = (DefaultMutableTreeNode)                accountManagerTree.getSelectionPath().getLastPathComponent();            if (node != ACCOUNT_ROOT) {                AccountInfo accountInfo = (AccountInfo) node.getUserObject();                XMLConfig.deleteAccount(accountInfo, true);                int row = accountManagerTree                    .getRowForPath(accountManagerTree.getSelectionPath());                accountManagerModel.removeNodeFromParent(node);                accountManagerTree.setSelectionRow(row - 1);            }        }        /**         * 裝載賬號         */        private void loadAccounts() {            List accounts = XMLConfig.getAllAccounts();            for (int i = 0; i < accounts.size(); i++) {                Object obj = accounts.get(i);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本到高清视频免费精品| 日韩一区二区精品在线观看| 欧美亚洲免费在线一区| 精品久久久久香蕉网| 一区二区三区在线视频观看58| 美国三级日本三级久久99| 91美女在线视频| 亚洲国产综合人成综合网站| 激情久久久久久久久久久久久久久久| 91网址在线看| 亚洲国产经典视频| 激情欧美日韩一区二区| 91麻豆精品国产91久久久使用方法| 国产精品乱码久久久久久| 国内成人自拍视频| 日韩精品在线看片z| 国产成人h网站| 91精品国产一区二区三区香蕉| 一区二区三区四区高清精品免费观看| 国产传媒久久文化传媒| 久久综合色之久久综合| 免费欧美高清视频| 正在播放亚洲一区| 亚洲国产精品久久人人爱| 91福利小视频| 依依成人综合视频| 色综合久久66| 亚洲一区欧美一区| 91黄视频在线| 亚洲va欧美va人人爽| 欧美三级在线看| 亚洲mv在线观看| 欧美日本视频在线| 日韩国产精品91| 欧美一区二区三区免费视频| 日本一道高清亚洲日美韩| 7777精品伊人久久久大香线蕉| 成人国产精品免费观看动漫| 国产日产欧产精品推荐色| 懂色av中文一区二区三区| 国产精品女上位| 91麻豆精品在线观看| 亚洲综合一区二区三区| 欧美丝袜自拍制服另类| 丝袜脚交一区二区| 欧美成人精精品一区二区频| 国内精品自线一区二区三区视频| 久久久久久久综合| 91在线播放网址| 亚洲电影视频在线| 亚洲精品一线二线三线| 成人天堂资源www在线| 亚洲欧美经典视频| 91精品国产综合久久精品| 久久精品国内一区二区三区| 国产三级精品三级| 色诱视频网站一区| 日韩高清不卡在线| 国产欧美日韩在线看| 色女孩综合影院| 美女免费视频一区| 综合自拍亚洲综合图不卡区| 欧美日韩电影一区| 国产精品自拍三区| 一区二区三区免费看视频| 亚洲欧美日韩久久精品| 欧美日韩一区二区在线观看| 国产一区二区三区黄视频 | 精品久久久久久久久久久院品网 | 欧美一级片免费看| 国产aⅴ综合色| 亚洲成人一区二区| 久久精品一区二区三区四区| 免费成人结看片| 亚洲另类春色国产| 欧美大黄免费观看| 欧洲亚洲精品在线| 国产不卡高清在线观看视频| 午夜亚洲福利老司机| 欧美高清一级片在线观看| 在线成人午夜影院| 91在线视频播放| 国产在线视频不卡二| 亚洲一区二区三区激情| 国产精品视频第一区| 欧美成人三级电影在线| 欧美最新大片在线看| 国产经典欧美精品| 免费黄网站欧美| 亚洲国产精品影院| 1区2区3区欧美| 久久久国产精华| 日韩一区二区三区视频| 日本精品裸体写真集在线观看| 国产麻豆精品视频| 美国欧美日韩国产在线播放| 亚洲精选免费视频| 欧美国产日韩一二三区| 欧美精品一区二区三区蜜桃视频| 欧美日韩视频专区在线播放| 91亚洲午夜精品久久久久久| 国产91精品精华液一区二区三区| 麻豆成人av在线| 日韩精品久久久久久| 亚洲国产人成综合网站| 国产精品第四页| 国产精品三级视频| 国产精品久久免费看| 国产日韩欧美不卡在线| 久久蜜臀精品av| www精品美女久久久tv| 亚洲视频综合在线| 亚洲国产电影在线观看| 欧美国产视频在线| 国产精品久久久久婷婷二区次| 久久精品日产第一区二区三区高清版| 欧美电影免费观看高清完整版| 日韩欧美成人午夜| 久久色成人在线| 欧美激情一区二区三区在线| 国产欧美一区二区在线| 国产精品色哟哟| 亚洲欧美日韩系列| 午夜日韩在线观看| 蜜桃视频一区二区三区 | 亚洲一区精品在线| 亚洲综合自拍偷拍| 天堂成人国产精品一区| 免费成人结看片| 福利一区二区在线| 91在线观看下载| 精品1区2区3区| 欧美xxxx老人做受| 国产精品系列在线| 亚洲国产精品久久人人爱| 麻豆精品一区二区| 成人高清视频在线| 欧美三级中文字幕在线观看| 日韩一二三区视频| 国产精品久久看| 天天做天天摸天天爽国产一区 | 欧美精品自拍偷拍| 精品成人在线观看| 亚洲丝袜精品丝袜在线| 日韩国产欧美在线播放| 国产一区不卡精品| 91久久线看在观草草青青| 日韩一区二区不卡| 国产精品久久夜| 奇米影视在线99精品| www.成人在线| 欧美一区二区三区四区久久 | 国产真实精品久久二三区| 成人app网站| 91精品视频网| 欧美经典一区二区| 国产高清视频一区| 欧美亚洲一区二区三区四区| 久久蜜桃一区二区| 亚洲成人黄色影院| 成人教育av在线| 欧美一级一区二区| 亚洲精品五月天| 国产传媒一区在线| 欧美人妇做爰xxxⅹ性高电影| 国产亚洲成av人在线观看导航 | 欧美美女一区二区在线观看| 中日韩免费视频中文字幕| 午夜视频在线观看一区| 99精品一区二区| 久久久久国产一区二区三区四区| 亚洲国产美女搞黄色| 99视频有精品| 国产欧美综合在线| 黑人巨大精品欧美一区| 欧美精品一二三| 一区二区欧美视频| 色综合网色综合| 高清在线不卡av| 欧美人xxxx| 亚洲一区二区在线免费看| av欧美精品.com| 国产午夜精品久久久久久免费视 | 蓝色福利精品导航| 欧美日韩精品一区二区| 亚洲欧美欧美一区二区三区| 成人永久免费视频| 欧美激情综合在线| 粗大黑人巨茎大战欧美成人| 精品国产99国产精品| 美国精品在线观看| 91精品免费在线观看| 亚洲成人动漫在线免费观看| 欧美综合一区二区| 亚洲同性gay激情无套| 成人理论电影网| 国产欧美精品一区二区色综合 | 亚洲欧美日韩一区二区 | 亚洲综合小说图片| 色综合久久综合网|