tree_applet.py
GUI visualization components for Red-Black Tree display using PyQt5.
This module provides graphical user interface components for visualizing Red-Black Trees. It includes window management and interactive tree visualization capabilities that allow users to see the structure, colors, and properties of Red-Black Trees in real-time.
Classes
- TreeWindow
Main application window that hosts the Red-Black Tree visualization. Manages window properties, size, and title for the tree display.
- TreeView
Custom graphics view widget that renders Red-Black Tree nodes and edges. Provides interactive visualization with proper node coloring and positioning.
- class tree_applet.TreeView(tree: RedBlackTree)[source]
Bases:
QGraphicsViewA class to visualize a Red-Black Tree using PyQt5. :param tree: The Red-Black Tree to visualize. :type tree: RedBlackTree
Inherits from QGraphicsView: A widget that provides a view of a QGraphicsScene.
- class tree_applet.TreeWindow[source]
Bases:
QMainWindowA class to create a window for visualizing a Red-Black Tree using PyQt5. Inherits from QMainWindow: The main window class from PyQt5.
- currentWindow: TreeWindow | None = None