Class SelectCharactersModel

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

    public class SelectCharactersModel
    extends javax.swing.table.AbstractTableModel
    SelectCharactersModel is an implementation of the TableModel interface for displaying all the characters in a given font.
    Since:
    $Date$, 03-NOV-2000
    Version:
    $Id$
    Author:
    Peter W. Draper
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.awt.Font font
      The font that we're displaying.
      protected int numChars
      The number of characters in the font.
      protected int numColumns
      The number of characters displayed in a row.
      protected int numRows
      Number of rows needed to display the whole font.
      • Fields inherited from class javax.swing.table.AbstractTableModel

        listenerList
    • Constructor Summary

      Constructors 
      Constructor Description
      SelectCharactersModel​(java.awt.Font font)
      Create an instance of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class getColumnClass​(int index)
      Return the column classes.
      int getColumnCount()
      Returns the number of columns.
      java.lang.String getColumnName​(int index)
      Return the column names.
      int getRowCount()
      Returns the number of records managed by the data source object.
      java.lang.Object getValueAt​(int row, int column)
      Return the value of a given cell.
      boolean isCellEditable​(int row, int column)
      Nothing is editable.
      void setFont​(java.awt.Font font)
      Set the displayed font.
      void setValueAt​(java.lang.Object value, int row, int column)
      Since nothing can be changed.
      • Methods inherited from class javax.swing.table.AbstractTableModel

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • font

        protected java.awt.Font font
        The font that we're displaying.
      • numChars

        protected int numChars
        The number of characters in the font.
      • numColumns

        protected final int numColumns
        The number of characters displayed in a row.
        See Also:
        Constant Field Values
      • numRows

        protected int numRows
        Number of rows needed to display the whole font.
    • Constructor Detail

      • SelectCharactersModel

        public SelectCharactersModel​(java.awt.Font font)
        Create an instance of this class.
    • Method Detail

      • setFont

        public void setFont​(java.awt.Font font)
        Set the displayed font.
      • getRowCount

        public int getRowCount()
        Returns the number of records managed by the data source object.
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns. Always two, the plot name and whether it is displaying the "current" spectrum.
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int column)
        Return the value of a given cell.
      • getColumnName

        public java.lang.String getColumnName​(int index)
        Return the column names. There are none.
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
        Overrides:
        getColumnName in class javax.swing.table.AbstractTableModel
      • getColumnClass

        public java.lang.Class getColumnClass​(int index)
        Return the column classes. All Strings.
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int column)
        Nothing is editable.
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
      • setValueAt

        public void setValueAt​(java.lang.Object value,
                               int row,
                               int column)
        Since nothing can be changed. This also does nothing.
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel