| 14 | |
| 15 | == The Model |
| 16 | The toolbox has a hierarchy of Models. This section describes the various standard models. |
| 17 | |
| 18 | === Model and Submodels |
| 19 | At the root is the Model interface. A model basically is an object, which implicitly contains some values that can be adjusted. The interface only specifies that the object broadcasts Event objects whenever something changes in the model. |
| 20 | A Model can contain recursively contain sub-models. For instance a Person model may contain a StringModel containing the name, and a NumberModel containing the age. |
| 21 | |
| 22 | === Event object |
| 23 | All Event objects are objects containing details of a change that happened in a model. It contains a reference to the source Model of the event, and possibly a child event if the change happened on some sub-model. |
| 24 | There are four types of changes to a model: |
| 25 | * Changed: a sub-model of the model changed |
| 26 | * Added: a model (eg a list) just got extended by addition of a new submodel |
| 27 | * Removed: a model (eg a list) just got shrinked by removal of a submodel |
| 28 | * Selected: a model (eg in a list) just got selected |
| 29 | |