Documentation of 'smile.swing.table.PageTableModel' Java class
PageTableModel
smile.swing.table

Class PageTableModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel


    public abstract class PageTableModel
    extends javax.swing.table.AbstractTableModel
    A table model that performs "paging" of its data. This model reports a small number of rows (like 100 or so) as a "page" of data. You can switch pages to view all of the rows as needed using the pageDown() and pageUp() methods. Presumably, access to the other pages of data is dictated by other GUI elements such as up/down buttons, or maybe a text field that allows you to enter the page number you want to display.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      PageTableModel()
      Default constructor.
      PageTableModel(int pageSize)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      int getPage()
      Returns the current page.
      int getPageCount()
      Returns the number of pages.
      int getPageSize()
      Returns the page size.
      int getRealRow(int row)
      Returns the row number of data given the row number of current page.
      abstract int getRealRowCount()
      The sub class should implement this method to return the real number of rows in the model.
      int getRowCount() 
      javax.swing.JToolBar getToolbar()
      Returns a tool bar to control the plot.
      java.lang.Object getValueAt(int row, int col) 
      abstract java.lang.Object getValueAtRealRow(int row, int col)
      Returns the value for the cell at real row index.
      boolean pageDown()
      Moves to next page and fire a data changed (all rows).
      boolean pageUp()
      Moves to previous page and fire a data changed (all rows).
      boolean setPage(int p)
      Moves to specific page and fire a data changed (all rows).
      void setPageSize(int s)
      Sets the page size.
      • Methods inherited from class javax.swing.table.AbstractTableModel

        addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.table.TableModel

        getColumnCount
    • Constructor Detail

      • PageTableModel

        public PageTableModel()
        Default constructor.
      • PageTableModel

        public PageTableModel(int pageSize)
        Constructor.
        Parameters:
        pageSize - The number of rows per page.
    • Method Detail

      • getRowCount

        public int getRowCount()
      • getRealRowCount

        public abstract int getRealRowCount()
        The sub class should implement this method to return the real number of rows in the model.
        Returns:
        The real number of rows in the model.
      • getRealRow

        public int getRealRow(int row)
        Returns the row number of data given the row number of current page.
        Parameters:
        row - the row number in the current page.
        Returns:
        the row number in the whole date set.
      • getValueAt

        public java.lang.Object getValueAt(int row,
                                           int col)
      • getValueAtRealRow

        public abstract java.lang.Object getValueAtRealRow(int row,
                                                           int col)
        Returns the value for the cell at real row index.
        Parameters:
        row - the real row whose value is to be queried.
        col - the column whose value is to be queried.
        Returns:
        the value Object at the specified cell
      • getPage

        public int getPage()
        Returns the current page.
        Returns:
        the current page.
      • setPage

        public boolean setPage(int p)
        Moves to specific page and fire a data changed (all rows).
        Returns:
        true if we can move to the page.
      • getPageCount

        public int getPageCount()
        Returns the number of pages.
        Returns:
        the number of pages.
      • getPageSize

        public int getPageSize()
        Returns the page size.
        Returns:
        the page size.
      • setPageSize

        public void setPageSize(int s)
        Sets the page size.
        Parameters:
        s - the page size.
      • pageDown

        public boolean pageDown()
        Moves to next page and fire a data changed (all rows).
        Returns:
        true if we can move to next page.
      • pageUp

        public boolean pageUp()
        Moves to previous page and fire a data changed (all rows).
        Returns:
        true if we can move to previous page.
      • getToolbar

        public javax.swing.JToolBar getToolbar()
        Returns a tool bar to control the plot.
        Returns:
        a tool bar to control the plot.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.