apg_config
Class APGEntryItemModel

java.lang.Object
javax.swing.table.AbstractTableModel
apg_config.APGEntryItemModel
- All Implemented Interfaces:
- APGImageCacheManagerListener, java.io.Serializable, javax.swing.table.TableModel
- public class APGEntryItemModel
- extends javax.swing.table.AbstractTableModel
- implements APGImageCacheManagerListener
Defines a model that is used to display a panel of icons (similar to an image browser).
|
Method Summary |
void |
apgEntryChanged(APGEntryItem item)
|
private java.awt.Dimension |
convertIndexToRowColumn(double index)
|
private int |
convertRowColumnToIndex(int row,
int column)
|
private void |
createValueMapping()
This is called in order to create a mapping between index number and apg entry item object
so that lookups against index/objects are quick. |
void |
dataChanged()
|
private APGEntryItem |
getAPGEntryItemFromIndex(int index)
|
java.lang.Class |
getColumnClass(int col)
Returns the Class for all Object instances
in the specified column. |
int |
getColumnCount()
Returns the number of columns in the model. |
java.lang.String |
getColumnName(int col)
Returns the name of the specified column. |
private int |
getIndexFromAPGEntryItem(APGEntryItem item)
|
int |
getRowCount()
Returns the number of rows in the model. |
java.lang.Object |
getValueAt(int row,
int col)
Returns the value (Object) at a particular cell in the
table. |
void |
imageUpdate(APGEntryItem item,
int size)
|
boolean |
isCellEditable(int row,
int col)
Returns true if the specified cell is editable, and
false if it is not. |
private boolean |
notInitialised()
|
void |
requestAllCells()
|
void |
setAPGEntry(APGEntry entry,
boolean event)
|
void |
setImageIconSize(int size,
boolean event)
|
void |
setTable(javax.swing.JTable table)
|
void |
setValueAt(java.lang.Object value,
int row,
int col)
Sets the value of the given cell. |
void |
setWidth(int w,
boolean event)
|
void |
structureChanged()
|
| 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 |
itemList
private java.util.SortedSet itemList
- This set is sorted when it comes in from the APGEntry item. And in order to make lookups
quick is run in parallel with the itemMapping vector. See createValueMapping() method.
itemMapping
private java.util.Vector itemMapping
width
private int width
rowHeight
private int rowHeight
entry
private APGEntry entry
cache
private APGImageCacheManager cache
renderInfoArray
private APGEntryItemRenderInfo[] renderInfoArray
table
private javax.swing.JTable table
columnCount
private int columnCount
rowCount
private int rowCount
iconSize
private int iconSize
APGEntryItemModel
public APGEntryItemModel()
setTable
public void setTable(javax.swing.JTable table)
setAPGEntry
public void setAPGEntry(APGEntry entry,
boolean event)
setImageIconSize
public void setImageIconSize(int size,
boolean event)
setWidth
public void setWidth(int w,
boolean event)
imageUpdate
public void imageUpdate(APGEntryItem item,
int size)
- Specified by:
imageUpdate in interface APGImageCacheManagerListener
convertRowColumnToIndex
private int convertRowColumnToIndex(int row,
int column)
convertIndexToRowColumn
private java.awt.Dimension convertIndexToRowColumn(double index)
getIndexFromAPGEntryItem
private int getIndexFromAPGEntryItem(APGEntryItem item)
getAPGEntryItemFromIndex
private APGEntryItem getAPGEntryItemFromIndex(int index)
isCellEditable
public boolean isCellEditable(int row,
int col)
- Description copied from class:
javax.swing.table.AbstractTableModel
- Returns
true if the specified cell is editable, and
false if it is not. This implementation returns
false for all arguments, subclasses should override the
method if necessary.
- Specified by:
isCellEditable in interface javax.swing.table.TableModel
getColumnCount
public int getColumnCount()
- Description copied from interface:
javax.swing.table.TableModel
- Returns the number of columns in the model.
- Specified by:
getColumnCount in interface javax.swing.table.TableModel
getRowCount
public int getRowCount()
- Description copied from interface:
javax.swing.table.TableModel
- Returns the number of rows in the model.
- Specified by:
getRowCount in interface javax.swing.table.TableModel
setValueAt
public void setValueAt(java.lang.Object value,
int row,
int col)
- Description copied from class:
javax.swing.table.AbstractTableModel
- Sets the value of the given cell. This implementation ignores all
arguments and does nothing, subclasses should override the
method if necessary.
- Specified by:
setValueAt in interface javax.swing.table.TableModel
getValueAt
public java.lang.Object getValueAt(int row,
int col)
- Description copied from interface:
javax.swing.table.TableModel
- Returns the value (
Object) at a particular cell in the
table.
- Specified by:
getValueAt in interface javax.swing.table.TableModel
getColumnClass
public java.lang.Class getColumnClass(int col)
- Description copied from class:
javax.swing.table.AbstractTableModel
- Returns the
Class for all Object instances
in the specified column.
- Specified by:
getColumnClass in interface javax.swing.table.TableModel
getColumnName
public java.lang.String getColumnName(int col)
- Description copied from class:
javax.swing.table.AbstractTableModel
- Returns the name of the specified column. This method generates default
names in a sequence (starting with column 0): A, B, C, ..., Z, AA, AB,
AC, ..., AZ, BA, BB, BC, and so on. Subclasses may override this method
to allow column names to be specified on some other basis.
- Specified by:
getColumnName in interface javax.swing.table.TableModel
notInitialised
private boolean notInitialised()
createValueMapping
private void createValueMapping()
- This is called in order to create a mapping between index number and apg entry item object
so that lookups against index/objects are quick.
This is ONLY a performance hack. When another APGEntry is selected (even just because it's
sort order has changed) this mapping is recreated.
Hey, it's excessive on the memory use I guess - but I'll do it for the speed improvement!
requestAllCells
public void requestAllCells()
apgEntryChanged
public void apgEntryChanged(APGEntryItem item)
dataChanged
public void dataChanged()
structureChanged
public void structureChanged()