MVC Controllers: rafcon.gui.controllers
¶
All controllers of the MVC architecture.
The controllers are the interface between the models (holding the data) and the view (showing the data). They are responsible for the logic.
All controllers of RAFCON inherit from rafcon.gui.controllers.extended_controller.ExtendedController
, which
inherits from the controller class of GTKMVC.
Subpackages of rafcon.gui.controllers
¶
- MVC State Editor Controllers (rafcon.gui.controllers.state_editor)
- LinkageOverviewController (in linkage_overview)
- ScopedVariableListController (in scoped_variable_list)
ScopedVariableListController
ScopedVariableListController.CORE_ELEMENT_CLASS
ScopedVariableListController.DATA_TYPE_NAME_STORAGE_ID
ScopedVariableListController.DEFAULT_VALUE_STORAGE_ID
ScopedVariableListController.ID_STORAGE_ID
ScopedVariableListController.MODEL_STORAGE_ID
ScopedVariableListController.NAME_STORAGE_ID
ScopedVariableListController.apply_new_scoped_variable_default_value()
ScopedVariableListController.apply_new_scoped_variable_name()
ScopedVariableListController.apply_new_scoped_variable_type()
ScopedVariableListController.get_new_list_store()
ScopedVariableListController.on_add()
ScopedVariableListController.on_right_click_menu()
ScopedVariableListController.paste_action_callback()
ScopedVariableListController.register_actions()
ScopedVariableListController.register_view()
ScopedVariableListController.reload_scoped_variables_list_store()
ScopedVariableListController.remove_core_element()
ScopedVariableListController.scoped_variables_changed()
- SourceEditorController (in source_editor)
SourceEditorController
SourceEditorController.apply_clicked()
SourceEditorController.format_error_string()
SourceEditorController.get_file_name()
SourceEditorController.load_and_set_file_content()
SourceEditorController.register_view()
SourceEditorController.save_file_data()
SourceEditorController.set_editor_lock()
SourceEditorController.source_text
SourceEditorController.tmp_file
- StateDataFlowsListController (in data_flows)
StateDataFlowsEditorController
StateDataFlowsListController
StateDataFlowsListController.CORE_ELEMENT_CLASS
StateDataFlowsListController.FROM_STATE_STORAGE_ID
StateDataFlowsListController.ID_STORAGE_ID
StateDataFlowsListController.IS_EXTERNAL_STORAGE_ID
StateDataFlowsListController.MODEL_STORAGE_ID
StateDataFlowsListController.TO_KEY_STORAGE_ID
StateDataFlowsListController.TO_STATE_STORAGE_ID
StateDataFlowsListController.after_notification_of_parent_or_state()
StateDataFlowsListController.after_notification_of_parent_or_state_from_lists()
StateDataFlowsListController.before_notification_of_parent_or_state()
StateDataFlowsListController.destroy()
StateDataFlowsListController.find_free_and_valid_data_flows()
StateDataFlowsListController.free_to_port_external
StateDataFlowsListController.free_to_port_internal
StateDataFlowsListController.from_port_external
StateDataFlowsListController.from_port_internal
StateDataFlowsListController.on_add()
StateDataFlowsListController.on_combo_changed_from_key()
StateDataFlowsListController.on_combo_changed_from_state()
StateDataFlowsListController.on_combo_changed_to_key()
StateDataFlowsListController.on_combo_changed_to_state()
StateDataFlowsListController.on_focus()
StateDataFlowsListController.on_right_click_menu()
StateDataFlowsListController.register_view()
StateDataFlowsListController.remove_core_element()
StateDataFlowsListController.update()
find_free_keys()
get_key_combos()
get_state_model()
update_data_flows()
- DescriptionEditorController (in description_editor)
- StateEditorController (in state_editor)
- StateOutcomesListController (in outcomes)
StateOutcomesEditorController
StateOutcomesListController
StateOutcomesListController.CORE_ELEMENT_CLASS
StateOutcomesListController.CORE_PARENT_STORAGE_ID
StateOutcomesListController.CORE_STORAGE_ID
StateOutcomesListController.ID_STORAGE_ID
StateOutcomesListController.MODEL_STORAGE_ID
StateOutcomesListController.NAME_STORAGE_ID
StateOutcomesListController.apply_new_outcome_name()
StateOutcomesListController.destroy()
StateOutcomesListController.on_add()
StateOutcomesListController.on_right_click_menu()
StateOutcomesListController.on_to_outcome_edited()
StateOutcomesListController.on_to_state_edited()
StateOutcomesListController.outcomes_changed()
StateOutcomesListController.register_view()
StateOutcomesListController.remove_core_element()
StateOutcomesListController.update()
StateOutcomesListController.update_internal_data_base()
StateOutcomesListController.update_list_store()
- StateOverviewController (in overview)
StateOverviewController
StateOverviewController.change_name()
StateOverviewController.change_type()
StateOverviewController.check_for_enter()
StateOverviewController.get_allowed_state_classes()
StateOverviewController.notify_is_start()
StateOverviewController.notify_name_change()
StateOverviewController.on_focus_out()
StateOverviewController.on_toggle_is_start_state()
StateOverviewController.on_toggle_show_content()
StateOverviewController.register_view()
StateOverviewController.rename()
StateOverviewController.show_content_changed()
- StateTransitionsListController (in transitions)
StateTransitionsEditorController
StateTransitionsListController
StateTransitionsListController.CORE_ELEMENT_CLASS
StateTransitionsListController.FROM_OUTCOME_STORAGE_ID
StateTransitionsListController.FROM_STATE_STORAGE_ID
StateTransitionsListController.ID_STORAGE_ID
StateTransitionsListController.IS_EXTERNAL_STORAGE_ID
StateTransitionsListController.MODEL_STORAGE_ID
StateTransitionsListController.TO_OUTCOME_STORAGE_ID
StateTransitionsListController.TO_STATE_STORAGE_ID
StateTransitionsListController.after_notification_of_parent_or_state_from_lists()
StateTransitionsListController.after_notification_state()
StateTransitionsListController.before_notification_of_parent_or_state()
StateTransitionsListController.destroy()
StateTransitionsListController.get_possible_combos_for_transition()
StateTransitionsListController.on_add()
StateTransitionsListController.on_combo_changed_from_outcome()
StateTransitionsListController.on_combo_changed_from_state()
StateTransitionsListController.on_combo_changed_to_outcome()
StateTransitionsListController.on_combo_changed_to_state()
StateTransitionsListController.on_focus()
StateTransitionsListController.on_right_click_menu()
StateTransitionsListController.register_view()
StateTransitionsListController.remove_core_element()
StateTransitionsListController.update()
- MVC Controller Utils (rafcon.gui.controllers.utils)
- EditorController (in editor)
- ExtendedController (in extended_controller)
ExtendedController
ExtendedController.add_controller()
ExtendedController.connect_signal()
ExtendedController.destroy()
ExtendedController.disconnect_all_signals()
ExtendedController.get_child_controllers()
ExtendedController.get_controller()
ExtendedController.get_controller_by_path()
ExtendedController.get_root_window()
ExtendedController.observe_model()
ExtendedController.parent
ExtendedController.register_actions()
ExtendedController.register_view()
ExtendedController.relieve_all_models()
ExtendedController.relieve_model()
ExtendedController.remove_controller()
ExtendedController.unregister_actions()
- SingleWidgetWindowController (in single_widget_window)
MainWindowController (in main_window)¶
GraphicalEditorController (in graphical_editor_gaphas)¶
StateMachinesEditorController (in state_machines_editor)¶
ExecutionHistoryTreeController (in execution_history)¶
- class rafcon.gui.controllers.execution_history.ExecutionHistoryTreeController(model=None, view=None)¶
Bases:
ExtendedController
Controller handling the execution history.
- Parameters:
model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines.
view (rafcon.gui.views.execution_history.ExecutionHistoryTreeView) – The GTK View showing the execution history tree.
state_machine_manager (rafcon.core.state_machine_manager.StateMachineManager) –
- HISTORY_ITEM_STORAGE_ID = 1¶
- TOOL_TIP_STORAGE_ID = 2¶
- TOOL_TIP_TEXT = 'Right click for more details\nMiddle click for external more detailed viewer\nDouble click to select corresponding state'¶
- clean_history(widget, event=None)¶
Triggered when the ‘Clean History’ button is clicked.
Empties the execution history tree by adjusting the start index and updates tree store and view.
- destroy()¶
Recursively destroy all Controllers
The method remove all controllers, which calls the destroy method of the child controllers. Then, all registered models are relieved and and the widget hand by the initial view argument is destroyed.
- execution_history_focus(model, prop_name, info)¶
Arranges to put execution-history widget page to become top page in notebook when execution starts and stops and resets the boolean of modification_history_was_focused to False each time this notification are observed.
- get_history_item_for_tree_iter(child_tree_iter)¶
Hands history item for tree iter and compensate if tree item is a dummy item
- Parameters:
child_tree_iter (Gtk.TreeIter) – Tree iter of row
- Rtype rafcon.core.execution.execution_history.HistoryItem:
- Return history tree item:
- insert_concurrent_execution_histories(parent, concurrent_execution_histories)¶
Adds the child execution histories of a concurrency state.
- Parameters:
parent (Gtk.TreeItem) – the parent to add the next history item to
concurrent_execution_histories (list[ExecutionHistory]) – a list of all child execution histories
- Returns:
- insert_execution_history(parent, execution_history, is_root=False)¶
Insert a list of history items into a the tree store
If there are concurrency history items, the method is called recursively.
- Parameters:
parent (Gtk.TreeItem) – the parent to add the next history item to
execution_history (ExecutionHistory) – all history items of a certain state machine execution
is_root (bool) – Whether this is the root execution history
- insert_history_item(parent, history_item, description, dummy=False)¶
Enters a single history item into the tree store
- Parameters:
parent (Gtk.TreeItem) – Parent tree item
history_item (HistoryItem) – History item to be inserted
description (str) – A description to be added to the entry
dummy (None) – Whether this is just a dummy entry (wrapper for concurrency items)
- Returns:
Inserted tree item
- Return type:
Gtk.TreeItem
- mouse_click(widget, event=None)¶
Triggered when mouse click is pressed in the history tree. The method shows all scoped data for an execution step as tooltip or fold and unfold the tree by double-click and select respective state for double clicked element.
- notification_selected_sm_changed(model, prop_name, info)¶
If a new state machine is selected, make sure expansion state is stored and tree updated
- notification_sm_changed(model, prop_name, info)¶
Remove references to non-existing state machines
- open_selected_history_separately(widget, event=None)¶
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
- reload_history(widget, event=None)¶
Triggered when the ‘Reload History’ button is clicked.
- update()¶
rebuild the tree view of the history item tree store :return:
GlobalVariableManagerController (in global_variable_manager)¶
- class rafcon.gui.controllers.global_variable_manager.GlobalVariableManagerController(model, view)¶
Bases:
ListViewController
Controller handling the Global Variable Manager
The controller enables to edit, add and remove global variable to the global variable manager by a tree view. Every global variable is accessible by it key which is in the tree view equivalent with its name and in the methods it is gv_name. This Controller inherit and use rudimentary methods of the ListViewController (therefore it introduce the ID_STORAGE_ID class attribute) and avoids to use the selection methods of those which need a MODEL_STORAGE_ID (there is no global variable model) and a state machine selection (is model based). Therefore the register view is only called for the extended controller. Because of this and the fact that name = key for a global variable ID_STORAGE_ID, NAME_STORAGE_ID and MODEL_STORAGE_ID are all equal.
- Parameters:
model (rafcon.gui.models.global_variable_manager.GlobalVariableManagerModel) – The Global Variable Manager Model
view (rafcon.gui.views.global_variable_editor.GlobalVariableEditorView) – The GTK view showing the list of global variables.
- Variables:
global_variable_counter (int) – Counter for global variables to ensure unique names for new global variables.
list_store (Gtk.ListStore) – A gtk list store storing the rows of data of respective global variables in.
- DATA_TYPE_AS_STRING_STORAGE_ID = 1¶
- ID_STORAGE_ID = 0¶
- IS_LOCKED_AS_STRING_STORAGE_ID = 3¶
- MODEL_STORAGE_ID = 0¶
- NAME_STORAGE_ID = 0¶
- VALUE_AS_STRING_STORAGE_ID = 2¶
- apply_new_global_variable_name(path, new_gv_name)¶
Change global variable name/key according handed string
Updates the global variable name only if different and already in list store.
- Parameters:
path – The path identifying the edited global variable tree view row, can be str, int or tuple.
new_gv_name (str) – New global variable name
- apply_new_global_variable_type(path, new_data_type_as_string)¶
Change global variable value according handed string
Updates the global variable data type only if different.
- Parameters:
path – The path identifying the edited global variable tree view row, can be str, int or tuple.
new_data_type_as_string (str) – New global variable data type as string
- apply_new_global_variable_value(path, new_value_as_string)¶
Change global variable value according handed string
Updates the global variable value only if new value string is different to old representation.
- Parameters:
path – The path identifying the edited global variable tree view row, can be str, int or tuple.
new_value_as_string (str) – New global variable value as string
- assign_notification_from_gvm(model, prop_name, info)¶
Handles gtkmvc3 notification from global variable manager
Calls update of whole list store in case new variable was added. Avoids to run updates without reasonable change. Holds tree store and updates row elements if is-locked or global variable value changes.
- global_variable_is_editable(gv_name, intro_message='edit')¶
Check whether global variable is locked
- on_add(widget, data=None)¶
Create a global variable with default value and select its row
Triggered when the add button in the global variables tab is clicked.
- on_lock(widget, data=None)¶
Locks respective selected core element
- on_unlock(widget, data=None)¶
Locks respective selected core element
- register_actions(shortcut_manager)¶
Register callback methods for triggered actions
- Parameters:
shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) – Shortcut Manager Object holding mappings between shortcuts and actions.
- register_view(view)¶
Called when the View was registered
- remove_core_element(model)¶
Remove respective core element of handed global variable name
- Parameters:
model (str) – String that is the key/gv_name of core element which should be removed
- Returns:
- update_global_variables_list_store()¶
Updates the global variable list store
Triggered after creation or deletion of a variable has taken place.
LoggingConsoleController (in logging_console)¶
- class rafcon.gui.controllers.logging_console.LoggingConsoleController(model, view)¶
Bases:
ExtendedController
Controller handling the updates and modifications of the logging console.
- Parameters:
rafcon.gui.models.config_model.ConfigModel – Gui config model holding and observing the global gui config.
view (rafcon.gui.views.logging_console.LoggingConsoleView) – The GTK view showing the logging messages.
- destroy()¶
Recursively destroy all Controllers
The method remove all controllers, which calls the destroy method of the child controllers. Then, all registered models are relieved and and the widget hand by the initial view argument is destroyed.
- model_changed(model, prop_name, info)¶
React to configuration changes
Update internal hold enable state, propagates it to view and refresh the text buffer.
- print_filtered_buffer()¶
- print_message(message, log_level, new=True)¶
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
- update_filtered_buffer()¶
LibraryTreeController (in library_tree)¶
- class rafcon.gui.controllers.library_tree.LibraryTreeController(model, view, find_usages=False)¶
Bases:
ExtendedController
- ID_STORAGE_ID = 0¶
- ITEM_STORAGE_ID = 1¶
- LIB_KEY_STORAGE_ID = 4¶
- LIB_PATH_STORAGE_ID = 2¶
- OS_PATH_STORAGE_ID = 3¶
- TOOL_TIP_STORAGE_ID = 3¶
- static convert_if_human_readable(s)¶
Converts a string to format which is more human readable
- extract_library_properties_from_selected_row()¶
Extracts properties library_os_path, library_path, library_name and tree_item_key from tree store row
- insert_button_clicked(widget, as_template=False)¶
- insert_rec(parent, library_key, library_item, library_path, library_root_path=None)¶
Relocate library after request second confirmation
Removes library from hard drive after request second confirmation
Rename library after request second confirmation
- model_changed(model, prop_name, info)¶
- mouse_click(widget, event=None)¶
- on_drag_begin(widget, context)¶
replace drag icon
- Parameters:
widget –
context –
- on_drag_data_get(widget, context, data, info, time)¶
dragged state is inserted and its state_id sent to the receiver
- Parameters:
widget –
context –
data – SelectionData: contains state_id
info –
time –
- open_button_clicked(widget)¶
- open_library_as_state_machine()¶
- open_run_button_clicked(widget)¶
- redo_expansion_state()¶
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
- select_library_tree_element_of_lib_tree_path(lib_tree_path)¶
- select_library_tree_element_of_library_state_model(state_m)¶
- store_expansion_state()¶
- substitute_as_library_clicked(widget, keep_name=True)¶
- substitute_as_template_clicked(widget, keep_name=True)¶
- update()¶
ModificationHistoryTreeController (in modification_history)¶
- class rafcon.gui.controllers.modification_history.ModificationHistoryTreeController(model, view)¶
Bases:
ExtendedController
- static get_color_active(active)¶
- new_change(model, method_name, instance, info, history_id, active, parent_tree_item, parameters, tool_tip=None)¶
- on_cursor_changed(widget)¶
- on_redo_button_clicked(widget, event=None)¶
- on_reset_button_clicked(widget, event=None)¶
- on_toggle_mode(widget, event=None)¶
- on_toggle_tree_folded(widget, event=None)¶
- on_undo_button_clicked(widget, event=None)¶
- redo(key_value, modifier_mask, **kwargs)¶
Redo for selected state-machine if no state-source-editor is open and focused in states-editor-controller.
- Returns:
True if a redo was performed, False if focus on source-editor.
- Return type:
- register()¶
Change the state machine that is observed for new selected states to the selected state machine. :return:
- register_actions(shortcut_manager)¶
Register callback methods for triggered actions
- Parameters:
shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) –
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
- state_machine_manager_notification(model, property, info)¶
- undo(key_value, modifier_mask, **kwargs)¶
Undo for selected state-machine if no state-source-editor is open and focused in states-editor-controller.
- Returns:
True if a undo was performed, False if focus on source-editor.
- Return type:
- update(model, prop_name, info)¶
The method updates the history (a Gtk.TreeStore) which is the model of respective TreeView. It functionality is strongly depends on a consistent history-tree hold by a ChangeHistory-Class.
StateMachineTreeController (in state_machine_tree)¶
- class rafcon.gui.controllers.state_machine_tree.StateMachineTreeController(model, view)¶
Bases:
TreeViewController
Controller handling the state machine tree.
- Parameters:
model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines. Should be exchangeable.
view (rafcon.gui.views.state_machine_tree.StateMachineTreeView) – The GTK view showing the state machine tree.
- ID_STORAGE_ID = 1¶
- MODEL_STORAGE_ID = 3¶
- NAME_STORAGE_ID = 0¶
- STATE_PATH_STORAGE_ID = 4¶
- TYPE_NAME_STORAGE_ID = 2¶
- action_signal(model, prop_name, info)¶
- assign_notification_selection(state_machine_m, signal_name, signal_msg)¶
- get_row_iter_for_state_model(state_model)¶
- get_state_machine_selection()¶
Getter state machine selection
- Returns:
selection object, filtered set of selected states
- Return type:
rafcon.gui.selection.Selection, set
- insert_and_update_recursively(parent_iter, state_model, with_expand=False)¶
Insert and/or update the handed state model in parent tree store element iterator
- Parameters:
parent_iter – Parent tree store iterator the insert should be performed in
state_model (StateModel) – Model of state that has to be insert and/or updated
with_expand (bool) – Trigger to expand tree
- Returns:
- mouse_click(widget, event=None)¶
- paste_action_callback(*event, **kwargs)¶
Callback method for paste action
- redo_expansion_state(ignore_not_existing_rows=False)¶
Considers the tree to be collapsed and expand into all tree item with the flag set True
- register()¶
Change the state machine that is observed for new selected states to the selected state machine.
- register_actions(shortcut_manager)¶
Register callback methods for triggered actions
- Parameters:
shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) – Shortcut Manager Object holding mappings between shortcuts and actions.
- register_view(view)¶
Called when the view was registered
- remove_tree_children(child_tree_iter)¶
- selection_changed(widget, event=None)¶
Notify state machine about tree view selection
- show_content(state_model)¶
Check state machine tree specific show content flag.
Is returning true if the upper most library state of a state model has a enabled show content flag or if there is no library root state above this state.
- Parameters:
state_model (rafcon.gui.models.abstract_state.AbstractStateModel) – The state model to check
- state_action_signal(model, prop_name, info)¶
- state_machine_manager_notification(model, property, info)¶
- state_machine_notification(model, property, info)¶
- state_meta_update(model, prop_name, info)¶
- states_update(model, prop_name, info)¶
- states_update_before(model, prop_name, info)¶
- store_expansion_state()¶
- update(changed_state_model=None, with_expand=False)¶
Checks if all states are in tree and if tree has states which were deleted
- Parameters:
changed_state_model – Model that row has to be updated
with_expand – The expand flag for the tree
- update_tree_store_row(state_model)¶
StatesEditorController (in states_editor)¶
- class rafcon.gui.controllers.states_editor.StatesEditorController(model, view)¶
Bases:
ExtendedController
Controller handling the states editor
- Parameters:
model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines.
view (rafcon.gui.views.states_editor.StatesEditorView) – The GTK view showing state editor tabs.
- Variables:
tabs – Currently open State Editor tabs.
closed_tabs – Previously opened, non-deleted State Editor tabs.
- activate_state_tab(state_m)¶
Opens the tab for the specified state model
The tab with the given state model is opened or set to foreground.
- Parameters:
state_m – The desired state model (the selected state)
- add_state_editor(state_m)¶
Triggered whenever a state is selected.
- Parameters:
state_m – The selected state model.
- close_all_pages()¶
Closes all tabs of the states editor
- close_page(state_identifier, delete=True)¶
Closes the desired page
The page belonging to the state with the specified state_identifier is closed. If the deletion flag is set to False, the controller of the page is stored for later usage.
- Parameters:
state_identifier – Identifier of the page’s state
delete – Whether to delete the controller (deletion is necessary if teh state is deleted)
- close_pages_for_specific_sm_id(sm_id)¶
Closes all tabs of the states editor for a specific sm_id
- property current_state_machine_m¶
- get_current_state_m()¶
Returns the state model of the currently open tab
- get_page_of_state_m(state_m)¶
Return the identifier and page of a given state model
- Parameters:
state_m – The state model to be searched
- Returns:
page containing the state and the state_identifier
- get_state_identifier(state_m)¶
- get_state_identifier_for_page(page)¶
Returns the state identifier for a given page
- notify_state_name_change(model, prop_name, info)¶
Checks whether the name of a state was changed and change the tab label accordingly
- on_close_clicked(widget, page_num)¶
- on_config_value_changed(config_m, prop_name, info)¶
Callback when a config value has been changed
- on_switch_page(notebook, page_pointer, page_num, user_param1=None)¶
Update state machine and state selection when the active tab was changed
When the state editor tab switches (e.g. when a tab is closed), this callback causes the state machine tab corresponding to the activated state editor tab to be opened and the corresponding state to be selected.
This is disabled for now, as the might be irritating for the user
- on_tab_close_clicked(event, state_m)¶
Triggered when the states-editor close button is clicked
Closes the tab.
- Parameters:
state_m – The desired state model (the selected state)
- on_toggle_sticky_clicked(event, state_m)¶
Callback for the “toggle-sticky-check-button” emitted by custom TabLabel widget.
- prepare_destruction()¶
- register_actions(shortcut_manager)¶
Register callback methods for triggered actions
- Parameters:
shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) – Shortcut Manager Object holding mappings between shortcuts and actions.
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
- reload_style()¶
Closes all tabs and reopens only the current tab in the new style.
- Returns:
- rename_selected_state(key_value, modifier_mask, **kwargs)¶
Callback method for shortcut action rename
Searches for a single selected state model and open the according page. Page is created if it is not existing. Then the rename method of the state controller is called.
- Parameters:
key_value –
modifier_mask –
- root_state_changed(model, property, info)¶
- script_text_changed(text_buffer, state_m)¶
Update gui elements according text buffer changes
Checks if the dirty flag needs to be set and the tab label to be updated.
- Parameters:
text_buffer (TextBuffer) – Text buffer of the edited script
state_m (rafcon.gui.models.state.StateModel) – The state model related to the text buffer
- Returns:
- selection_notification(state_machine_m, property, info)¶
If a single state is selected, open the corresponding tab
- state_action_signal(model, prop_name, info)¶
- state_machine_manager_notification(model, property, info)¶
Triggered whenever a new state machine is created, or an existing state machine is selected.
- state_machines_del_notification(model, prop_name, info)¶
Relive models of closed state machine
- state_machines_set_notification(model, prop_name, info)¶
Observe all open state machines and their root states
- update_tab_label(state_m)¶
Update all tab labels
- Parameters:
state_m (rafcon.state_machine.states.state.State) – State model who’s tab label is to be updated
- rafcon.gui.controllers.states_editor.create_button(toggle, font_size, icon_code, release_callback=None, *additional_parameters)¶
- rafcon.gui.controllers.states_editor.create_sticky_button(callback, *additional_parameters)¶
- rafcon.gui.controllers.states_editor.create_tab_close_button(callback, *additional_parameters)¶
- rafcon.gui.controllers.states_editor.create_tab_header(title, close_callback, sticky_callback, *additional_parameters)¶
- rafcon.gui.controllers.states_editor.set_tab_label_texts(label, state_m, unsaved_changes=False)¶
ToolBarController (in tool_bar)¶
- class rafcon.gui.controllers.tool_bar.ToolBarController(state_machine_manager_model, view)¶
Bases:
ExtendedController
The class to trigger all the action, available in the tool bar.
- Parameters:
state_machine_manager_model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines. Should be exchangeable.
view –
- on_button_bake_state_machine_clicked(widget, data=None)¶
- on_button_layout_state_machine(widget, data=None)¶
- on_button_new_clicked(widget, data=None)¶
- on_button_open_clicked(widget, data=None)¶
- on_button_refresh_clicked(widget, data=None)¶
- on_button_refresh_libs_clicked(widget, data=None)¶
- on_button_refresh_selected_clicked(widget, data=None)¶
- on_button_save_clicked(widget, data=None)¶
- register_actions(shortcut_manager)¶
Register callback methods for triggered actions
- Parameters:
shortcut_manager (rafcon.gui.shortcut_manager.ShortcutManager) –
- register_view(view)¶
Called when the View was registered
TopToolBarController (in top_tool_bar)¶
- class rafcon.gui.controllers.top_tool_bar.TopToolBarController(state_machine_manager_model, view, top_level_window)¶
Bases:
ExtendedController
The class to trigger all the actions available in the top tool bar.
- Parameters:
state_machine_manager_model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines. Should be exchangeable.
view (rafcon.gui.views.top_tool_bar.TopToolBarView) – The GTK View showing the top tool bar buttons.
top_level_window – The top level window containing the top tool bar.
- on_maximize_button_clicked(widget, data=None)¶
- on_minimize_button_clicked(widget, data=None)¶
- register_view(view)¶
Called when the View was registered
- update_maximize_button()¶
- class rafcon.gui.controllers.top_tool_bar.TopToolBarUndockedWindowController(state_machine_manager_model, view, redock_method)¶
Bases:
TopToolBarController
Controller handling the top tool bar in the un-docked windows.
In this controller, the close button in the top tool bar is hidden.
- on_redock_button_clicked(widget, event=None)¶
Triggered when the redock button in any window is clicked.
Calls the corresponding redocking function of the open window.
- register_view(view)¶
Called when the View was registered
StateIconController (in state_icons)¶
- class rafcon.gui.controllers.state_icons.StateIconController(model=None, view=None, shortcut_manager=None)¶
Bases:
ExtendedController
- on_drag_begin(widget, context)¶
replace drag icon
- Parameters:
widget –
context –
- on_drag_data_get(widget, context, data, info, time)¶
dragged state is inserted and its state_id sent to the receiver
- Parameters:
widget –
context –
data – SelectionData: contains state_id
info –
time –
- on_drag_end(widget, context)¶
if the drag is finished, all icons are unselected
- Parameters:
widget –
context –
- on_mouse_click(widget, event)¶
state insertion on mouse click
- Parameters:
widget –
event (Gdk.Event) – mouse click event
- on_mouse_motion(widget, event)¶
selection on mouse over
- Parameters:
widget –
event (Gdk.Event) – mouse motion event
- register_view(view)¶
Called when the View was registered
Can be used e.g. to connect signals. Here, this implements a convenient feature that observes if thread problems are possible by destroying a controller before being fully initialized.
UndockedWindowController (in undocked_window)¶
- class rafcon.gui.controllers.undocked_window.UndockedWindowController(state_machine_manager_model, view, redock_method)¶
Bases:
ExtendedController
Controller handling the un-docked windows
- Parameters:
state_machine_manager_model (rafcon.gui.models.state_machine_manager.StateMachineManagerModel) – The state machine manager model, holding data regarding state machines. Should be exchangeable.
view (rafcon.gui.views.undocked_window.UndockedWindowView) – The GTK View showing the separate window
- hide_window()¶