The previous recipe enabled us to show one level of a data tree; this recipe is going to allow us to navigate from one level to another, thus enabling us to explore the entire tree.
Open the files downloaded from the Packt Publishing website for Chapter 8 | Recipe 4 to follow along.
The following are the required steps to allow the user to navigate through the relational network:
Create the
PlusButton
class to allow the user to navigate down the tree.Create the
MinusButton
class to allow the user to navigate up the tree.Add
RelationalNetworkEvent
to indicate to the relational network that the user wants to navigate.In
NodeVisual
, add thePlusButton
class if the node is a child.In
NodeVisual
, add theMinusButton
class if the node is the center node.In
RelationalNetwork.as
, add a listener to the center node for theRelationalNetworkEvent.NAVIGATE_TO_PARENT
event.Still in
RelationalNetwork.as
, add a listener to each child for...