Java Reference
In-Depth Information
13.2.5
Delete a Saved Object from the MOR
When the user clicks on the Delete button, the intention is to remove
the persisted object from the repository, and execute the handler-
DestroyButton method from the JDMAdminConsole class. To show the
result of this deletion, we must refresh the table showing the list of
objects, which is contained in the TableModel object. This object can be
obtained through the member variable mDisplayObjectsTable that is
initialized when the graphical display is initialized. We have defined
a method called fireTableDataChanged to refresh the values contained
in the TableModel . The handler of the button is presented here:
1. private void handlerDeleteButton() {
2.
NamedObject lNamedObject getSelectedNamedObjectType();
String lObjectToRemove getSelectedObjectName();
3.
if (lNamedObject ! null && lObjectToRemove ! null) {
4.
5.
try {
6.
mDmeConn.removeObject (lObjectToRemove, lNamedObject);
7.
((MiningObjectsTableModel) mDisplayObjectsTable.getModel()).
8.
fireTableDataChanged();
9.
} catch (ObjectNotFoundException lExce) {
10.
JOptionPane.showMessageDialog(this,
"Object: " lNamedObject
11.
12.
" does not exist");
13.
} catch (JDMException lExce) {
14.
displayJDMException(lExce);
15.
}
16.
}
17. }
The call to removeObject in line 6 asks the DME to perform the opera-
tion on the MOR. This concludes the description of the first user
interface.
13.3
User Interface to Build and Save a Model
The second graphical user interface demonstrates using JDM in
practice to build models. Mining models created through this inter-
face could then be used through Web services for real-time apply as
demonstrated in Chapter 14, or other Java applications for batch or
real-time apply. In this example, we focus on the mining function
level, without addressing algorithm level interfaces. We start the
code example from the exchange with the DME to determine the
mining function it supports. We assume connections have already
been addressed, as noted in Section 13.1.
Search WWH ::




Custom Search