net.sf.magicproject.ui
Class MCardTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.sf.magicproject.ui.MCardTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class MCardTableModel
extends javax.swing.table.AbstractTableModel

Since:
0.94 create a TableModel with a list of MCardCompare
Author:
Fabrice Daugan
See Also:
Serialized Form

Constructor Summary
MCardTableModel(MListModel<MCardCompare> mCardList)
          Create a new TableModel with an MCardCompare list as source for cells.
 
Method Summary
 MListModel<MCardCompare> getCards()
           
 int getColumnCount()
          number of columns of the table
 int getRowCount()
          number of rowns of the table
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          get the value in cell [rowIndex; columnIndex]
 boolean isCellEditable(int rowIndex, int columnIndex)
          only the quantities column may be edited
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          set value at cell [rowIndex; columnIndex]
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCardTableModel

public MCardTableModel(MListModel<MCardCompare> mCardList)
Create a new TableModel with an MCardCompare list as source for cells.

Parameters:
mCardList -
Method Detail

getColumnCount

public int getColumnCount()
number of columns of the table

Returns:
2 columns

getRowCount

public int getRowCount()
number of rowns of the table

Returns:
number of cards in deck

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
only the quantities column may be edited

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
get the value in cell [rowIndex; columnIndex]

Parameters:
rowIndex -
columnIndex -
Returns:
cell value

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
set value at cell [rowIndex; columnIndex]

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getCards

public MListModel<MCardCompare> getCards()
Returns:
mCardList -> list of cards


Copyright © 2003-2007 Magic-Project. All Rights Reserved.