polychron.presenters.ManageGroupRelationshipsPresenter
Module
ManageGroupRelationshipsPresenter
Bases: PopupPresenter[ManageGroupRelationshipsView, Model]
Presenter for managing Residual vs Intrusive contexts
prev_dict
instance-attribute
prev_dict = {}
A dictionary containing the group relationship type between a group and the previous group
post_dict
instance-attribute
post_dict = {}
A dictionary containing the group relationship type between a group and the next group
group_relationship_dict
instance-attribute
group_relationship_dict = deepcopy(group_relationships_dict())
A dictionary of the group relationship type, indexed by (group, prev_group)
removed_nodes_tracker
instance-attribute
removed_nodes_tracker = []
A list of nodes which have been removed from the copy of the stratigraphic dag due to an absence of node or phase information
__group_relationship_dag
instance-attribute
__group_relationship_dag = DiGraph([rel for rel in (keys())])
A graph of relationships in the graph
dag
instance-attribute
dag = node_del_fixed(dag, j)
The DAG being modified throughout the group management process. Initially a copy of the stratigraphic_dag, which is mutated to become the chronological_dag
context_no_unordered
instance-attribute
context_no_unordered = [x for x in (list(nodes())) if x not in removed_nodes_tracker]
An unordered list of contexts in the modified stratigraphic dag copy
context_types
instance-attribute
context_types = ['normal' for _ in (context_no_unordered)]
The type of each context in the modified dag. normal, residual or intrusive
__group_box_drag_x
instance-attribute
__group_box_drag_x: float | None = None
x coordinate for the start of the current dragging event, in canvas coordinate space?
__group_box_drag_y
instance-attribute
__group_box_drag_y: float | None = None
y coordinate for the start of the current dragging event, in canvas coordinate space?
__group_box_widget
instance-attribute
__group_box_widget: Any | None = None
The tkinter label being dragged. Todo: This is a tkinter leak into the presenter, but that's required if the presenter is handling mouse events...
__init__
__init__(mediator: Mediator, view: ManageGroupRelationshipsView, model: Model) -> None
Construct a presenter for managing group relationships.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mediator
|
Mediator
|
The mediator for switching windows etc |
required |
view
|
ManageGroupRelationshipsView
|
the ManageGroupRelationshipsView |
required |
model
|
Model
|
The |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the Model contains an invalid set of defined group relationships. Groups must have 1 incoming relationship, 1 outgoing relationship or 1 relationship in each direction and must not form cycles |
compute_box_placement
compute_box_placement() -> dict[str, tuple[float, float, float, float]]
Compute the (initial) location of group boxes for the current model
Returns:
Type | Description |
---|---|
dict[str, tuple[float, float, float, float]]
|
A tuple dictionary of tuples (x, y, w, h), keyed by the label. |
on_back
on_back() -> None
Callback for when the back button is pressed (when it exists), which updates the view to show the first phase
Formerly popupWindow3.back_func
get_coords
get_coords() -> None
Triggered when confirming the provided layout of phase relationships.
Builds prev_dict, post_dict and group_relationship_dict based on the relative positions of the phase boxes before updating the view to the 2nd stage.
Formerly popupWindow3.get_coords
full_chronograph_func
full_chronograph_func() -> None
renders the chronological graph and forms the prev_phase and past_phase vectors
Formerly popupWindow3.full_chronograph_func