Java Reference
In-Depth Information
7.
}
8.
return (String[])
9.
lMiningObjects.toArray(new String[lMiningObjects.size()]);
10.}
This object name array is provided to the MiningObjectsTableModel
or the TaskTableModel . As presented earlier these TableModels must
provide to the graphical layer the values to display in the cell at a
given row and column through the call to getValueAt . The construc-
tors of these TableModel s store the connection as well as the named
object class to ask for information when required. Below is the code
of the MiningObjectsTableModel constructor method. The TableModel
has three member variables: the connection in mModelConnection, the
list of the object names of the named object class in mMiningObjects,
and the value of this named object class in mModelNamedObject .
1.
MiningObjectsTableModel(
2.
Connection iConnection,
3.
String[] iMiningObjects,
4.
NamedObject iModelNamedObject) {
5.
mMiningObjects iMiningObjects;
6.
mModelConnection iConnection;
7.
mModelNamedObject iModelNamedObject;
8.
}
We provide here the code for the method getValueAt associated
with the MiningObjectsTableModel because this code calls JDM func-
tions. Mining objects other than tasks are represented in a table with
three columns showing their name, description, and creation date.
Column index 0 returns the name; column index 1 returns the associ-
ated description; and column index 2 returns the creation date.
1.
public Object getValueAt(int iRowIndex, int iColumnIndex) {
2.
String lMiningObject mMiningObjects[iRowIndex];
3.
try {
4.
switch (iColumnIndex) {
5.
case 0: return lMiningObject;
6.
case 1:
7.
String lDescription "No Description";
8.
try {
9.
lDescription mModelConnection.getDescription(
10.
lMiningObject, mModelNamedObject);
11.
} catch (JDMUnsupportedFeatureException lException) {
 
Search WWH ::




Custom Search