Overview  Package   Class  Tree  Index 

be.lassi.ui.sheet
Class SheetTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by be.lassi.ui.sheet.SheetTableModel
All Implemented Interfaces:
ShowContextListener, java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
SheetTableModelDetails, SheetTableModelHeaders

public abstract class SheetTableModel
extends javax.swing.table.AbstractTableModel
implements ShowContextListener

Abstract class where the classes SheetTableModelHeaders and SheetTableModelHeaders share what they have in common. This class contains the 'row' definitions, whereas the subclasses handle the 'column' oriented stuff.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
protected SheetTableModel(ShowContext context)
          Constructs a new instance.
 
Method Summary
 void fireCueChannelUpdated(int cueIndex, int channelId)
          Notifies listeners that a cue channel cell has been updated.
 void fireCueSubmasterUpdated(int cueIndex, int submasterIndex)
          Notifies listeners that a cue submaster cell has been updated.
 void fireTableRowUpdated(int row)
          Notifies listeners that row has been updated.
protected  int getChannelIndex(int row)
          Gets the index in the channel collection of the channel on given row.
 javax.swing.table.TableColumnModel getColumnModel()
           
 ShowContext getContext()
           
protected  LightCues getCues()
          Gets the show light cues.
protected  int getRowChannel(int index)
          Gets the row index for the channel at given index.
protected  int getRowChannelWithId(int channelId)
          Gets the row index for given channel.
 int getRowCount()
          The total number of rows in the sheet.
protected  int getRowSubmaster(int submasterIndex)
          Gets the row index for given submaster.
protected  Show getShow()
          Gets the current show.
protected  int getSubmasterIndex(int row)
          Gets the index in the submaster collection of the submaster on given row.
protected  void groupsChanged()
           
 boolean isColumnWithSpecialGridLine(int col)
           
 boolean isCurrentCueColumn(int col)
           
 boolean isRowChannel(int row)
          Indicates whether the row with given index contains channel information.
 boolean isRowSubmaster(int row)
          Indicates whether the row with given index contains submaster information.
 boolean isRowTiming(int row)
          Indicates whether the row with given index contains timing information.
 boolean isRowWithSpecialGridLine(int row)
          Indicates whether given row has a special grid line.
abstract  boolean keyAction(int actionId, int[] rows, int[] cols)
           
 void postShowChange()
          Performs the activities that have to be carried out on the new show after a show change. Start listening for changes in the show groups.
 void preShowChange()
          Performs the activities that have to be carried out on the old show before a show change. Stop listening for changes in the show groups.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
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
getColumnCount, getValueAt
 

Constructor Detail

SheetTableModel

protected SheetTableModel(ShowContext context)
Constructs a new instance.

Parameters:
context - the show context
Method Detail

fireCueChannelUpdated

public void fireCueChannelUpdated(int cueIndex,
                                  int channelId)
Notifies listeners that a cue channel cell has been updated.

Parameters:
cueIndex -
channelId -

fireCueSubmasterUpdated

public void fireCueSubmasterUpdated(int cueIndex,
                                    int submasterIndex)
Notifies listeners that a cue submaster cell has been updated.

Parameters:
cueIndex -
submasterIndex -

fireTableRowUpdated

public void fireTableRowUpdated(int row)
Notifies listeners that row has been updated.

Parameters:
row -

getChannelIndex

protected int getChannelIndex(int row)
Gets the index in the channel collection of the channel on given row.

Parameters:
row -
Returns:
int

getColumnModel

public javax.swing.table.TableColumnModel getColumnModel()

getContext

public ShowContext getContext()

getCues

protected LightCues getCues()
Gets the show light cues.

Returns:
the light cues

getRowChannel

protected int getRowChannel(int index)
Gets the row index for the channel at given index. Note that depending on the current group selection, this index is not necessarily the same as the channel id.

Parameters:
index - the index of channel in the collection of channels that are currently shown
Returns:
int

getRowChannelWithId

protected int getRowChannelWithId(int channelId)
Gets the row index for given channel.

Parameters:
channel - the channel for which to determine the row number
Returns:
the row number, -1 if channel not currently visible

getRowCount

public int getRowCount()
The total number of rows in the sheet.

Specified by:
getRowCount in interface javax.swing.table.TableModel

getRowSubmaster

protected int getRowSubmaster(int submasterIndex)
Gets the row index for given submaster.

Parameters:
submasterIndex -
Returns:
int

getShow

protected Show getShow()
Gets the current show.

Returns:
the current show

getSubmasterIndex

protected int getSubmasterIndex(int row)
Gets the index in the submaster collection of the submaster on given row.

Parameters:
row -
Returns:
int

groupsChanged

protected void groupsChanged()

isColumnWithSpecialGridLine

public boolean isColumnWithSpecialGridLine(int col)

isCurrentCueColumn

public boolean isCurrentCueColumn(int col)

isRowChannel

public boolean isRowChannel(int row)
Indicates whether the row with given index contains channel information.

Parameters:
row -
Returns:
boolean

isRowSubmaster

public boolean isRowSubmaster(int row)
Indicates whether the row with given index contains submaster information.

Parameters:
row -
Returns:
boolean

isRowTiming

public boolean isRowTiming(int row)
Indicates whether the row with given index contains timing information.

Parameters:
row -
Returns:
boolean

isRowWithSpecialGridLine

public boolean isRowWithSpecialGridLine(int row)
Indicates whether given row has a special grid line.

Parameters:
row -
Returns:

keyAction

public abstract boolean keyAction(int actionId,
                                  int[] rows,
                                  int[] cols)

postShowChange

public void postShowChange()
Performs the activities that have to be carried out on the new show after a show change. Start listening for changes in the show groups.

Specified by:
postShowChange in interface ShowContextListener

preShowChange

public void preShowChange()
Performs the activities that have to be carried out on the old show before a show change. Stop listening for changes in the show groups.

Specified by:
preShowChange in interface ShowContextListener

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2