Tuesday, November 3, 2015

GEF4 Tutorial - Part 3 - Model tree and update

In step 3 of this tutorial, the model, the parts and the visuals are compositions of multiple objects. Each model node type is mapped with the ModelPartFactory to a corresponding content part (ModelPart and TextNodePart).

For the source of this tutorial step see github - gef4.mvc.tutorial3.



The model nodes implement PropertyChangeNotifier. When the model is changed, it can notify listeners. The TextNodeParts register themself as listener, when they are activated.

This example has a button on the top, that applies changes to the model. So the text and the position of the boxes is varied.








No comments:

Post a Comment