JSampler
v0.8a

org.jsampler.view
Class InstrumentsDbTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.jsampler.view.InstrumentsDbTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class InstrumentsDbTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Nested Class Summary
static class InstrumentsDbTableModel.ColumnType
           
 
Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
InstrumentsDbTableModel()
          Creates a new instance of InstrumentsDbTableModel.
InstrumentsDbTableModel(DbDirectoryTreeNode node)
          Creates a new instance of InstrumentsDbTableModel.
 
Method Summary
 int getColumnCount()
          Gets the number of columns in the model.
 java.lang.String getColumnName(int col)
          Gets the name of the column at columnIndex.
 InstrumentsDbTableModel.ColumnType getColumnType(int index)
          Gets the type of the specified column.
 java.util.Comparator getComparator(int col)
          Returns a comparator for the specified column or null if there is no suitable comparator for the specified column.
 DbDirectoryTreeNode getDirectoryNode(int index)
          Gets the directory at the specified row index or null there is no directory at the specified index.
 int getDirectoryRowIndex(java.lang.String dir)
          Gets the row index of the specified directory.
 int getDummyColumnIndex()
          Gets the index of the dummy column.
 DbInstrumentInfo getInstrument(int index)
          Gets the instrument at the specified row index or null there is no instrument at the specified index.
 int getInstrumentRowIndex(java.lang.String instr)
          Gets the row index of the specified instrument.
protected  DbDirectoryTreeNode getParentDirectoryNode()
          Gets the directory node, which content is represented by this table model.
 java.lang.String getRenamedDirectory()
          Gets the name of the last renamed directory through this table model.
 java.lang.String getRenamedInstrument()
          Gets the name of the last renamed instrument through this table model.
 int getRowCount()
          Gets the number of rows in the model.
 boolean getShowArtistsColumn()
          Gets whether the Artists column is shown.
 boolean getShowCreatedColumn()
          Gets whether the Date Created column is shown.
 boolean getShowDummyColumn()
          Gets whether the Dummy column is shown.
 boolean getShowFormatFamilyColumn()
          Gets whether the Format column is shown.
 boolean getShowFormatVersionColumn()
          Gets whether the Version column is shown.
 boolean getShowInstrumentFileColumn()
          Gets whether the Instrument File column is shown.
 boolean getShowInstrumentNrColumn()
          Gets whether the Index column is shown.
 boolean getShowIsDrumColumn()
          Gets whether the Type column is shown.
 boolean getShowKeywordsColumn()
          Gets whether the Keywords column is shown.
 boolean getShowModifiedColumn()
          Gets whether the Date Modified column is shown.
 boolean getShowProductColumn()
          Gets whether the Product column is shown.
 boolean getShowSizeColumn()
          Gets whether the Size column is shown.
 java.lang.Object getValueAt(int row, int col)
          Gets the value for the cell at columnIndex and rowIndex.
 boolean isCellEditable(int row, int col)
          Returns true if the cell at row and col is editable.
 boolean isSortable(int col)
          Determines whether the specified column is sortable.
protected  void setParentDirectoryNode(DbDirectoryTreeNode node)
          Sets the directory node, which content will be represented by this table model.
 void setRenamedDirectory(java.lang.String dir)
          Sets the name of the last renamed directory through this table model.
 void setRenamedInstrument(java.lang.String instr)
          Sets the name of the last renamed instrument through this table model.
 void setShowArtistsColumn(boolean b)
          Sets whether the Artists column should be shown.
 void setShowCreatedColumn(boolean b)
          Sets whether the Date Created column should be shown.
 void setShowDummyColumn(boolean b)
          Sets whether the Dummy column should be shown.
 void setShowFormatFamilyColumn(boolean b)
          Sets whether the Format column should be shown.
 void setShowFormatVersionColumn(boolean b)
          Sets whether the Version column should be shown.
 void setShowInstrumentFileColumn(boolean b)
          Sets whether the Instrument File column should be shown.
 void setShowInstrumentNrColumn(boolean b)
          Sets whether the Index column should be shown.
 void setShowIsDrumColumn(boolean b)
          Sets whether the Type column should be shown.
 void setShowKeywordsColumn(boolean b)
          Sets whether the Keywords column should be shown.
 void setShowModifiedColumn(boolean b)
          Sets whether the Date Modified column should be shown.
 void setShowProductColumn(boolean b)
          Sets whether the Product column should be shown.
 void setShowSizeColumn(boolean b)
          Sets whether the Size column should be shown.
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the value in the cell at col and row to value.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentsDbTableModel

public InstrumentsDbTableModel()
Creates a new instance of InstrumentsDbTableModel.


InstrumentsDbTableModel

public InstrumentsDbTableModel(DbDirectoryTreeNode node)
Creates a new instance of InstrumentsDbTableModel.

Method Detail

getColumnType

public InstrumentsDbTableModel.ColumnType getColumnType(int index)
Gets the type of the specified column.

Parameters:
index - The index of the column.

getDummyColumnIndex

public int getDummyColumnIndex()
Gets the index of the dummy column.


getShowSizeColumn

public boolean getShowSizeColumn()
Gets whether the Size column is shown.


setShowSizeColumn

public void setShowSizeColumn(boolean b)
Sets whether the Size column should be shown.


getShowFormatFamilyColumn

public boolean getShowFormatFamilyColumn()
Gets whether the Format column is shown.


setShowFormatFamilyColumn

public void setShowFormatFamilyColumn(boolean b)
Sets whether the Format column should be shown.


getShowFormatVersionColumn

public boolean getShowFormatVersionColumn()
Gets whether the Version column is shown.


setShowFormatVersionColumn

public void setShowFormatVersionColumn(boolean b)
Sets whether the Version column should be shown.


getShowIsDrumColumn

public boolean getShowIsDrumColumn()
Gets whether the Type column is shown.


setShowIsDrumColumn

public void setShowIsDrumColumn(boolean b)
Sets whether the Type column should be shown.


getShowCreatedColumn

public boolean getShowCreatedColumn()
Gets whether the Date Created column is shown.


setShowCreatedColumn

public void setShowCreatedColumn(boolean b)
Sets whether the Date Created column should be shown.


getShowModifiedColumn

public boolean getShowModifiedColumn()
Gets whether the Date Modified column is shown.


setShowModifiedColumn

public void setShowModifiedColumn(boolean b)
Sets whether the Date Modified column should be shown.


getShowProductColumn

public boolean getShowProductColumn()
Gets whether the Product column is shown.


setShowProductColumn

public void setShowProductColumn(boolean b)
Sets whether the Product column should be shown.


getShowArtistsColumn

public boolean getShowArtistsColumn()
Gets whether the Artists column is shown.


setShowArtistsColumn

public void setShowArtistsColumn(boolean b)
Sets whether the Artists column should be shown.


getShowInstrumentFileColumn

public boolean getShowInstrumentFileColumn()
Gets whether the Instrument File column is shown.


setShowInstrumentFileColumn

public void setShowInstrumentFileColumn(boolean b)
Sets whether the Instrument File column should be shown.


getShowInstrumentNrColumn

public boolean getShowInstrumentNrColumn()
Gets whether the Index column is shown.


setShowInstrumentNrColumn

public void setShowInstrumentNrColumn(boolean b)
Sets whether the Index column should be shown.


getShowKeywordsColumn

public boolean getShowKeywordsColumn()
Gets whether the Keywords column is shown.


setShowKeywordsColumn

public void setShowKeywordsColumn(boolean b)
Sets whether the Keywords column should be shown.


getShowDummyColumn

public boolean getShowDummyColumn()
Gets whether the Dummy column is shown.


setShowDummyColumn

public void setShowDummyColumn(boolean b)
Sets whether the Dummy column should be shown.


getComparator

public java.util.Comparator getComparator(int col)
Returns a comparator for the specified column or null if there is no suitable comparator for the specified column.


isSortable

public boolean isSortable(int col)
Determines whether the specified column is sortable.

Returns:
true if the specified column is sortable, false otherwise.

getParentDirectoryNode

protected DbDirectoryTreeNode getParentDirectoryNode()
Gets the directory node, which content is represented by this table model.


setParentDirectoryNode

protected void setParentDirectoryNode(DbDirectoryTreeNode node)
Sets the directory node, which content will be represented by this table model.


getRenamedInstrument

public java.lang.String getRenamedInstrument()
Gets the name of the last renamed instrument through this table model.


setRenamedInstrument

public void setRenamedInstrument(java.lang.String instr)
Sets the name of the last renamed instrument through this table model.


getRenamedDirectory

public java.lang.String getRenamedDirectory()
Gets the name of the last renamed directory through this table model.


setRenamedDirectory

public void setRenamedDirectory(java.lang.String dir)
Sets the name of the last renamed directory through this table model.


getColumnCount

public int getColumnCount()
Gets the number of columns in the model.

Returns:
The number of columns in the model.

getRowCount

public int getRowCount()
Gets the number of rows in the model.

Returns:
The number of rows in the model.

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of the column at columnIndex.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Returns:
The name of the column at columnIndex.

getDirectoryNode

public DbDirectoryTreeNode getDirectoryNode(int index)
Gets the directory at the specified row index or null there is no directory at the specified index.


getInstrument

public DbInstrumentInfo getInstrument(int index)
Gets the instrument at the specified row index or null there is no instrument at the specified index.


getDirectoryRowIndex

public int getDirectoryRowIndex(java.lang.String dir)
Gets the row index of the specified directory.

Parameters:
dir - The name of the directory.
Returns:
The row index of the specified directory or -1 if the specified directory is not found.

getInstrumentRowIndex

public int getInstrumentRowIndex(java.lang.String instr)
Gets the row index of the specified instrument.

Parameters:
instr - The name of the instrument.
Returns:
The row index of the specified instrument or -1 if the specified instrument is not found.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets the value for the cell at columnIndex and rowIndex.

Parameters:
row - The row whose value is to be queried.
col - The column whose value is to be queried.
Returns:
The value for the cell at columnIndex and rowIndex.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the value in the cell at col and row to value.

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

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Returns true if the cell at row and col is editable.

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

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.