org.esa.beam.visat.toolviews.bitmask
Class BitmaskDefTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.esa.beam.visat.toolviews.bitmask.BitmaskDefTableModel
All Implemented Interfaces:
Serializable, TableModel

public class BitmaskDefTableModel
extends AbstractTableModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
BitmaskDefTableModel()
           
BitmaskDefTableModel(boolean visibleFlagColumnEnabled)
           
 
Method Summary
 void addRow(BitmaskDef bitmaskDef)
           
 void addRow(boolean visibleFlag, BitmaskDef bitmaskDef)
           
 void clear()
           
 BitmaskDef getBitmaskDefAt(int rowIndex)
           
 BitmaskDef[] getBitmaskDefs()
          Returns all bitmask definitions in this model.
 Class getColumnClass(int columnIndex)
          Returns a column's data type.
 int getColumnCount()
          Returns the number of columns in the model.
 String getColumnName(int columnIndex)
          Returns the name for the column.
 int getRowCount()
          Returns the number of rows in the model.
 int getRowIndex(BitmaskDef bitmaskDef)
           
 int getRowIndex(String bitmaskName)
           
 Object getValueAt(int rowIndex, int columnIndex)
          Returns the value for the cell at columnIndex and rowIndex.
 boolean getVisibleFlagAt(int rowIndex)
           
 Boolean[] getVisibleFlags()
          Returns all bitmask visible flags in this model.
 void insertRowAt(BitmaskDef bitmaskDef, int rowIndex)
           
 void insertRowAt(boolean visibleFlag, BitmaskDef bitmaskDef, int rowIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
          Returns true if this table model allows to switch BMD visiblity and column index is zero.
 boolean isVisibleFlagColumnEnabled()
           
 void removeRowAt(int rowIndex)
           
 void setBitmaskDefAt(BitmaskDef bitmaskDef, int rowIndex)
           
 void setRowAt(boolean visibleFlag, BitmaskDef bitmaskDef, int rowIndex)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
          This empty implementation is provided so users don't have to implement this method if their data model is not editable.
 void setVisibleFlag(boolean visibleFlag, int rowIndex)
           
 void setVisibleFlagColumnEnabled(boolean visibleFlagColumnEnabled)
           
 
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

BitmaskDefTableModel

public BitmaskDefTableModel()

BitmaskDefTableModel

public BitmaskDefTableModel(boolean visibleFlagColumnEnabled)
Method Detail

isVisibleFlagColumnEnabled

public boolean isVisibleFlagColumnEnabled()

setVisibleFlagColumnEnabled

public void setVisibleFlagColumnEnabled(boolean visibleFlagColumnEnabled)

getBitmaskDefs

public BitmaskDef[] getBitmaskDefs()
Returns all bitmask definitions in this model.


getBitmaskDefAt

public BitmaskDef getBitmaskDefAt(int rowIndex)

getVisibleFlags

public Boolean[] getVisibleFlags()
Returns all bitmask visible flags in this model.


getVisibleFlagAt

public boolean getVisibleFlagAt(int rowIndex)

setVisibleFlag

public void setVisibleFlag(boolean visibleFlag,
                           int rowIndex)

setBitmaskDefAt

public void setBitmaskDefAt(BitmaskDef bitmaskDef,
                            int rowIndex)

setRowAt

public void setRowAt(boolean visibleFlag,
                     BitmaskDef bitmaskDef,
                     int rowIndex)

addRow

public void addRow(BitmaskDef bitmaskDef)

addRow

public void addRow(boolean visibleFlag,
                   BitmaskDef bitmaskDef)

insertRowAt

public void insertRowAt(BitmaskDef bitmaskDef,
                        int rowIndex)

insertRowAt

public void insertRowAt(boolean visibleFlag,
                        BitmaskDef bitmaskDef,
                        int rowIndex)

removeRowAt

public void removeRowAt(int rowIndex)

getRowIndex

public int getRowIndex(String bitmaskName)

getRowIndex

public int getRowIndex(BitmaskDef bitmaskDef)

clear

public void clear()

getColumnClass

public Class getColumnClass(int columnIndex)
Returns a column's data type.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
columnIndex - the column being queried
Returns:
column data type

getColumnName

public String getColumnName(int columnIndex)
Returns the name for the column.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
columnIndex - the column being queried
Returns:
a string containing the default name of column

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Returns true if this table model allows to switch BMD visiblity and column index is zero.

Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel
Parameters:
rowIndex - the row being queried
columnIndex - the column being queried
Returns:
false

getColumnCount

public int getColumnCount()
Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.

Returns:
the number of columns in the model
See Also:
getRowCount()

getRowCount

public int getRowCount()
Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Returns:
the number of rows in the model
See Also:
getColumnCount()

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Returns the value for the cell at columnIndex and rowIndex.

Parameters:
rowIndex - the row whose value is to be queried
columnIndex - the column whose value is to be queried
Returns:
the value Object at the specified cell

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
This empty implementation is provided so users don't have to implement this method if their data model is not editable.

Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel
Parameters:
aValue - value to assign to cell
rowIndex - row of cell
columnIndex - column of cell


Copyright © 2002-2011 Brockmann Consult GmbH. All Rights Reserved.