uk.ac.starlink.util.gui
Class SelectCharactersModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by 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:
Serialized Form

Field Summary
protected  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
SelectCharactersModel(Font font)
          Create an instance of this class.
 
Method Summary
 Class getColumnClass(int index)
          Return the column classes.
 int getColumnCount()
          Returns the number of columns.
 String getColumnName(int index)
          Return the column names.
 int getRowCount()
          Returns the number of records managed by the data source object.
 Object getValueAt(int row, int column)
          Return the value of a given cell.
 boolean isCellEditable(int row, int column)
          Nothing is editable.
 void setFont(Font font)
          Set the displayed font.
 void setValueAt(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 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(Font font)
Create an instance of this class.

Method Detail

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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.