User Tools

Site Tools


devel:hierarchy_observers

Hierarchy observers

Workcraft uses the Observer pattern both mathematical and visual models create a number of observers listening to the changes in hierarchy such as adding and removing nodes in some container.

  • NodeContextTracker for each node provides the model with the information about the current pre-set and post-set. It can also quickly return all related connections to a given node.
  • DefaultMathNodeRemover counts references from the visual node to the math node. When all related visual nodes are deleted, the corresponding math node is deleted as well.
  • HierarchicalUniqueNameReferenceManager makes sure that all nodes are named. These names are necessary during the serialization and deserialization procedures.
  • RemovedNodeDeselector listens to the node removal events and removes these nodes from the visual model selection as well.
  • DefaultHangingConnectionRemover removes connections that cannot exist without the nodes being removed.