Class SelectCharactersModel

java.lang.Object
javax.swing.table.AbstractTableModel
uk.ac.starlink.util.gui.SelectCharactersModel
All Implemented Interfaces:
Serializable, TableModel

public class SelectCharactersModel extends 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:
  • Field Details

    • font

      protected 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:
    • numRows

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

    • SelectCharactersModel

      public SelectCharactersModel(Font font)
      Create an instance of this class.
  • Method Details

    • setFont

      public void setFont(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 Object getValueAt(int row, int column)
      Return the value of a given cell.
    • getColumnName

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

      public Class<?> getColumnClass(int index)
      Return the column classes. All Strings.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • isCellEditable

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

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