Skip to content

polychron.views.ModelView Module

ModelView

Bases: FrameView

Main view for displaying information about the model. I.e. the "Stratigraphy and supplementary data" tab

Formely part of StartPage

__testmenu_callback instance-attribute

__testmenu_callback: Callable[[], Any] = lambda event: None

reference to the callback method for the test menu, as it does not appear that an OptionMenu(command) can be changed after construction.

__init__

__init__(parent: Frame) -> None

Construct the view, without binding any callbacks

get_testmenu_selection

get_testmenu_selection() -> str

Return the most recent value for the testmenu

set_testmenu_selection

set_testmenu_selection(value: str) -> None

Set the value for the testmenu

bind_testmenu_commands

bind_testmenu_commands(callback: Callable[[], Any]) -> None

Bind the callback for the stratigraphic graph right-click menu

ttk.OptionMenu doesn not accept commadns to .config, only on the constructor? So in this case the view contains a reference to the callback

bind_sasd_tab_button

bind_sasd_tab_button(callback: Callable[[], Any]) -> None

Bind the callback for when the sasd_tab_button is pressed

bind_dr_tab_button

bind_dr_tab_button(callback: Callable[[], Any]) -> None

Bind the callback for when the dr_tab_button is pressed

bind_data_button

bind_data_button(callback: Callable[[], Any]) -> None

Bind the callback for when the data_button is pressed

bind_littlecanvas_callback

bind_littlecanvas_callback(sequence: str, callback: Callable[[], Any]) -> None

Bind a single callback to the specified sequence on the littlecanvas. This is an alternative to an all in one bind method, as the canvas repeatedly gets cleared

unbind_littlecanvas_callback

unbind_littlecanvas_callback(sequence: str) -> None

Unbind a single callback to the specified sequence on the littlecanvas. This is an alternative to an all in one bind method, as the canvas repeatedly gets cleared

bind_littlecanvas2_callback

bind_littlecanvas2_callback(sequence: str, callback: Callable[[], Any]) -> None

Bind a single callback to the specified sequence on the littlecanvas2. This is an alternative to an all in one bind method, as the canvas repeatedly gets cleared

unbind_littlecanvas2_callback

unbind_littlecanvas2_callback(sequence: str) -> None

Unbind a single callback to the specified sequence on the littlecanvas2. This is an alternative to an all in one bind method, as the canvas repeatedly gets cleared

show_testmenu

show_testmenu(has_image: bool) -> Tuple[int | None, int | None]

Show the test menu within the little canvas at the cursors' coordinates

Formerly part of StartPage.onRight

Parameters:

Name Type Description Default
has_image bool

If the little canvas has been rendered with an image or not.

required

bind_littlecanvas_events

bind_littlecanvas_events(callback_wheel: Callable[[], Any], callback_move_from: Callable[[], Any], callback_move_to: Callable[[], Any]) -> None

Bind mouse callback events for interacting with the graph canvas

bind_littlecanvas2_events

bind_littlecanvas2_events(callback_wheel: Callable[[], Any], callback_move_from: Callable[[], Any], callback_move_to: Callable[[], Any]) -> None

Bind mouse callback events for interacting with the graph canvas

build_file_menu

build_file_menu(items: List[Tuple[str, Callable[[], Any]] | None]) -> None

Builds the 'file' menu element with labels and callback functions.

Parameters:

Name Type Description Default
items List[Tuple[str, Callable[[], Any]] | None]

A List of menu entries to add, which may be None to identify a separator, or a tuple containing a label anf callback fucntion.

required

build_view_menu

build_view_menu(items: List[Tuple[str, Callable[[], Any]] | None]) -> None

Builds the 'view' menu element with labels and callback functions.

The view menu uses checkboxes rather than just commands to show if the setting is enabled or not

Parameters:

Name Type Description Default
items List[Tuple[str, Callable[[], Any]] | None]

A List of menu entries to add, which may be None to identify a separator, or a tuple containing a label anf callback fucntion.

required
Todo

Use a common method in a MainFrameView class to handle this for all main frame menu's, taking the menubar as a parameter to reduce code duplication. items will have to be extended to take the type as well.

build_tool_menu

build_tool_menu(items: List[Tuple[str, Callable[[], Any]] | None]) -> None

Builds the 'tools' menu element with labels and callback functions.

Parameters:

Name Type Description Default
items List[Tuple[str, Callable[[], Any]] | None]

A List of menu entries to add, which may be None to identify a separator, or a tuple containing a label anf callback fucntion.

required

lift_datacanvas

lift_datacanvas() -> None

Lift the datacanvas element to the top of the littlecanvas

lift_littelcanvas

lift_littelcanvas() -> None

Lift the littlecanvas element to the top of the datacanvas

update_datacanvas_checklist

update_datacanvas_checklist(strat_check: bool, date_check: bool, phase_check: bool, phase_rel_check: bool) -> None

Update the contents of the datacanvas checklist based on provided model state

Formerly part of StartPage.check_list_gen

update_littlecanvas

update_littlecanvas(image) -> None

Update the image within the littlecanvas element

show_image

show_image() -> None

Show image on the Canvas

clear_littlecanvas2

clear_littlecanvas2() -> None

Delete all elments from within the littlecavnas2

update_littlecanvas2

update_littlecanvas2(image: Image) -> None

Update the image within the littlecanvas2 element - i.e. the chronological graph.

show_image2

show_image2() -> None

Show image on the 2nd Canvas

update_littlecanvas_image_only

update_littlecanvas_image_only(image: Image, event: Any) -> None

Update the image within the littlecanvas, during resizing.

update_littlecanvas2_image_only

update_littlecanvas2_image_only(image: Image, event: Any) -> None

Update the image within the littlecanvas2, during resizing.

wheel

wheel(event: Any) -> None

Zoom with mouse wheel for the stratigraphic image canvas

Formerly (part of) StartPage.wheel

wheel2

wheel2(event: Any) -> None

Zoom with mouse wheel for the stratigraphic image canvas

Formerly (part of) StartPage.wheel

set_deleted_nodes

set_deleted_nodes(delted_nodes: List[Tuple[str, str]]) -> None

Set the contentx of teh deleted nodes table

append_deleted_node

append_deleted_node(node: str, meta: str) -> None

Append the node and meta data to the deleted nodes treeview

set_deleted_edges

set_deleted_edges(deleted_edges: List[Tuple[str, str]]) -> None

Set the contentx of the deleted edges table, provided a list of edge labels and values

append_deleted_edge

append_deleted_edge(edge_label: str, meta: str) -> None

Append the edge and meta data to the deleted edges treeview

Includes part of StartPage.edgeRender

append_testmenu_entry

append_testmenu_entry(text: str) -> None

Append an entry to the end of the right click testmenu.

remove_testmenu_entry

remove_testmenu_entry(text: str) -> None

Remove an entry to the end of the right click testmenu.

update_supplementary_data_table

update_supplementary_data_table(node: str, meta_df: DataFrame) -> None

Update the contents of the supplementary data table (tree 1)