net.shredzone.ifish.gui
Class PlaylistTableModel

java.lang.Object
  extended by net.shredzone.ifish.gui.PlaylistTableModel
All Implemented Interfaces:
EventListener, ListDataListener, TableModel

public class PlaylistTableModel
extends Object
implements TableModel, ListDataListener

This is a TableModel for Playlists.

Version:
$Id: PlaylistTableModel.java 291 2009-04-28 21:29:27Z shred $

Constructor Summary
PlaylistTableModel(Playlist pl)
          Create a PlaylistTableModel for the given Playlist.
 
Method Summary
 void addTableModelListener(TableModelListener l)
          Add a table model listener.
 void contentsChanged(ListDataEvent e)
          ListDataListener implementation, do not use.
protected  void fireTableModelListener(ListDataEvent e)
          Fire a TableModelEvent according to the ListDataEvent passed.
 Class<?> getColumnClass(int columnIndex)
          Get the class of the column.
 int getColumnCount()
          Get the number of columns.
 String getColumnName(int columnIndex)
          Get the column name.
 Entry getEntryAt(int rowIndex)
          Get the Entry of a row.
 Playlist getPlaylist()
          Get the playlist.
 int getRowCount()
          Get the number of rows.
 Object getValueAt(int rowIndex, int columnIndex)
          Get the value of a cell.
 void intervalAdded(ListDataEvent e)
          ListDataListener implementation, do not use.
 void intervalRemoved(ListDataEvent e)
          ListDataListener implementation, do not use.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Check if the cell is editable.
 void removeTableModelListener(TableModelListener l)
          Remove a table model listener.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
          Set the value of a cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaylistTableModel

public PlaylistTableModel(Playlist pl)
Create a PlaylistTableModel for the given Playlist.

Parameters:
pl - Playlist to create a model for.
Method Detail

getColumnCount

public int getColumnCount()
Get the number of columns.

Specified by:
getColumnCount in interface TableModel
Returns:
Number of columns.

getRowCount

public int getRowCount()
Get the number of rows.

Specified by:
getRowCount in interface TableModel
Returns:
Number of rows.

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Check if the cell is editable. This is always false.

Specified by:
isCellEditable in interface TableModel
Parameters:
rowIndex - Row index of the cell
columnIndex - Column index of the cell
Returns:
false

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Get the class of the column.

Specified by:
getColumnClass in interface TableModel
Parameters:
columnIndex - Column index to get the class for
Returns:
The class.

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Get the value of a cell.

Specified by:
getValueAt in interface TableModel
Parameters:
rowIndex - Cell row.
columnIndex - Cell column.
Returns:
Value of that cell.

getEntryAt

public Entry getEntryAt(int rowIndex)
Get the Entry of a row.

Parameters:
rowIndex - Row number
Returns:
Entry at this row, or null

getPlaylist

public Playlist getPlaylist()
Get the playlist.

Returns:
Playlist

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Set the value of a cell. Always ignored.

Specified by:
setValueAt in interface TableModel
Parameters:
aValue - New value
rowIndex - Cell row
columnIndex - Cell column

getColumnName

public String getColumnName(int columnIndex)
Get the column name.

Specified by:
getColumnName in interface TableModel
Parameters:
columnIndex - Column
Returns:
Name of the column.

addTableModelListener

public void addTableModelListener(TableModelListener l)
Add a table model listener.

Specified by:
addTableModelListener in interface TableModel
Parameters:
l - TableModelListener to be added.

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Remove a table model listener.

Specified by:
removeTableModelListener in interface TableModel
Parameters:
l - TableModelListener to be removed.

fireTableModelListener

protected void fireTableModelListener(ListDataEvent e)
Fire a TableModelEvent according to the ListDataEvent passed.

Parameters:
e - ListDataEvent

contentsChanged

public void contentsChanged(ListDataEvent e)
ListDataListener implementation, do not use.

Specified by:
contentsChanged in interface ListDataListener
Parameters:
e - ListDataEvent

intervalAdded

public void intervalAdded(ListDataEvent e)
ListDataListener implementation, do not use.

Specified by:
intervalAdded in interface ListDataListener
Parameters:
e - ListDataEvent

intervalRemoved

public void intervalRemoved(ListDataEvent e)
ListDataListener implementation, do not use.

Specified by:
intervalRemoved in interface ListDataListener
Parameters:
e - ListDataEvent


Copyright © 2007-2011 shredzone.org. All Rights Reserved.