pluginplayer.tree_manager

Managing tree generation

The TreeManager class handles setting the module to be viewed in a tree view, and generates the tree with its connections.

When a user wants to view a module on the tree, they can select the Graph button from the PluginSection (left).

The Module will then be placed as the root node on the tree and it will build a map for each layer of the tree, adding a new layer with the submodules of the previous layer, including their mappings. This is done with the submodule_dependencies function.

The generate_tree function will use the built map to center and place the nodes into a tree like structure.

The add_connections function will then bind the mappings of each node with a line connecting them.

Deleting the tree

All canvas instructions and widgets added to the tree section are removed, and the set inputs and property types are cleared.

Classes

TreeManager

TreeManager is a helper class for the PluginPlayer application to add/delete nodes from the module tree, run the tree, and delete the tree

Module Contents

class pluginplayer.tree_manager.TreeManager(plugin_player)

TreeManager is a helper class for the PluginPlayer application to add/delete nodes from the module tree, run the tree, and delete the tree

plugin_player
saved_output = None
tree_module = None
node_height
node_width
delete_tree()

Delete the entire tree, its edges, and nodes.

create_node(module_name)

Create a new node to add the tree section

Parameters:

module_name (String) – The name of the module the node will represent

set_module(instance)

Adds a module to the tree and saves its information to the tree

Args:

instance (kivy.uix.button): The button clicked to add the module to the tree

submodule_dependencies()

generates a 2D array of each level of the tree

generate_tree(module_tree)

Generates the visual tree map, filling with module nodes

Args:

module_tree (Array): The 2d Array filled with the module layers of the trees

add_connections(module_tree, tree_nodes)

Adds the lines to connect nodes

Args:

module_tree (Array): 2d Array mapping the modules and their submodule dependencies by layer tree_nodes (Array): 2d Array holding the module’s node widgets by layer