⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sc000300.java

📁 梦界家园程序开发基底框架
💻 JAVA
字号:
package jm.form.gui.swing.game.sc.sc00;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import jm.entity.command.DBCommandKeys;
import jm.entity.system.ESC000300;
import jm.entity.util.MenuFrameBean;
import jm.form.gui.swing.game.system.SystemManager;
import jm.form.gui.swing.game.util.action.remote.RClearAction;
import jm.form.gui.swing.game.util.action.remote.RCloseAction;
import jm.form.gui.swing.game.util.action.remote.RDeleteAction;
import jm.form.gui.swing.game.util.action.remote.RInsertAction;
import jm.form.gui.swing.game.util.action.remote.RSearchAction;
import jm.form.gui.swing.game.util.action.remote.RUpdateAction;
import jm.form.gui.swing.game.util.model.AbstractBaseDialog;
import jm.form.gui.swing.game.util.model.BaseIDTextField;
import jm.form.gui.swing.game.util.model.BaseTextField;
import jm.framework.gui.FormTable;
import jm.framework.gui.ReLoad;
import jm.framework.gui.container.JMButtonPanel;
import jm.framework.gui.module.JMIcon;
import jm.framework.gui.module.JMPanel;
import jm.framework.gui.module.jmtable.SimpleTable;
import jm.framework.util.SimpleDBTable;
import jm.framework.util.SimpleEntityTable;
import jm.util.JMCheck;

/**
 * <p>允许登录用户管理</p>
 *
 * <p>Copyright: Copyright (c) 2004-2006</p>
 *
 * <p>Company: 1SHome</p>
 *
 * <p>@author Spook</p>
 *
 * @since 1.3
 * @see JDK 1.5.0.6
 */
public class SC000300 extends AbstractBaseDialog implements ReLoad ,FormTable{

    public void actionPerformed (MenuFrameBean bean, Object aoParams) {
        if(aoParams instanceof ESC000300){
            ESC000300 _Params = (ESC000300)aoParams;
            UserID.setText(_Params.getUserID());
            LoginID.setText(_Params.getLoginID());
            IntimacyName.setText(_Params.getIntimacyName());
            Email.setText(_Params.getEmail());
            ForgetQ.setText(_Params.getForgetQ());
            ForgetA.setText(_Params.getForgetA());
            AvailabilityDay.setText(_Params.getAvailabilityDay());
        }
    }

    public Object getReturnData (int type) {
        ESC000300 ret = new ESC000300();
        if (type == ACTION_INSERT) {
            if (JMCheck.isNull(UserID.getText())||JMCheck.isNull(LoginID.getText())) {
                return null;
            }
        }
        ret.setUserID(UserID.getText());
        ret.setLoginID(LoginID.getText());
        ret.setIntimacyName(IntimacyName.getText());
        ret.setEmail(Email.getText());
        ret.setForgetQ(ForgetQ.getText());
        ret.setForgetA(ForgetA.getText());
        ret.setAvailabilityDay(AvailabilityDay.getText());

        return ret;
    }

    public void clear () {
        UserID.setText("");
        LoginID.setText("");
        IntimacyName.setText("");
        Email.setText("");
        ForgetQ.setText("");
        ForgetA.setText("");
        AvailabilityDay.setText("");
    }

    public boolean reLoad () {
        try {
            //获得全部数据
            SimpleDBTable dbTable = new SimpleDBTable(DBCommandKeys.DBTABLE_CANLOGIN);
            fields = new String[]{
                              DBCommandKeys.DB_KEY_SC000300_USERID,
                              DBCommandKeys.DB_KEY_SC000300_LOGINID,
                              DBCommandKeys.DB_KEY_SC000300_INTIMACYNAME,
                              DBCommandKeys.DB_KEY_SC000300_EMAIL,
                              DBCommandKeys.DB_KEY_SC000300_FORGETQ,
                              DBCommandKeys.DB_KEY_SC000300_FORGETA,
                              DBCommandKeys.DB_KEY_SC000300_AVAILABILITYDAY,
            };
            datasSource = dbTable.select(fields).getResultData();

            return true;
        } catch (Exception e) {
            SystemManager.getInstance().setMessage(e.getMessage());
        }
        return false;
    }

    private String[] TITLE = {
                     "用户ID",
                     "登录ID",
                     "昵称",
                     "电子邮件",
                     "提示信息",
                     "提示答案",
                     "密码有效日"
    };

    public boolean init (String asAppId, String asInitOption) {
        try {
            TopPanel.setPreferredSize(new Dimension(10, 100));
            TopPanel.setLayout(null);
            CenterPanel.setLayout(borderLayout1);

            table = new SimpleTable(datasSource, TITLE);
            table.init();

            ButtonPanel.setButton("检索", "追加", "编辑", "删除","清空","关闭");
            ButtonPanel.addCommandActionListener(1, new RSearchAction(this));
            ButtonPanel.addCommandActionListener(2, new RInsertAction(this));
            ButtonPanel.addCommandActionListener(3, new RUpdateAction(this));
            ButtonPanel.addCommandActionListener(4, new RDeleteAction(this));
            ButtonPanel.addCommandActionListener(5, new RClearAction(this));
            ButtonPanel.addCommandActionListener(6, new RCloseAction(this));
            UserIDLabel.setText("用户ID:");
            UserIDLabel.setBounds(new Rectangle(31, 14, 62, 19));
            UserID.setToolTipText("");
            UserID.setText("US345678901234567890");
            UserID.setBounds(new Rectangle(95, 12, 135, 22));
            UserIDButton.setBounds(new Rectangle(233, 13, 20, 20));
            UserIDButton.setIcon(new JMIcon("image/button/search.gif"));
            UserIDButton.setToolTipText("选择用户");
//            UserIDButton.setText("UserID");
            UserIDButton.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent e) {
                    UserIDButton_actionPerformed(e);
                }
            });

            LoginIDLabel.setText("登录ID:");
            LoginIDLabel.setBounds(new Rectangle(271, 13, 55, 20));
            LoginID.setText("MMMMMMMMMMMMMMMMMM");
            LoginID.setBounds(new Rectangle(328, 12, 123, 22));
            LoginIDButton.setBounds(new Rectangle(456, 13, 20, 20));
            LoginIDButton.setToolTipText("检查是否可用");
            LoginIDButton.setIcon(new JMIcon("image/button/check.gif"));
//            LoginIDButton.setText("LoginID");
            LoginIDButton.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent e) {
                    LoginIDButton_actionPerformed(e);
                }
            });

            IntimacyNameLabel.setText("昵称:");
            IntimacyNameLabel.setBounds(new Rectangle(502, 13, 42, 20));
            IntimacyName.setBounds(new Rectangle(545, 12, 208, 22));
            EmailLabel.setText("电子邮件:");
            EmailLabel.setBounds(new Rectangle(31, 71, 62, 18));
            Email.setBounds(new Rectangle(95, 68, 280, 22));
            ForgetQ.setBounds(new Rectangle(95, 41, 280, 22));
            ForgetQLabel.setText("提示信息:");
            ForgetQLabel.setBounds(new Rectangle(31, 40, 62, 21));
            ForgetALabel.setText("提示答案:");
            ForgetALabel.setBounds(new Rectangle(392, 40, 79, 21));
            ForgetA.setBounds(new Rectangle(473, 41, 280, 22));
            AvailabilityDayLabel.setText("密码有效日:");
            AvailabilityDayLabel.setBounds(new Rectangle(392, 71, 79, 21));
            AvailabilityDay.setBounds(new Rectangle(473, 68, 159, 22));
            this.getContentPane().add(CenterPanel, java.awt.BorderLayout.CENTER);
            this.getContentPane().add(ButtonPanel, java.awt.BorderLayout.SOUTH);
            this.getContentPane().add(TopPanel, java.awt.BorderLayout.NORTH);
            TopPanel.add(AvailabilityDay);
            TopPanel.add(UserIDLabel);
            TopPanel.add(IntimacyName);
            TopPanel.add(LoginIDButton);
            TopPanel.add(EmailLabel);
            TopPanel.add(IntimacyNameLabel);
            TopPanel.add(LoginIDLabel);
            TopPanel.add(UserIDButton);
            TopPanel.add(ForgetQ);
            TopPanel.add(LoginID);
            TopPanel.add(ForgetQLabel);
            TopPanel.add(Email);
            TopPanel.add(UserID);
            TopPanel.add(ForgetA);
            TopPanel.add(ForgetALabel);
            TopPanel.add(AvailabilityDayLabel);
            CenterPanel.add(table, java.awt.BorderLayout.CENTER);
            return true;
        } catch (Exception e) {
        }
        return false;
    }

    /**
     * 获得系统用户
     * @param e ActionEvent
     */
    public void UserIDButton_actionPerformed (ActionEvent e) {
        try {
//            EMS020000 ret = (EMS020000) SystemManager.getInstance().loadDialog(MS020000.CLASS_NAME).getReturnData(AppActionResult.ACTION_SELECT);
//            UserID.setText(ret.getUserID());
//            IntimacyName.setText(ret.getUserName());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /**
     * 检查当前用户登录ID是否可以使用
     * @param e ActionEvent
     */
    public void LoginIDButton_actionPerformed (ActionEvent e) {
        try {
            ESC000300 ret = new ESC000300();
            ret.setLoginID(LoginID.getText());
            SimpleEntityTable table = new SimpleEntityTable(ret);
            if(table.select().getResultData().colCount()>0){
                SystemManager.getInstance().setMessage("当前用户名不可以使用");
            }else{
                SystemManager.getInstance().setMessage("当前用户名可以正常使用");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    private JPanel CenterPanel = new JPanel();
    private JMButtonPanel ButtonPanel = new JMButtonPanel(6);
    private JMPanel TopPanel = new JMPanel();
    private BorderLayout borderLayout1 = new BorderLayout();
    private JLabel UserIDLabel = new JLabel();
    private BaseIDTextField UserID = new BaseIDTextField();
    private JButton UserIDButton = new JButton();
    private JLabel LoginIDLabel = new JLabel();
    private BaseTextField LoginID = new BaseTextField();
    private JButton LoginIDButton = new JButton();
    private JLabel IntimacyNameLabel = new JLabel();
    private JTextField IntimacyName = new JTextField();
    private JLabel EmailLabel = new JLabel();
    private JTextField Email = new JTextField();
    private JTextField ForgetQ = new JTextField();
    private JLabel ForgetQLabel = new JLabel();
    private JLabel ForgetALabel = new JLabel();
    private JTextField ForgetA = new JTextField();
    private JLabel AvailabilityDayLabel = new JLabel();
    private JTextField AvailabilityDay = new JTextField();

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -