CESE 1.4.7

com.simulogic.cese.properties
Class PropertyTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.simulogic.cese.properties.PropertyTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class PropertyTableModel
extends javax.swing.table.AbstractTableModel

Table model used to obtain property names and values. This model encapsulates an array of PropertyDescriptors.

See Also:
Serialized Form

Field Summary
static int COL_CLAMP
          Index of clamp column
static int COL_NAME
          Index of name column
static int COL_VALUE
          Index of value column
static int SORT_DEF
           
static int SORT_NAME
           
static int SORT_TYPE
           
static int VIEW_ALL
           
static int VIEW_BOUND
           
static int VIEW_CONSTRAINED
           
static int VIEW_EXPERT
           
static int VIEW_HIDDEN
           
static int VIEW_PREFERRED
           
static int VIEW_READ_ONLY
           
static int VIEW_STANDARD
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyTableModel()
          Default constructor
 
Method Summary
 void addChanges()
          Adds changes to model property descriptors
 void clearChanges()
          Clears changes in model property descriptors
 java.lang.String exportParametersASCII()
          Exports parameters to ASCII
 void filterTable(int view)
          Filters the table to display only properties with specific attributes.
 java.util.Vector getClampedPropertyDescriptors()
          Returns the Vector of PropertyDescriptors that are clamped
 java.lang.Class getColumnClass(int column)
          Returns the Java type for the given column.
 int getColumnCount()
          Get column count (3: name, value, clamp)
 ModelPropertyDescriptor getModelPropertyDescriptor(int row)
          Returns the ModelPropertyDescriptor for the row
 java.beans.PropertyEditor getPropertyEditor(int row)
          Returns a new instance of the property editor for a given class.
 java.lang.Class getPropertyType(int row)
          Returns the Java type info for the property at the given row
 int getRowCount()
          Get row count (total number of properties shown)
 java.lang.Object getValueAt(int row, int column)
          Get text value for cell of table
 boolean isCellEditable(int row, int col)
          Check if given cell is editable
 void setClampedPropertyDescriptors(java.util.Vector names)
          Sets clamped PropertyDescriptors based on the Vector of variable names
 void setModelInfo(ModelInfo info)
          Set the table model to represent the properties of the model.
 void setValueAt(java.lang.Object value, int row, int column)
          Set the value of the Values column.
 void sortTable(int sort)
          Sorts the table according to the sort type.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_NAME

public static final int COL_NAME
Index of name column

See Also:
Constant Field Values

COL_VALUE

public static final int COL_VALUE
Index of value column

See Also:
Constant Field Values

COL_CLAMP

public static final int COL_CLAMP
Index of clamp column

See Also:
Constant Field Values

VIEW_ALL

public static final int VIEW_ALL
See Also:
Constant Field Values

VIEW_STANDARD

public static final int VIEW_STANDARD
See Also:
Constant Field Values

VIEW_EXPERT

public static final int VIEW_EXPERT
See Also:
Constant Field Values

VIEW_READ_ONLY

public static final int VIEW_READ_ONLY
See Also:
Constant Field Values

VIEW_BOUND

public static final int VIEW_BOUND
See Also:
Constant Field Values

VIEW_CONSTRAINED

public static final int VIEW_CONSTRAINED
See Also:
Constant Field Values

VIEW_HIDDEN

public static final int VIEW_HIDDEN
See Also:
Constant Field Values

VIEW_PREFERRED

public static final int VIEW_PREFERRED
See Also:
Constant Field Values

SORT_DEF

public static final int SORT_DEF
See Also:
Constant Field Values

SORT_NAME

public static final int SORT_NAME
See Also:
Constant Field Values

SORT_TYPE

public static final int SORT_TYPE
See Also:
Constant Field Values
Constructor Detail

PropertyTableModel

public PropertyTableModel()
Default constructor

Method Detail

setModelInfo

public void setModelInfo(ModelInfo info)
Set the table model to represent the properties of the model.

Parameters:
info - model info

getRowCount

public int getRowCount()
Get row count (total number of properties shown)


getColumnCount

public int getColumnCount()
Get column count (3: name, value, clamp)


isCellEditable

public boolean isCellEditable(int row,
                              int col)
Check if given cell is editable

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - table row
col - table column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Get text value for cell of table

Parameters:
row - table row
column - table column

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Set the value of the Values column.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getColumnClass

public java.lang.Class getColumnClass(int column)
Returns the Java type for the given column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getPropertyType

public java.lang.Class getPropertyType(int row)
Returns the Java type info for the property at the given row

Parameters:
row - table row
Returns:
property type class

getModelPropertyDescriptor

public ModelPropertyDescriptor getModelPropertyDescriptor(int row)
Returns the ModelPropertyDescriptor for the row

Parameters:
row - table row
Returns:
model property descriptor

getClampedPropertyDescriptors

public java.util.Vector getClampedPropertyDescriptors()
Returns the Vector of PropertyDescriptors that are clamped

Returns:
clamped propety descriptors

clearChanges

public void clearChanges()
Clears changes in model property descriptors


addChanges

public void addChanges()
Adds changes to model property descriptors


setClampedPropertyDescriptors

public void setClampedPropertyDescriptors(java.util.Vector names)
Sets clamped PropertyDescriptors based on the Vector of variable names

Parameters:
names - variable names

getPropertyEditor

public java.beans.PropertyEditor getPropertyEditor(int row)
Returns a new instance of the property editor for a given class. If an editor is not specified in the property descriptor then it is looked up in the PropertyEditorManager.

Parameters:
row - table row
Returns:
property editor

sortTable

public void sortTable(int sort)
Sorts the table according to the sort type.

Parameters:
sort - sort type

filterTable

public void filterTable(int view)
Filters the table to display only properties with specific attributes.

Parameters:
view - The properties to display.

exportParametersASCII

public java.lang.String exportParametersASCII()
Exports parameters to ASCII

Returns:
String containing formatted ASCII codes for all the parameters

CESE 1.4.7

Copyright (c) 1999 - 2007 Cell Electrophysiology Simulation Environment (CESE). All rights reserved.