PIRL

PIRL.Conductor.Maestro
Class Conductor_Matrix_Model

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by PIRL.Conductor.Maestro.Conductor_Matrix_Model
All Implemented Interfaces:
Serializable, EventListener, TableModelListener, TableModel

public class Conductor_Matrix_Model
extends AbstractTableModel
implements TableModelListener

A Conductor_Matrix_Model contains the data for a matrix of the number of Conductors at each Theater location.

Each column of the matrix table is for a theater location. Each row is for a Conductor name. Each cell contains the number of Conductors having the row name operating on the theater location of the column name.

Version:
1.15
Author:
Bradford Castalia, UA/PIRL
See Also:
Serialized Form

Nested Class Summary
 class Conductor_Matrix_Model.Count
          A Count contains table cell Conductor processing state count values.
 
Field Summary
static String CONDUCTORS_COLUMN_NAME
           
static int HALTED
          Index for arrays of processing state information.
static int HALTED_STATE
           
static String ID
          Class identification name with source code version and date.
static int POLLING
          Index for arrays of processing state information.
static int POLLING_STATE
           
static int RUN_TO_WAIT_STATE
           
static int RUNNING
          Index for arrays of processing state information.
static int RUNNING_STATE
           
static int TOTAL
          Index for arrays of processing state information.
static String TOTALS_NAME
           
static int UNKNOWN
          Index for arrays of processing state information.
static int WAITING
          Index for arrays of processing state information.
static int WAITING_STATE
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
Conductor_Matrix_Model(Conductor_Table_Model table_model)
           
 
Method Summary
protected  void Add_to(int column, String theater_location, int row, String conductor_name, int processing_state)
           
protected  Conductor_Matrix_Model Add(Message identity)
           
 int Column(Message identity)
          Get the table column index for a Conductor identity.
 Conductor_Matrix_Model.Count Count(int row, int column)
           
 Conductor_Matrix_Model.Count Count(Message identity)
           
 int findColumn(String theater_location)
           
 int findRow(String conductor_name)
           
 Class getColumnClass(int column)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
protected  void Rebuild(Conductor_Table_Model model)
           
protected  void Removing(Message identity)
          Adjust the model based on the removal of a Conductor identity.
 int Row(Message identity)
          Get the table row index for a Conductor identity.
 void tableChanged(TableModelEvent event)
           
 int Total(int row, int column)
           
 int Total(Message identity)
           
 int Total(String theater_location, String conductor_name)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

CONDUCTORS_COLUMN_NAME

public static final String CONDUCTORS_COLUMN_NAME
See Also:
Constant Field Values

TOTALS_NAME

public static final String TOTALS_NAME
See Also:
Constant Field Values

RUN_TO_WAIT_STATE

public static final int RUN_TO_WAIT_STATE
See Also:
Constant Field Values

RUNNING_STATE

public static final int RUNNING_STATE
See Also:
Constant Field Values

POLLING_STATE

public static final int POLLING_STATE
See Also:
Constant Field Values

WAITING_STATE

public static final int WAITING_STATE
See Also:
Constant Field Values

HALTED_STATE

public static final int HALTED_STATE
See Also:
Constant Field Values

RUNNING

public static final int RUNNING
Index for arrays of processing state information.

See Also:
Constant Field Values

POLLING

public static final int POLLING
Index for arrays of processing state information.

See Also:
Constant Field Values

WAITING

public static final int WAITING
Index for arrays of processing state information.

See Also:
Constant Field Values

HALTED

public static final int HALTED
Index for arrays of processing state information.

See Also:
Constant Field Values

TOTAL

public static final int TOTAL
Index for arrays of processing state information.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Index for arrays of processing state information.

See Also:
Constant Field Values
Constructor Detail

Conductor_Matrix_Model

public Conductor_Matrix_Model(Conductor_Table_Model table_model)
Method Detail

findColumn

public int findColumn(String theater_location)
Overrides:
findColumn in class AbstractTableModel

findRow

public int findRow(String conductor_name)

getColumnClass

public Class getColumnClass(int column)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

Column

public int Column(Message identity)
Get the table column index for a Conductor identity.

Returns:
The table column index for the Conductor identity. This will be -1 if the identity is null, empty, or has a Theater location not present in this table.

Row

public int Row(Message identity)
Get the table row index for a Conductor identity.

Returns:
The table row index for the Conductor identity. This will be -1 if the identity is null, empty, or has a Conductor name not present in this table.

Count

public Conductor_Matrix_Model.Count Count(int row,
                                          int column)

Count

public Conductor_Matrix_Model.Count Count(Message identity)

Total

public int Total(int row,
                 int column)

Total

public int Total(String theater_location,
                 String conductor_name)

Total

public int Total(Message identity)

Add

protected Conductor_Matrix_Model Add(Message identity)

Add_to

protected void Add_to(int column,
                      String theater_location,
                      int row,
                      String conductor_name,
                      int processing_state)

Rebuild

protected void Rebuild(Conductor_Table_Model model)

Removing

protected void Removing(Message identity)
Adjust the model based on the removal of a Conductor identity.

If the identity can be associated with a table cell its Count values are decremented.

Parameters:
identity - A Conductor identity Message.

tableChanged

public void tableChanged(TableModelEvent event)
Specified by:
tableChanged in interface TableModelListener

PIRL

Copyright (C) \ 2003-2009 Bradford Castalia, University of Arizona