com.compomics.util.gui.spectrum
Class IonLabelColorTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by com.compomics.util.gui.spectrum.IonLabelColorTableModel
All Implemented Interfaces:
Serializable, TableModel

public class IonLabelColorTableModel
extends DefaultTableModel

A table model to use for the ion label annotation colors.

Author:
Marc Vaudel
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
IonLabelColorTableModel()
          Constructor which sets a new empty table.
IonLabelColorTableModel(HashMap<Ion.IonType,ArrayList<Integer>> iontypes, ArrayList<NeutralLoss> neutralLosses)
          Constructor which sets a new table.
 
Method Summary
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 Ion getIonAtRow(int rowIndex)
          Returns the ion type at the given row.
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
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
 

Constructor Detail

IonLabelColorTableModel

public IonLabelColorTableModel(HashMap<Ion.IonType,ArrayList<Integer>> iontypes,
                               ArrayList<NeutralLoss> neutralLosses)
Constructor which sets a new table.

Parameters:
iontypes -
neutralLosses -

IonLabelColorTableModel

public IonLabelColorTableModel()
Constructor which sets a new empty table.

Method Detail

getIonAtRow

public Ion getIonAtRow(int rowIndex)
Returns the ion type at the given row.

Parameters:
rowIndex - the table row index
Returns:
the ion type at the given row

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel
Overrides:
getRowCount in class DefaultTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel
Overrides:
getColumnCount in class DefaultTableModel

getColumnName

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

getValueAt

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

getColumnClass

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

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class DefaultTableModel


Copyright © 2012. All Rights Reserved.