Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.control.map.swing
Class MapTableModel  view MapTableModel download MapTableModel.java

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bycom.eireneh.bible.control.map.swing.MapTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class MapTableModel
extends javax.swing.table.AbstractTableModel

A MapTableModel takes an underlying map and represents it as a TableModel.
Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
D0.I0.T0

Nested Class Summary
(package private)  class MapTableModel.CustomMapListener
          Sync the map and the table
 
Field Summary
private  MapTableModel.CustomMapListener cml
          The map listener
private static int cols
          The number of columns
private  com.eireneh.bible.control.map.Map map
          The map that we are viewing
private static int vib
          The number of rows
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MapTableModel()
          Basic constructor
MapTableModel(com.eireneh.bible.control.map.Map map)
          Basic constructor
 
Method Summary
 java.lang.Class getColumnClass(int col)
          Returns the lowest common denominator Class in the column.
 int getColumnCount()
          Returns the number of columns in the map
 java.lang.String getColumnName(int col)
          Returns the name of the column at columnIndex.
 com.eireneh.bible.control.map.Map getMap()
          Get the map being viewed
 int getRowCount()
          Returns the number of records in the map
 java.lang.Object getValueAt(int row, int col)
          Returns an attribute value for the cell at col and row.
 boolean isCellEditable(int row, int col)
          Returns true if the cell at row and col is editable.
 void setMap(com.eireneh.bible.control.map.Map map)
          Setup a new map to view
 void setValueAt(java.lang.Object val, int row, int col)
          Sets an attribute value for the record in the cell at col and row.
 
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

map

private com.eireneh.bible.control.map.Map map
The map that we are viewing


vib

private static int vib
The number of rows


cols

private static int cols
The number of columns


cml

private MapTableModel.CustomMapListener cml
The map listener

Constructor Detail

MapTableModel

public MapTableModel(com.eireneh.bible.control.map.Map map)
Basic constructor


MapTableModel

public MapTableModel()
Basic constructor

Method Detail

setMap

public void setMap(com.eireneh.bible.control.map.Map map)
Setup a new map to view


getMap

public com.eireneh.bible.control.map.Map getMap()
Get the map being viewed


getRowCount

public int getRowCount()
Returns the number of records in the map


getColumnCount

public int getColumnCount()
Returns the number of columns in the map


getColumnName

public java.lang.String getColumnName(int col)
Returns the name of the column at columnIndex. This is used to initialize the table's column header name. Note, this name does not need to be unique. Two columns on a table can have the same name.


getColumnClass

public java.lang.Class getColumnClass(int col)
Returns the lowest common denominator Class in the column. This is used by the table to set up a default renderer and editor for the column.


isCellEditable

public boolean isCellEditable(int row,
                              int col)
Returns true if the cell at row and col is editable. Otherwise, setValueAt() on the cell will not change the value of that cell.


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns an attribute value for the cell at col and row.


setValueAt

public void setValueAt(java.lang.Object val,
                       int row,
                       int col)
Sets an attribute value for the record in the cell at col and row. val is the new value.