ALMA Computing Group

alma::demo::dyncomp::MyTableModel Class Reference

This is a concrete class definition to represent the data in the table of the activated dynamic components. More...

List of all members.

Public Member Functions

 MyTableModel ()
 The construtor.
Object getValueAt (int row, int column)
 Return the value of the cell.
int getRowCount ()
 Return the number of rows of the table.
int getColumnCount ()
 Return the number of columns of the table.
void append (String name, String cUrl)
 Append a new activated component with the given name.
Class getColumnClass (int c)
 Return the class of the elements stored in a column.
boolean exist (String name)
 Check if an element with the given name already exists in the table.
void deleteEntry (String url)
 Delete the component with the given name.
void sort ()
 Sort the items of the table.
void setValueAt (Object obj, int row, int col)
 Add a component to the table.
String getColumnName (int col)
 Return the name of the column.
boolean isCellEditable (int row, int col)
 Check if a cell is editable.
String getURL (String name)
 Return the URL of a component given its name.

Package Attributes

final String colNames []
 The name of the columns.
Object tableData [][]
 The data of each cell.

Private Attributes

final int ROWNUM = 32
 The number of row and columns in the table.
final int COLNUM = 3


Detailed Description

This is a concrete class definition to represent the data in the table of the activated dynamic components.

Author:
Alessandro Caproni, 2003, Nov

Definition at line 19 of file MyTableModel.java.


Constructor & Destructor Documentation

alma::demo::dyncomp::MyTableModel::MyTableModel  )  [inline]
 

The construtor.

Definition at line 44 of file MyTableModel.java.

References COLNUM, ROWNUM, and tableData.


Member Function Documentation

void alma::demo::dyncomp::MyTableModel::append String  name,
String  cUrl
[inline]
 

Append a new activated component with the given name.

In this very very very first version the component are added at the end without any care

Parameters:
name The name of the newly activated component
cUrl The CORBA url of the activated component
Definition at line 86 of file MyTableModel.java.

References ROWNUM, setValueAt(), and tableData.

Referenced by alma::demo::dyncomp::JDynAct::startDynamicComponent().

void alma::demo::dyncomp::MyTableModel::deleteEntry String  url  )  [inline]
 

Delete the component with the given name.

url The name of the componentDefinition at line 137 of file MyTableModel.java.

References ROWNUM, setValueAt(), and tableData.

Referenced by alma::demo::dyncomp::JDynAct::releaseComponent().

boolean alma::demo::dyncomp::MyTableModel::exist String  name  )  [inline]
 

Check if an element with the given name already exists in the table.

Parameters:
name the name of the item to search
Returns:
true if the item is found
Definition at line 125 of file MyTableModel.java.

References ROWNUM, and tableData.

Referenced by alma::demo::dyncomp::JDynAct::startDynamicComponent().

Class alma::demo::dyncomp::MyTableModel::getColumnClass int  c  )  [inline]
 

Return the class of the elements stored in a column.

Parameters:
c The number of the column
Returns:
The Class of the objects stored in the cells of the column
Definition at line 108 of file MyTableModel.java.

int alma::demo::dyncomp::MyTableModel::getColumnCount  )  [inline]
 

Return the number of columns of the table.

Returns:
The number of columns of the table
Definition at line 74 of file MyTableModel.java.

References COLNUM.

String alma::demo::dyncomp::MyTableModel::getColumnName int  col  )  [inline]
 

Return the name of the column.

Parameters:
col The number of the column
Definition at line 192 of file MyTableModel.java.

References colNames.

int alma::demo::dyncomp::MyTableModel::getRowCount  )  [inline]
 

Return the number of rows of the table.

Returns:
The number of rows of the table
Definition at line 66 of file MyTableModel.java.

References ROWNUM.

String alma::demo::dyncomp::MyTableModel::getURL String  name  )  [inline]
 

Return the URL of a component given its name.

Parameters:
name The name of the component
Returns:
The cURL of the component or null if a component with the specified name doe not exist
Definition at line 213 of file MyTableModel.java.

References ROWNUM, and tableData.

Referenced by alma::demo::dyncomp::JDynAct::actionPerformed().

Object alma::demo::dyncomp::MyTableModel::getValueAt int  row,
int  column
[inline]
 

Return the value of the cell.

Parameters:
row The row of the cell
colum The column of the cell
Returns:
The value of the cell
Definition at line 58 of file MyTableModel.java.

References tableData.

boolean alma::demo::dyncomp::MyTableModel::isCellEditable int  row,
int  col
[inline]
 

Check if a cell is editable.

In this case all the cells are not editable

Returns:
true if the cell is editable
Definition at line 201 of file MyTableModel.java.

References tableData.

void alma::demo::dyncomp::MyTableModel::setValueAt Object  obj,
int  row,
int  col
[inline]
 

Add a component to the table.

Parameters:
name The name of the component
row The row is ignored because each new element is appended at the end
col The col parameter is ignored because the name always is inserted in the first column
Definition at line 183 of file MyTableModel.java.

References tableData.

Referenced by append(), deleteEntry(), and sort().

void alma::demo::dyncomp::MyTableModel::sort  )  [inline]
 

Sort the items of the table.

Definition at line 152 of file MyTableModel.java.

References ROWNUM, setValueAt(), and tableData.


Member Data Documentation

final String alma::demo::dyncomp::MyTableModel::colNames[] [package]
 

Initial value:

{ "Dynamic component", "cUrl", "" }
The name of the columns.

Definition at line 28 of file MyTableModel.java.

Referenced by getColumnName().

final int alma::demo::dyncomp::MyTableModel::COLNUM = 3 [private]
 

Definition at line 23 of file MyTableModel.java.

Referenced by getColumnCount(), and MyTableModel().

final int alma::demo::dyncomp::MyTableModel::ROWNUM = 32 [private]
 

The number of row and columns in the table.

Definition at line 22 of file MyTableModel.java.

Referenced by append(), deleteEntry(), exist(), getRowCount(), getURL(), MyTableModel(), and sort().

Object alma::demo::dyncomp::MyTableModel::tableData[][] [package]
 

The data of each cell.

The third column always contains the Release buttonDefinition at line 38 of file MyTableModel.java.

Referenced by append(), deleteEntry(), exist(), getURL(), getValueAt(), isCellEditable(), MyTableModel(), setValueAt(), and sort().


The documentation for this class was generated from the following file: