|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
rle.simple.ui.InventoryTableModel
public class InventoryTableModel
Base Class Model for tables of items.
Field Summary | |
---|---|
protected ItemFilter |
filter
|
protected Inventory |
inventory
|
protected java.util.Comparator |
slotComparator
|
protected java.util.ArrayList<rle.simple.ui.InventoryTableModel.Slot> |
slots
|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
InventoryTableModel(Inventory inventory,
ItemFilter filter,
java.util.Comparator slotComparator)
Constructs an ItemTableModel that can be used to drive a table for the items in an Inventory. |
Method Summary | |
---|---|
protected void |
buildSlots()
Initializes or updates the model. |
char |
getCharacterForRow(int row)
Returns the character which must be keyed to reference the item(s) at the given row in the table. |
int |
getColumnCount()
|
ItemContainer |
getItemContainer()
The item container. |
Item |
getItemForRow(int row)
Return the first item represented by a row in the table. |
java.util.List<Item> |
getItemsForRow(int row)
Return the items represented by a row in the table. |
int |
getRowCount()
|
java.lang.Object |
getValueAt(int row,
int column)
|
void |
itemAdded(ItemContainerEvent event)
|
void |
itemRemoved(ItemContainerEvent event)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnName, isCellEditable, removeTableModelListener, setValueAt |
Field Detail |
---|
protected Inventory inventory
protected java.util.ArrayList<rle.simple.ui.InventoryTableModel.Slot> slots
protected ItemFilter filter
protected java.util.Comparator slotComparator
Constructor Detail |
---|
public InventoryTableModel(Inventory inventory, ItemFilter filter, java.util.Comparator slotComparator)
inventory
- - the inventory to usefilter
- - a filter which indicates which items should be allowed in the tableslotComparator
- - used to sort the items into slots.Method Detail |
---|
public ItemContainer getItemContainer()
getItemContainer
in interface ItemTableModel
public char getCharacterForRow(int row)
getCharacterForRow
in interface ItemTableModel
public Item getItemForRow(int row)
getItemForRow
in interface ItemTableModel
public java.util.List<Item> getItemsForRow(int row)
getItemsForRow
in interface ItemTableModel
protected void buildSlots()
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int row, int column)
getValueAt
in interface javax.swing.table.TableModel
public void itemAdded(ItemContainerEvent event)
itemAdded
in interface ItemContainerListener
public void itemRemoved(ItemContainerEvent event)
itemRemoved
in interface ItemContainerListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |