navigate.controller.sub_controllers.features_popup.FeatureListGraphController
- class navigate.controller.sub_controllers.features_popup.FeatureListGraphController(feature_list_view, feature_content_view, preview_btn, palette_items=None, board_canvas=None, board_window=None, marker=None, child_popups=None)
Bases:
object- __init__(feature_list_view, feature_content_view, preview_btn, palette_items=None, board_canvas=None, board_window=None, marker=None, child_popups=None)
Initialize feature list window
- Parameters:
feature_list_view (frame) – feature list graph view
feature_content_view (text) – feature list content
preview_btn (button) – preview button
child_popups (list) – list of child config popup windows
Methods
__init__(feature_list_view, ...[, ...])Initialize feature list window
board_point(event)Return the mouse position in the horizontally scrolling board.
branch_palette_drag_motion(event)Show an insertion marker on the branch board below the pointer.
Build the feature list text
Calculate the height of the arrow image
Clear the selected feature nodes.
drag_motion(event)draw_feature_list_graph([new_list_flag])Draw the feature list graph
finish_branch_palette_drag(event, name, on_click)Insert a palette feature into the branch receiving the drop.
finish_drag(event)flatten_feature_list(feature_list)Flatten the feature list
Get feature list content
get_group_bounds(feature_index)Return the innermost parenthesis pair enclosing a feature index.
handle_chip_press(event, chip)index_at(x, y)insert_feature(index, feature_name)Insert a palette feature at its displayed position.
is_valid_grouping(start_index, end_index)Return whether a new group can be inserted without overlap.
layout_chips()move_branch_drag_window(root_x, root_y)Move the configuration-palette drag preview.
move_drag_window(root_x, root_y)move_feature(old_index, new_index)Move a feature and its structure entry to the drop position.
Render selected feature nodes using the ttk pressed state.
show_config_popup(idx)Show the feature configuration popup
show_marker(index)show_menu(idx[, flag])Show the popup menu
start_branch_palette_drag(event, name, ...)Start dragging a configuration-palette item to a branch board.
start_drag(event, name[, chip])start_palette_drag(event, name)toggle_selection(chip)Toggle a feature node in the current Shift-click selection.
update(feature_list_content)Update feature list window
Update feature content
Attributes
CHIP_GAPThe list of feature names.
- board_point(event)
Return the mouse position in the horizontally scrolling board.
- branch_palette_drag_motion(event)
Show an insertion marker on the branch board below the pointer.
- build_feature_list_text()
Build the feature list text
- Returns:
content – The feature list text
- Return type:
str
- calculate_arrow_image_height()
Calculate the height of the arrow image
- Returns:
image_height – The height of the arrow image
- Return type:
int
- clear_selection()
Clear the selected feature nodes.
- draw_feature_list_graph(new_list_flag=True)
Draw the feature list graph
- Parameters:
new_list_flag (bool, optional) – Whether the feature list is new, by default True
- finish_branch_palette_drag(event, name, on_click)
Insert a palette feature into the branch receiving the drop.
- flatten_feature_list(feature_list)
Flatten the feature list
- Parameters:
feature_list (list) – The feature list
- get_feature_content()
Get feature list content
- Returns:
content – feature list content
- Return type:
str
- get_group_bounds(feature_index)
Return the innermost parenthesis pair enclosing a feature index.
- insert_feature(index, feature_name)
Insert a palette feature at its displayed position.
- Parameters:
index (int) – The index of the feature.
feature_name (str) – The name of the feature to insert.
- is_valid_grouping(start_index, end_index)
Return whether a new group can be inserted without overlap.
- move_branch_drag_window(root_x, root_y)
Move the configuration-palette drag preview.
- move_feature(old_index, new_index)
Move a feature and its structure entry to the drop position.
- refresh_chip_styles()
Render selected feature nodes using the ttk pressed state.
- show_config_popup(idx)
Show the feature configuration popup
- Parameters:
idx (int) – The index of the feature
- Returns:
func – The function to show the feature configuration popup
- Return type:
function
- show_menu(idx, flag=True)
Show the popup menu
- Parameters:
idx (int) – The index of the feature
flag (bool, optional) – Whether the feature is a decision node, by default True
- Returns:
func – The function to show the popup menu
- Return type:
function
- start_branch_palette_drag(event, name, branch_controllers)
Start dragging a configuration-palette item to a branch board.
- toggle_selection(chip)
Toggle a feature node in the current Shift-click selection.
- update(feature_list_content)
Update feature list window
- Parameters:
feature_list_content (list) – The feature list
- update_feature_content()
Update feature content
- feature_names
The list of feature names.
- Type:
list