abstractbaseinternalframe.java.svn-base

来自「梦界家园程序开发基底框架」· SVN-BASE 代码 · 共 86 行

SVN-BASE
86
字号
package jm.form.gui.swing.game.util.model;

import jm.framework.gui.AppActionResult;
import jm.framework.gui.FormTable;
import jm.framework.gui.JMEntity;
import jm.framework.gui.module.jmtable.SimpleTable;
import jm.util.JM2DArray;
import jm.util.JMUtility;

/**
 * <p>Title: JM 整合Swing控件,使用配置信息</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 abstract class AbstractBaseInternalFrame extends BaseInternalFrame implements FormTable {

    protected SimpleTable table = null;
    protected JM2DArray datasSource = new JM2DArray();
    protected boolean isEdit = false;
    public void setEditing (boolean edit) {
        isEdit = edit;
    }

    public boolean getEditing () {
        return isEdit;
    }

    protected String[] fields = null;

    public String[] getTableItemsData () {
        return fields;
    }

    public JM2DArray getTableDataSource () {
        return datasSource;
    }

    public void setTableDataSource (JM2DArray datasSources) {
        try {
            datasSource.delAllRow();
            datasSource.addAll(datasSources);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public boolean queryClose () {
        return true;
    }

    /**
     * 更新当前数据
     */
    public void reLoadTable () {
        table.reLoad();
    }

    public void clearSelectLine () {
        table.clearSelection();
    }

    public int getSelectLine () {
        return table.getSelectLine();
    }

    public JMEntity getSelectData () {
        try {
            JMEntity _entity = (JMEntity) getReturnData(AppActionResult.ACTION_SELECT);
            if (_entity != null) {
                JMEntity _tableEntity = (JMEntity) (Class.forName(_entity.getClass().getName()).newInstance());
                JMUtility.reflectIntoEntity(_tableEntity, (getTableDataSource()), getSelectLine());
                return _tableEntity;
            }
        } catch (Exception e) {
        }
        return null;
    }
}

⌨️ 快捷键说明

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