Package com.dassault_systemes.catjdialog

   
Interface CATKeyTreeModel

 
Class Hierarchy
com.dassault_systemes.catjdialog.CATKeyTreeModel
Class Location

Framework : CATJDialog

Module : CATJDialog

Class Description

public interface CATKeyTreeModel

The key tree model is an interface used to feed a tree component with content.

Data Model: a JDialog pattern

When using a tree or a table component, the application has to provide a data model object, that is in charge of feeding the component with presentation data.

This design allows JDialog to request presentation data only when rendering the tree or table component to the Graphical User Interface (GUI), and to forget it right after that.

The Key: a common language between JDialog and the application

The key tree model identifies tree nodes with a key (that is a string identifier).
At render time, the model is asked for presentation data and keys.
When an event occurs on the GUI, the source tree node(s) is (are) identified with its (their) key(s).

Example: a Tree with a CATKeyTreeModel and a controller listening to node selection notifications

How to choose the key?

Basically, the key should contain enough information for the application to identify clearly the related data.

CATTree methods related to the key tree model

See the CAA technical article "Writing Stateless Controllers" for a stateless design sample.

See Also:
com.dassault_systemes.catjdialog.CATTree
Field Summary

Constructor Summary

Method Summary
String getRootKey()
CATTreeNodeInfo getNodeInfo(String iKey, boolean iGetChildren)


Field Detail

Constructor Detail

Method Detail

getRootKey

    String getRootKey()

Returns the tree root node key.

Returns:
The root node key.

getNodeInfo

    CATTreeNodeInfo getNodeInfo(String iKey, boolean iGetChildren)

Returns node info (label, icon ...)

Parameters:
iKey
A node key.
iGetChildren
If true, the model is expected to return children keys (this is only required for expandable and expanded nodes).
Returns:
CATTreeNodeInfo An object that contains node information (type, label, icon, children, ...).


Copyright © 2000, Dassault Systèmes. All rights reserved