JSampler
v0.8a

org.jsampler.view
Class ParameterTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.jsampler.view.ParameterTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ParameterTableModel
extends javax.swing.table.AbstractTableModel

A tabular data model for representing LSCP parameters.

See Also:
ParameterTable, Serialized Form

Field Summary
static int PARAMETER_NAME_COLUMN
           
static int PARAMETER_VALUE_COLUMN
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ParameterTableModel(Parameter[] parameters)
          Creates a new instance of ParameterTableModel.
ParameterTableModel(Parameter[] parameters, boolean editFixedParameters)
          Creates a new instance of ParameterTableModel.
 
Method Summary
 void addParameterListener(ParameterListener l)
          Registers the specified listener for receiving event messages.
 boolean canEditFixedParameters()
          Determines whether fixed parameters are editable.
 javax.swing.table.TableCellEditor getCellEditor(int row, int column)
          Returns an appropriate editor for the cell specified by row and column.
 javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)
          Returns an appropriate renderer for the cell specified by row and column.
 int getColumnCount()
          Gets the number of columns in the model.
 java.lang.String getColumnName(int col)
          Gets the name of the column at columnIndex.
 Parameter getParameter(int row)
          Gets the parameter at the specified row.
 Parameter[] getParameters()
          Gets the parameters that are shown in the table.
 int getRowCount()
          Gets the number of rows in the model.
 java.lang.Object getValueAt(int row, int col)
          Gets the value for the cell at columnIndex and rowIndex.
 boolean isCellEditable(int row, int col)
          Returns true if the cell at row and col is editable.
 void removeParameterListener(ParameterListener l)
          Removes the specified listener.
 void setEditFixedParameters(boolean b)
          Sets whether fixed parameters are editable.
 void setParameters(Parameter[] parameters)
          Sets the parameters to be shown in the table.
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the value in the cell at col and row to value.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_NAME_COLUMN

public static final int PARAMETER_NAME_COLUMN
See Also:
Constant Field Values

PARAMETER_VALUE_COLUMN

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

ParameterTableModel

public ParameterTableModel(Parameter[] parameters)
Creates a new instance of ParameterTableModel.

Parameters:
parameters - The parameters to be provided by this model.

ParameterTableModel

public ParameterTableModel(Parameter[] parameters,
                           boolean editFixedParameters)
Creates a new instance of ParameterTableModel.

Parameters:
parameters - The parameters to be provided by this model.
editFixedParameters - Determines whether fixed parameters are editable. Specify true to enable the editing of fixed parameters.
Method Detail

addParameterListener

public void addParameterListener(ParameterListener l)
Registers the specified listener for receiving event messages.

Parameters:
l - The ParameterListener to register.

removeParameterListener

public void removeParameterListener(ParameterListener l)
Removes the specified listener.

Parameters:
l - The ParameterListener to remove.

setEditFixedParameters

public void setEditFixedParameters(boolean b)
Sets whether fixed parameters are editable.

Parameters:
b - Specify true to enable the editing of fixed parameters.
See Also:
org.linuxsampler.lscp.Parameter#isFixed

canEditFixedParameters

public boolean canEditFixedParameters()
Determines whether fixed parameters are editable.

Returns:
true if the fixed parameters are editable, false otherwise.
See Also:
org.linuxsampler.lscp.Parameter#isFixed

getParameter

public Parameter getParameter(int row)
Gets the parameter at the specified row.

Parameters:
row - The row number of the parameter to be provided.
Returns:
The parameter at the specified row.

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                           int column)
Returns an appropriate renderer for the cell specified by row and column.

Parameters:
row - The row of the cell to render, where 0 is the first row.
column - The column of the cell to render, where 0 is the first column.

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int column)
Returns an appropriate editor for the cell specified by row and column.

Parameters:
row - The row of the cell to edit, where 0 is the first row.
column - The column of the cell to edit, where 0 is the first column.

getParameters

public Parameter[] getParameters()
Gets the parameters that are shown in the table.


setParameters

public void setParameters(Parameter[] parameters)
Sets the parameters to be shown in the table.

Parameters:
parameters - The parameters to be shown in the table.

getColumnCount

public int getColumnCount()
Gets the number of columns in the model.

Returns:
The number of columns in the model.

getRowCount

public int getRowCount()
Gets the number of rows in the model.

Returns:
The number of rows in the model.

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of the column at columnIndex.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Returns:
The name of the column at columnIndex.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets the value for the cell at columnIndex and rowIndex.

Parameters:
row - The row whose value is to be queried.
col - The column whose value is to be queried.
Returns:
The value for the cell at columnIndex and rowIndex.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the value in the cell at col and row to value.

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

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Returns true if the cell at row and col is editable.

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

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.