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

📄 ktablemodel.java~46~

📁 封装了SQL、Socket、WAP、MIME等功能的通用组件
💻 JAVA~46~
字号:
package org.lazybug.skit.table;

/**
 * <p>Title: Geniux</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author David Lau
 * @version 1.0
 */

public abstract class KTableModel
{
    /*表格列的宽度*/
    private int tbColsWidth[];
    /*表格列的样式*/
    private String tbColsStyle[];

    public KTableModel(int length)
    {
        tbColsWidth = new int[length];
        tbColsStyle = new String[length];
    }
    /**
     * 设置列样式
     * @param col int
     * @param style String
     */
    public void setColStyle(int col, String style)
    {
        if( col >= 0 && col < this.tbColsStyle.length &&
            style != null && style.length() > 0 )
        {
            this.tbColsStyle[col] = style;
        }
    }
    /**
     * 返回列的样式
     * @param col int
     * @return String
     */
    public String getColStyle(int col)
    {
        if( col >= 0 && col < this.tbColsStyle.length)
        {
            return this.tbColsStyle[col];
        }
        return null;
    }
    /**
     * 设置列宽度
     * @param col int
     * @param width int
     */
    public void setColWidth(int col, int width)
    {
        if( col >= 0 && col < this.tbColsWidth.length && width > 0 )
        {
            this.tbColsWidth[col] = width;
        }
    }
    /**
     * 返回列的宽度
     * @param col int
     * @return int
     */
    public int getColWidth(int col)
    {
        if( col >= 0 && col < this.tbColsWidth.length)
        {
            return this.tbColsWidth[col];
        }
        return 0;
    }
    /**
     * Returns the number of rows in the model. A
     * <code>JTable</code> uses this method to determine how many rows it
     * should display.  This method should be quick, as it
     * is called frequently during rendering.
     *
     * @return the number of rows in the model
     * @see #getColumnCount
     */
    public abstract int getRowCount();

    /**
     * Returns the number of columns in the model. A
     * <code>JTable</code> uses this method to determine how many columns it
     * should create and display by default.
     *
     * @return the number of columns in the model
     * @see #getRowCount
     */
    public abstract int getColumnCount();

    /**
     * Returns the name of the column at <code>columnIndex</code>.  This is used
     * to initialize the table's column header name.  Note: this name does
     * not need to be unique; two columns in a table can have the same name.
     *
     * @param	columnIndex	the index of the column
     * @return  the name of the column
     */
    public abstract String getColumnName(int col);

    /**
     * Returns the value for the cell at <code>columnIndex</code> and
     * <code>rowIndex</code>.
     *
     * @param	rowIndex	the row whose value is to be queried
     * @param	columnIndex 	the column whose value is to be queried
     * @param	style         	the column whose style is to be queried
     * @return	the value Object at the specified cell
     */
    public abstract Object getValueAt(int row, int col);

    /**
     * Returns the java script tag.
     * @return String
     */
    public abstract String getScriptTag();
}

⌨️ 快捷键说明

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