Dresden OCL Toolkit

tudresden.ocl.gui
Class OCLEditor.ConstraintTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bytudresden.ocl.gui.OCLEditor.ConstraintTableModel
All Implemented Interfaces:
ConstraintChangeListener, EventListener, Serializable, TableModel
Enclosing class:
OCLEditor

protected static class OCLEditor.ConstraintTableModel
extends AbstractTableModel
implements ConstraintChangeListener

Table model for the table of constraints.

Author:
sz9
See Also:
Serialized Form

Field Summary
protected  OCLEditorModel m_oclemModel
          The OCLEditorModel on which this table model is based.
protected  WeakReference m_wrocle
          The OCLEditor for which this table model is used.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
OCLEditor.ConstraintTableModel(OCLEditor ocle)
           
 
Method Summary
 void constraintAdded(ConstraintChangeEvent cce)
          Relay the event to the table indicating a row was added.
 void constraintDataChanged(ConstraintChangeEvent cce)
          Ignored.
 void constraintNameChanged(ConstraintChangeEvent cce)
          Relay the event to the table indicating the data in the cell changed.
 void constraintRemoved(ConstraintChangeEvent cce)
          Relay the event to the table indicating a row was deleted.
 Class getColumnClass(int nIdx)
          This table model has one column: "String.class".
 int getColumnCount()
          This table model has one column.
 String getColumnName(int nIdx)
          This table model has one column: "Constraint name".
 int getRowCount()
          Return the number of rows in the table.
 Object getValueAt(int row, int column)
          Get the constraint name of the specified constraint.
 boolean isCellEditable(int row, int column)
          Constraint names can be edited.
 void setOCLModel(OCLEditorModel oclemModel)
          Set the OCLEditorModel to base this table model on.
 void setValueAt(Object value, int row, int column)
          Set the edited constraint name.
 
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
 

Field Detail

m_oclemModel

protected OCLEditorModel m_oclemModel
The OCLEditorModel on which this table model is based.


m_wrocle

protected WeakReference m_wrocle
The OCLEditor for which this table model is used.

Constructor Detail

OCLEditor.ConstraintTableModel

public OCLEditor.ConstraintTableModel(OCLEditor ocle)
Method Detail

setOCLModel

public void setOCLModel(OCLEditorModel oclemModel)
Set the OCLEditorModel to base this table model on.


getRowCount

public int getRowCount()
Return the number of rows in the table. This returns the number of constraints in the underlying model.

Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
This table model has one column.

Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int nIdx)
This table model has one column: "Constraint name".

Specified by:
getColumnName in interface TableModel

getColumnClass

public Class getColumnClass(int nIdx)
This table model has one column: "String.class".

Specified by:
getColumnClass in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Get the constraint name of the specified constraint.

Specified by:
getValueAt in interface TableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Constraint names can be edited.

Specified by:
isCellEditable in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Set the edited constraint name.

Specified by:
setValueAt in interface TableModel

constraintAdded

public void constraintAdded(ConstraintChangeEvent cce)
Relay the event to the table indicating a row was added.

Specified by:
constraintAdded in interface ConstraintChangeListener

constraintRemoved

public void constraintRemoved(ConstraintChangeEvent cce)
Relay the event to the table indicating a row was deleted.

Specified by:
constraintRemoved in interface ConstraintChangeListener

constraintNameChanged

public void constraintNameChanged(ConstraintChangeEvent cce)
Relay the event to the table indicating the data in the cell changed.

Specified by:
constraintNameChanged in interface ConstraintChangeListener

constraintDataChanged

public void constraintDataChanged(ConstraintChangeEvent cce)
Ignored.

Specified by:
constraintDataChanged in interface ConstraintChangeListener

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.