rle.simple.ui
Class InventoryTable

java.lang.Object
  extended by rle.core.vm.PlugInBase
      extended by rle.simple.ui.InventoryTable
All Implemented Interfaces:
PlugIn, ItemTable

public class InventoryTable
extends PlugInBase
implements ItemTable

Presents a UI for an Inventory instance.


Nested Class Summary
 class InventoryTable.DefaultCellRenderer
           
 
Field Summary
protected  ItemTableModel model
           
protected  javax.swing.JTable table
           
 
Fields inherited from class rle.core.vm.PlugInBase
config, context, parameters
 
Constructor Summary
InventoryTable()
           
 
Method Summary
protected  javax.swing.JTable createTable(ItemTableModel model)
          Creates the table for the item container.
 javax.swing.JComponent getComponent()
          The UI.
 ItemContainer getItemContainer()
          The item container.
 java.util.List<Item> getItems(int row)
          Returns a list of the items represented by a given row.
 boolean getItemsShown()
          Visibility of items.
 ItemTableModel getModel()
          The model.
 java.lang.String getTableName()
          User displayable name.
 void setItemsShown(boolean b)
          Visibility of items.
 void setModel(ItemTableModel model)
           
 
Methods inherited from class rle.core.vm.PlugInBase
config, getContext, getParameters, paramMap, setConfig, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected javax.swing.JTable table

model

protected ItemTableModel model
Constructor Detail

InventoryTable

public InventoryTable()
Method Detail

getComponent

public javax.swing.JComponent getComponent()
The UI.

Specified by:
getComponent in interface ItemTable

getModel

public ItemTableModel getModel()
The model.

Specified by:
getModel in interface ItemTable

getItemContainer

public ItemContainer getItemContainer()
The item container.

Specified by:
getItemContainer in interface ItemTable

getTableName

public java.lang.String getTableName()
User displayable name.

Specified by:
getTableName in interface ItemTable

createTable

protected javax.swing.JTable createTable(ItemTableModel model)
Creates the table for the item container. Do not call this method directly; it is called by the constructor. It may be overridden by subclasses to produce a different table.


setModel

public void setModel(ItemTableModel model)

getItems

public java.util.List<Item> getItems(int row)
Returns a list of the items represented by a given row. This could be one or more items, but probably should not be zero items. Note that the List returned by the default implementation is immutable; item insertion/removal should be done by the ItemContainer.


setItemsShown

public void setItemsShown(boolean b)
Visibility of items.

Specified by:
setItemsShown in interface ItemTable

getItemsShown

public boolean getItemsShown()
Visibility of items.

Specified by:
getItemsShown in interface ItemTable