|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
ch.randelshofer.cubetwister.doc.CubeStickersTableModel
public class CubeStickersTableModel
Wraps the macros provided by CubeModel to make them accessible by a MutableJTable.
| Field Summary |
|---|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
CubeStickersTableModel()
Creates a new CubeColorsTableModel which wraps a default CubeModel. |
|
CubeStickersTableModel(CubeModel n)
Creates a new CubeColorsTableModel which wraps the provided CubeModel. |
|
| Method Summary | |
|---|---|
void |
createRow(int row,
java.lang.Object type)
Invoke this to duplicate a row of the table. |
java.awt.datatransfer.Transferable |
exportRowTransferable(int[] rows)
Creates a Transferable to use as the source for a data transfer of the specified elements. |
java.lang.Class |
getColumnClass(int column)
Returns the most specific superclass for all the cell values in the column. |
int |
getColumnCount()
Returns the number of columns in the model. |
java.lang.String |
getColumnName(int columnIndex)
Returns the name of the column at columnIndex. |
java.lang.Object |
getCreatableRowType(int row)
Returns the default type of elements that can be created at the specified index of the list. |
java.lang.Object[] |
getCreatableRowTypes(int row)
Returns an empty array since insertion of stickers is not allowed. |
javax.swing.Action[] |
getRowActions(int[] rows)
Gets actions for the indicated rows. |
int |
getRowCount()
Returns the number of rows in the model. |
CubeStickerModel |
getRowObject(int row)
|
java.lang.Object |
getValueAt(int row,
int column)
Returns the value for the cell at columnIndex and rowIndex. |
int |
importRowTransferable(java.awt.datatransfer.Transferable transfer,
int action,
int row,
boolean asChild)
Causes a transfer to the model from a clipboard or a DND drop operation. |
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at rowIndex and columnIndex is editable. |
boolean |
isRowAddable(int row)
Returns true if a row can be added. |
boolean |
isRowDuplicateable(int row)
Returns wether a row may be duplicated. |
boolean |
isRowImportable(java.awt.datatransfer.DataFlavor[] flavors,
int action,
int row,
boolean asChild)
Indicates whether the model would accept an import of the given set of data flavors prior to actually attempting to import it. |
boolean |
isRowInsertable(java.lang.Object type,
int row)
Returns wether a row may be inserted. |
boolean |
isRowRemovable(int row)
Returns wether the specified node may be removed. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removeRow(int row)
Message this to remove a row from the table. |
void |
setModel(CubeModel value)
|
void |
setValueAt(java.lang.Object value,
int row,
int column)
Sets the value in the cell at columnIndex and rowIndex to aValue is the new value. |
void |
treeNodesChanged(javax.swing.event.TreeModelEvent evt)
Invoked after a node (or a set of siblings) has changed in some way. |
void |
treeNodesInserted(javax.swing.event.TreeModelEvent evt)
Invoked after nodes have been inserted into the tree. |
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent evt)
Invoked after nodes have been removed from the tree. |
void |
treeStructureChanged(javax.swing.event.TreeModelEvent evt)
Invoked after the tree has drastically changed structure from a given node down. |
| 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 |
| Methods inherited from interface javax.swing.table.TableModel |
|---|
addTableModelListener, removeTableModelListener |
| Constructor Detail |
|---|
public CubeStickersTableModel()
public CubeStickersTableModel(CubeModel n)
| Method Detail |
|---|
public void setModel(CubeModel value)
public CubeStickerModel getRowObject(int row)
public java.lang.Object getValueAt(int row,
int column)
getValueAt in interface javax.swing.table.TableModelrow - the row whose value is to be looked upcolumn - the column whose value is to be looked up
public java.lang.String getColumnName(int columnIndex)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelcolumnIndex - the index of column
public boolean isRowInsertable(java.lang.Object type,
int row)
row - index of the new row.public boolean isRowDuplicateable(int row)
row - index of the new row.public int getRowCount()
getRowCount in interface javax.swing.table.TableModelgetColumnCount()
public void createRow(int row,
java.lang.Object type)
createRow in interface MutableTableModelrow - index of the row.type - element type to be inserted.
java.lang.IllegalStateException - if the row may not be duplicated.
public boolean isCellEditable(int row,
int column)
isCellEditable in interface MutableTableModelisCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModelrow - the row whose value is to be looked upcolumn - the column whose value is to be looked up
setValueAt(java.lang.Object, int, int)
public void setValueAt(java.lang.Object value,
int row,
int column)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelvalue - the new valuerow - the row whose value is to be changedcolumn - the column whose value is to be changedgetValueAt(int, int),
isCellEditable(int, int)public java.lang.Class getColumnClass(int column)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModelpublic void removeRow(int row)
removeRow in interface MutableTableModelrow - index of the row.
java.lang.IllegalStateException - if the row may not be removed.MutableTableModel.isRowRemovable(int)public boolean isRowRemovable(int row)
isRowRemovable in interface MutableTableModelrow - index of the row.MutableTableModel.removeRow(int)public int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelgetRowCount()public javax.swing.Action[] getRowActions(int[] rows)
getRowActions in interface MutableTableModelrows - indexes of the rows.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpublic void treeStructureChanged(javax.swing.event.TreeModelEvent evt)
Invoked after the tree has drastically changed structure from a given node down. If the path returned by e.getPath() is of length one and the first element does not identify the current root node the first element should become the new root of the tree.
evt.path() holds the path to the node.
evt.childIndices() returns null.
treeStructureChanged in interface javax.swing.event.TreeModelListenerpublic void treeNodesInserted(javax.swing.event.TreeModelEvent evt)
Invoked after nodes have been inserted into the tree.
e.path() returns the parent of the new nodes
e.childIndices() returns the indices of the new nodes in ascending order.
treeNodesInserted in interface javax.swing.event.TreeModelListenerpublic void treeNodesRemoved(javax.swing.event.TreeModelEvent evt)
Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed.
e.path() returns the former parent of the deleted nodes.
e.childIndices() returns the indices the nodes had before they were deleted in ascending order.
treeNodesRemoved in interface javax.swing.event.TreeModelListenerpublic void treeNodesChanged(javax.swing.event.TreeModelEvent evt)
Invoked after a node (or a set of siblings) has changed in some way. The node(s) have not changed locations in the tree or altered their children arrays, but other attributes have changed and may affect presentation. Example: the name of a file has changed, but it is in the same location in the file system.
To indicate the root has changed, childIndices and children will be null.
evt.path() returns the path the parent of the changed node(s).
evt.childIndices() returns the index(es) of the changed node(s).
treeNodesChanged in interface javax.swing.event.TreeModelListenerpublic java.lang.Object[] getCreatableRowTypes(int row)
getCreatableRowTypes in interface MutableTableModelrow - The insertion point. 0 <= index <= getRowCount()
public java.lang.Object getCreatableRowType(int row)
MutableTableModel
getCreatableRowType in interface MutableTableModelrow - The insertion point. 0 <= index <= getRowCount()
public boolean isRowAddable(int row)
MutableTableModel
isRowAddable in interface MutableTableModelrow - index of the element. 0 <= index <= getSize()
public int importRowTransferable(java.awt.datatransfer.Transferable transfer,
int action,
int row,
boolean asChild)
MutableTableModel
importRowTransferable in interface MutableTableModeltransfer - The transfer data.action - The action DnDConstants.ACTION_COPY, .ACTION_MOVE or
.ACTION_LINK.row - The insertion point. 0 <= row <= getRowCount()asChild - Indicates that the item is to be imported as a child
of the list item rather than as an individual element
of the list.
public boolean isRowImportable(java.awt.datatransfer.DataFlavor[] flavors,
int action,
int row,
boolean asChild)
MutableTableModel
isRowImportable in interface MutableTableModelflavors - the data formats availableaction - The action DnDConstants.ACTION_COPY, .ACTION_MOVE or
.ACTION_LINK.row - The insertion point. 0 <= row <= getRowCount()asChild - Indicates that the item is to be imported as a child
of the list item rather than as an individual element
/ of the list.
DnDConstantspublic java.awt.datatransfer.Transferable exportRowTransferable(int[] rows)
MutableTableModel
exportRowTransferable in interface MutableTableModelrows - Row indices.
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||