Skip to main content

GraphView

Struct GraphView 

Source
pub struct GraphView<T>
where T: GraphNode + 'static,
{ /* private fields */ }
Expand description

An interactive view for displaying and editing a node-and-edge Graph.

GraphView renders nodes that implement GraphNode, supports panning, selection, dragging, and optional edge creation. Layout and routing are controlled through Flags and related graph options.

Implementations§

Source§

impl<T> GraphView<T>
where T: GraphNode,

Source

pub fn new(layout: Layout, flags: Flags) -> Self

Creates a new GraphView control with the specified layout and flags.

§Parameters
  • layout: The layout configuration for positioning and sizing the GraphView
  • flags: Combination of initialization flags that control the GraphView behavior:
    • Flags::ScrollBars: Enables scroll bars for navigating large graphs
    • Flags::SearchBar: Enables a search bar for finding nodes
    • Flags::MultiSelect: Enables multi-selection UI (checkbox column and related behavior)
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars | graphview::Flags::SearchBar
);
Source

pub fn set_background(&mut self, backgroud_char: Character)

Sets the background of the GraphView to the specified character.

This method allows you to customize the background appearance of the GraphView. The background character will be used to fill the entire control area before drawing the graph nodes and edges.

§Parameters
  • backgroud_char: The character to use as background, including its color and formatting
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:30,h:10"),
    graphview::Flags::ScrollBars
);
graph_view.set_background(Character::new('·', Color::Gray, Color::Black, CharFlags::None));
Source

pub fn clear_background(&mut self)

Clears the background character of the GraphView.

This method removes any previously set background character and resets the GraphView to use transparent foreground and background colors, allowing the default theme background to show through.

§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:30,h:10"),
    graphview::Flags::None
);
graph_view.set_background(Character::new('*', Color::White, Color::Black, CharFlags::None));
graph_view.clear_background(); // Removes the background character
Source

pub fn set_graph(&mut self, graph: Graph<T>)

Sets the graph data to be displayed in the GraphView.

This method replaces the current graph with a new one, updates the rendering options, and automatically arranges the nodes using the current arrangement method.

§Parameters
  • graph: The graph containing nodes and edges to be displayed
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);

let nodes = &["A", "B", "C", "D", "E"];
let edges = &[(0, 1), (0, 2), (1, 3), (2, 4)];
let graph = graphview::Graph::with_slices(nodes, edges, true);
graph_view.set_graph(graph);
Source

pub fn set_edge_routing(&mut self, routing: EdgeRouting)

Sets the edge routing method for drawing connections between nodes.

This method determines how edges are drawn between nodes in the graph.

§Parameters
  • routing: The routing method to use:
    • EdgeRouting::Direct: Draw edges as straight lines between nodes
    • EdgeRouting::Orthogonal: Draw edges as orthogonal (right-angled) lines
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);
graph_view.set_edge_routing(graphview::EdgeRouting::Orthogonal);
Source

pub fn set_edge_line_type(&mut self, line_type: LineType)

Sets the line type used for drawing edges between nodes.

This method controls the visual style of the lines used to draw edges. Different line types provide different visual appearances.

§Parameters
  • line_type: The line style to use:
    • LineType::Single: Single lines with Unicode box-drawing characters
    • LineType::Double: Double lines with Unicode box-drawing characters
    • LineType::SingleThick: Thick single lines
    • LineType::Border: Border-style thick lines
    • LineType::Ascii: ASCII characters (‘+’, ‘-’, ‘|’)
    • LineType::AsciiRound: ASCII with rounded corners
    • LineType::SingleRound: Unicode single lines with rounded corners
    • LineType::Braille: Double lines using Braille characters
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);
graph_view.set_edge_line_type(LineType::Double);
Source

pub fn enable_edge_highlighting(&mut self, incoming: bool, outgoing: bool)

Enables or disables edge highlighting for the currently selected node.

When edge highlighting is enabled, edges connected to the currently selected node will be visually highlighted to make the connections more apparent.

§Parameters
  • incoming: Whether to highlight edges pointing to the current node
  • outgoing: Whether to highlight edges originating from the current node
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);
// Highlight both incoming and outgoing edges
graph_view.enable_edge_highlighting(true, true);

// Only highlight outgoing edges
graph_view.enable_edge_highlighting(false, true);
Source

pub fn enable_arrow_heads(&mut self, enabled: bool)

Enables or disables arrow heads on directed edges.

When enabled, directed edges will display arrow heads to indicate the direction of the connection between nodes.

§Parameters
  • enabled: Whether to show arrow heads on directed edges
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);
graph_view.enable_arrow_heads(true);
Source

pub fn arrange_nodes(&mut self, method: ArrangeMethod)

Arranges the nodes in the graph using the specified layout algorithm.

This method automatically positions all nodes in the graph according to the chosen arrangement algorithm. The graph will be resized and repainted after the arrangement is complete.

§Parameters
  • method: The arrangement algorithm to use:
    • ArrangeMethod::None: No automatic arrangement (manual positioning)
    • ArrangeMethod::Grid: Arrange nodes in a regular grid with spacing
    • ArrangeMethod::GridPacked: Arrange nodes in a compact grid
    • ArrangeMethod::Circular: Arrange nodes in a circular pattern
    • ArrangeMethod::Hierarchical: Arrange nodes in hierarchical layers with spacing
    • ArrangeMethod::HierarchicalPacked: Arrange nodes in compact hierarchical layers
    • ArrangeMethod::ForceDirected: Use force-directed algorithm for natural positioning
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);

// Arrange nodes in a hierarchical layout
graph_view.arrange_nodes(graphview::ArrangeMethod::Hierarchical);

// Use force-directed layout for organic appearance
graph_view.arrange_nodes(graphview::ArrangeMethod::ForceDirected);
Source

pub fn graph(&self) -> &Graph<T>

Returns an immutable reference to the underlying graph data.

This method provides read-only access to the graph structure, allowing you to query nodes, edges, and other graph properties.

§Returns

A reference to the Graph<T> containing all nodes and edges

§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);

let graph = graph_view.graph();
if let Some(node) = graph.current_node() {
    // do something with the current node
}
Source

pub fn modify_graph<F>(&mut self, f: F)
where F: FnOnce(&mut EditableGraph<'_, T>),

Performs an in-place edit to the graph structure.

This method allows you to modify the graph’s nodes, edges, and current selection in a single atomic operation. The changes are tracked and applied to the graph, triggering a repaint and resize if necessary.

§Parameters
  • f: A closure that takes an EditableGraph reference and performs the desired edits.
§Example
use appcui::prelude::*;

type MyNode = &'static str; // or any other type that implements the GraphNode trait

let mut graph_view: GraphView<MyNode> = GraphView::new(
    layout!("x:1,y:1,w:50,h:30"),
    graphview::Flags::ScrollBars
);

graph_view.modify_graph(|g| {
    let mut node = g.node(0).unwrap();
    node.set_value("New Value");
});
Source

pub fn selected_count(&self) -> usize

Returns the number of selected nodes in the graph.

Methods from Deref<Target = ControlBase>§

Source

pub fn size(&self) -> Size

Returns the size of a control

Source

pub fn client_size(&self) -> Size

Returns the client size of a control. In most cases it is the same as the size returned the method .get_size(). However, if the control has margins (for example in case of a Window) this size will be smaller.

Source

pub fn set_size(&mut self, width: u16, height: u16)

Sets the new size for a control (to a specified size given by parameters width and height). Keep in mind that this method will change the existing layout to an a layout based on top-left corner (given by controls x and y coordonates) and the new provided size. Any dock or alignment properties will be removed. This method has no effect on a Desktop control.

Source

pub fn position(&self) -> Point

Returns the relatove position (x,y) of the current control to its parent.

Source

pub fn set_position(&mut self, x: i32, y: i32)

Sets the new position for a control (to a specified coordonate given by parameters x and y). Keep in mind that this method will change the existing layout to an a layout based on top-left corner (given by coordonates x and y) and the controls current width and height. Any dock or alignment properties will be removed. This method has no effect on a Desktop control.

Source

pub fn set_enabled(&mut self, enabled: bool)

Sets the enabled state of a control. This method has no effect on a Desktop or a Window control that will always be enabled.

Source

pub fn set_visible(&mut self, visible: bool)

Can be used to make a control visible or not. This method has no effect on the Desktop control that will always be visible.

§Examples
use appcui::prelude::*;
let mut button = button!("'Click me',x:1,y:1,w:15");
button.set_visible(false); // this will hide the button
Source

pub fn set_components_toolbar_margins(&mut self, left: u8, top: u8)

Source

pub fn expanded_size(&self) -> Size

Source

pub fn request_focus(&mut self) -> bool

A control can use this method to request focus

Source

pub fn timer(&mut self) -> Option<&mut Timer>

Source

pub fn is_visible(&self) -> bool

Returns true if the current control is visible or false otherwise

Source

pub fn is_enabled(&self) -> bool

Returns true if the current control is enabled or false otherwise

Source

pub fn is_active(&self) -> bool

Returns true if the current control is active (enabled and visible at the same time) or false otherwise

Source

pub fn can_receive_input(&self) -> bool

Returns true if the current control can receive focus or false otherwise. If the control is not visible or it is disable this function will return false.

Source

pub fn has_focus(&self) -> bool

Returns true if the current control has the focus or false otherwise

Source

pub fn is_mouse_over(&self) -> bool

Returns true if the mouse cursor is over the current control or false otherwise

Source

pub fn set_size_bounds( &mut self, min_width: u16, min_height: u16, max_width: u16, max_height: u16, )

Sets the bounds (minim and maxim sized allowed for a control). If the size of a control is outside its bounds, its size will be adjusted automatically. This method has no effect on a Desktop control.

Source

pub fn set_hotkey<T>(&mut self, hotkey: T)
where Key: From<T>,

Sets the hot-key associated with a control. Use Key::None to clear an existing hotkey

Source

pub fn hotkey(&self) -> Key

Returns the hotkey associated to a control or Key::None otherwise.

Source

pub fn raise_custom_event(&self, class_hash: u64, event_id: u32)

Source

pub fn request_update(&self)

Source

pub fn register_menu(&mut self, menu: Menu) -> Handle<Menu>

Source

pub fn show_menu( &self, handle: Handle<Menu>, x: i32, y: i32, max_size: Option<Size>, )

Source

pub fn menuitem<T>( &self, menu_handle: Handle<Menu>, menuitem_handle: Handle<T>, ) -> Option<&T>
where T: MenuItem,

Source

pub fn menuitem_mut<T>( &mut self, menu_handle: Handle<Menu>, menuitem_handle: Handle<T>, ) -> Option<&mut T>
where T: MenuItem,

Source

pub fn appbar(&mut self) -> &mut AppBar

Source

pub fn theme(&self) -> &Theme

Source

pub fn update_layout(&mut self, layout: Layout)

Updates the layout of the current control

Trait Implementations§

Source§

impl<T> AccordionEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_panel_changed( &mut self, _handle: Handle<Accordion>, _new_panel_index: u32, _old_panel_index: u32, ) -> EventProcessStatus

Called when the expanded panel changes from old_panel_index to new_panel_index.
Source§

impl<T> AppBarEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_button_click(&mut self, _button: Handle<Button>)

Called when a button is clicked. Read more
Source§

fn on_togglebutton_state_changed( &mut self, _togglebutton: Handle<ToggleButton>, _selected: bool, )

Called when a toggle button’s state changes. Read more
Source§

fn on_switchbutton_state_changed( &mut self, _switchbutton: Handle<SwitchButton>, _selected: bool, )

Called when a switch button’s state changes. Read more
Source§

fn on_update(&self, _appbar: &mut AppBar)

Called when the app bar needs to be updated. By default, all items are hidden and whenever the focus changes, the AppCUI framework hides all items and starts from the focus control and moves to its parent and calls this method. In this method you should call appbar.show(…) method to show the items you want to show. Read more
Source§

impl<T> ButtonEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_pressed(&mut self, _handle: Handle<Button>) -> EventProcessStatus

Called when the button is pressed (mouse click or keyboard activate).
Source§

impl<T> CharPickerEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_char_changed( &mut self, _handle: Handle<CharPicker>, _code: Option<char>, ) -> EventProcessStatus

Called when the selection changes. code is None if the picker was cleared.
Source§

impl<T> CheckBoxEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_status_changed( &mut self, _handle: Handle<CheckBox>, _checked: bool, ) -> EventProcessStatus

Called when the check box is toggled. checked is the new state.
Source§

impl<T> ColorPickerEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_color_changed( &mut self, _handle: Handle<ColorPicker>, _color: Color, ) -> EventProcessStatus

Called when the selected color changes.
Source§

impl<T> ComboBoxEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_selection_changed( &mut self, _handle: Handle<ComboBox>, ) -> EventProcessStatus

Called when a different item is selected.
Source§

impl<T> Control for GraphView<T>
where T: GraphNode + 'static,

Source§

impl<T> CustomEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_event( &mut self, _handle: Handle<()>, _class_hash: u64, _event_id: u32, ) -> EventProcessStatus

Handles a custom event from handle. class_hash identifies the sender type and event_id the event.
Source§

impl<T> DatePickerEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_date_changed( &mut self, _handle: Handle<DatePicker>, _date: NaiveDate, ) -> EventProcessStatus

Called when the selected date changes.
Source§

impl<T> Deref for GraphView<T>
where T: GraphNode + 'static,

Source§

type Target = ControlBase

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> DerefMut for GraphView<T>
where T: GraphNode + 'static,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T> DesktopEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_start(&mut self)

Called once when the desktop starts (application launch).
Source§

fn on_close(&mut self) -> ActionRequest

Called when the user tries to close the desktop. Return ActionRequest::Deny to cancel.
Source§

fn on_update_window_count(&mut self, _count: usize)

Called whenever the number of open windows changes to count.
Source§

impl<T> GenericBackgroundTaskEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_start(&mut self, _handle: Handle<()>) -> EventProcessStatus

The background task has started.
Source§

fn on_update(&mut self, _handle: Handle<()>) -> EventProcessStatus

The background task reported progress.
Source§

fn on_finish(&mut self, _handle: Handle<()>) -> EventProcessStatus

The background task finished.
Source§

fn on_query(&mut self, _handle: Handle<()>) -> EventProcessStatus

The background task is querying the UI (for example for cancellation).
Source§

impl<T> GenericBufferViewEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_current_pos_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the current byte position changes inside a super::BufferView.
Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the selected byte range changes inside a super::BufferView.
Source§

impl<T> GenericCommandBarEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_update_commandbar(&self, _commandbar: &mut CommandBar)

Called when the command bar should be rebuilt. Add commands with commandbar.set(...).
Source§

fn on_event(&mut self, _command_id: u32)

Called when the user activates the command with identifier command_id.
Source§

impl<T> GenericDropDownListEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the selected item changes.
Source§

impl<T> GenericGraphViewEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_current_node_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the highlighted node changes.
Source§

fn on_node_action( &mut self, _handle: Handle<()>, _type_id: TypeId, _node_index: usize, ) -> EventProcessStatus

Called when the user activates the node at node_index (Enter or double-click).
Source§

fn on_request_new_node( &mut self, _handle: Handle<()>, _type_id: TypeId, _p: Point, ) -> EventProcessStatus

Called when the user requests a new node at point p.
Source§

fn on_request_new_edge( &mut self, _handle: Handle<()>, _type_id: TypeId, _from: u32, _to: u32, ) -> EventProcessStatus

Called when the user requests a new edge from node from to node to.
Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the set of selected nodes changes.
Source§

impl<T> GenericHSliderEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_value_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the slider value changes.
Source§

impl<T> GenericListViewEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_current_item_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the highlighted item changes.
Source§

fn on_group_collapsed( &mut self, _handle: Handle<()>, _type_id: TypeId, _group: Group, ) -> EventProcessStatus

Called when group is collapsed.
Source§

fn on_group_expanded( &mut self, _handle: Handle<()>, _type_id: TypeId, _group: Group, ) -> EventProcessStatus

Called when group is expanded.
Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the set of selected items changes.
Source§

fn on_item_action( &mut self, _handle: Handle<()>, _type_id: TypeId, _index: usize, ) -> EventProcessStatus

Called when the user activates the item at index (Enter or double-click).
Source§

impl<T> GenericMenuEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_menu_open(&self, _menu: &mut Menu)

Called when a menu is about to be opened. Read more
Source§

fn on_command( &mut self, _menu: Handle<Menu>, _item: Handle<Command>, _command: u32, )

Called when a command menu item is activated. Read more
Source§

fn on_check( &mut self, _menu: Handle<Menu>, _item: Handle<CheckBox>, _command: u32, _checked: bool, )

Called when a checkbox menu item’s state changes. Read more
Source§

fn on_select( &mut self, _menu: Handle<Menu>, _item: Handle<SingleChoice>, _command: u32, )

Called when a single choice menu item is selected. Read more
Source§

impl<T> GenericNumericSelectorEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_value_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the numeric value changes.
Source§

impl<T> GenericSelectorEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the selected enum variant changes.
Source§

impl<T> GenericTreeViewEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_current_item_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, _current_item: Handle<()>, ) -> EventProcessStatus

Called when the highlighted item changes to current_item.
Source§

fn on_item_collapsed( &mut self, _handle: Handle<()>, _type_id: TypeId, _item: Handle<()>, _recursive: bool, ) -> EventProcessStatus

Called when item is collapsed. recursive is true if children were collapsed too.
Source§

fn on_item_expanded( &mut self, _handle: Handle<()>, _type_id: TypeId, _item: Handle<()>, _recursive: bool, ) -> EventProcessStatus

Called when item is expanded. recursive is true if children were expanded too.
Source§

fn on_selection_changed( &mut self, _handle: Handle<()>, _type_id: TypeId, ) -> EventProcessStatus

Called when the set of selected items changes.
Source§

fn on_item_action( &mut self, _handle: Handle<()>, _type_id: TypeId, _current_item: Handle<()>, ) -> EventProcessStatus

Called when the user activates current_item (Enter or double-click).
Source§

impl<T> HyperLinkEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_open(&mut self, _handle: Handle<HyperLink>) -> EventProcessStatus

Called when the hyperlink is opened (clicked or activated).
Source§

impl<T> KeySelectorEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_key_changed( &mut self, _handle: Handle<KeySelector>, _new_key: Key, _old_key: Key, ) -> EventProcessStatus

Called when the key changes from old_key to new_key.
Source§

impl<T> ListBoxEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_current_item_changed( &mut self, _handle: Handle<ListBox>, _index: usize, ) -> EventProcessStatus

Called when the highlighted item changes to index.
Source§

fn on_item_checked( &mut self, _handle: Handle<ListBox>, _index: usize, _checked: bool, ) -> EventProcessStatus

Called when the check box on the item at index is toggled to checked.
Source§

impl<T> MarkdownEvents for GraphView<T>
where T: GraphNode + 'static,

Called when the user activates an external link in the document.
Source§

fn on_backspace_navigation( &mut self, _handle: Handle<Markdown>, ) -> EventProcessStatus

Called when the user navigates back with Backspace.
Source§

impl<T> NotDesktop for GraphView<T>
where T: GraphNode + 'static,

Source§

impl<T> NotWindow for GraphView<T>
where T: GraphNode + 'static,

Source§

impl<T> OnDefaultAction for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_default_action(&mut self)

Runs the control’s default action.
Source§

impl<T> OnExpand for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_expand(&mut self, _direction: ExpandedDirection)

The control expanded in direction (ExpandedDirection::OnTop or OnBottom).
Source§

fn on_pack(&mut self)

The control collapsed back to its packed size.
Source§

impl<T> OnFocus for GraphView<T>
where T: GraphNode,

Source§

fn on_focus(&mut self)

The control received focus.
Source§

fn on_lose_focus(&mut self)

The control lost focus.
Source§

impl<T> OnKeyPressed for GraphView<T>
where T: GraphNode,

Source§

fn on_key_pressed(&mut self, key: Key, character: char) -> EventProcessStatus

Handles a key press. character is the translated character, or '\0' for non-character keys.
Source§

impl<T> OnMouseEvent for GraphView<T>
where T: GraphNode,

Source§

fn on_mouse_event(&mut self, event: &MouseEvent) -> EventProcessStatus

Handles a mouse MouseEvent (move, click, wheel, and similar).
Source§

impl<T> OnPaint for GraphView<T>
where T: GraphNode,

Source§

fn on_paint(&self, surface: &mut Surface, theme: &Theme)

Paints the control onto surface using the current theme.
Source§

impl<T> OnResize for GraphView<T>
where T: GraphNode,

Source§

fn on_resize(&mut self, _: Size, _: Size)

Notifies that the control was resized from old_size to new_size.
Source§

impl<T> OnSiblingSelected for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_sibling_selected(&mut self, _handle: Handle<()>)

handle identifies the sibling that became selected.
Source§

impl<T> OnThemeChanged for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_theme_changed(&mut self, _theme: &Theme)

Reloads colors or other theme-dependent state from theme.
Source§

impl<T> OnWindowRegistered for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_registered(&mut self)

The control is now attached to a window and can use window services.
Source§

impl<T> PasswordEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_accept(&mut self, _handle: Handle<Password>) -> EventProcessStatus

Called when the user confirms the password (typically Enter).
Source§

fn on_cancel(&mut self, _handle: Handle<Password>) -> EventProcessStatus

Called when the user cancels (typically Escape).
Source§

impl<T> PathFinderEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_path_updated(&mut self, _handle: Handle<PathFinder>) -> EventProcessStatus

Called when the current path is updated (typed or navigated).
Source§

impl<T> RadioBoxEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_selected(&mut self, _handle: Handle<RadioBox>) -> EventProcessStatus

Called when this radio box is selected (others in the group are cleared).
Source§

impl<T> RichTextFieldEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_validate( &mut self, _handle: Handle<RichTextField>, _text: &str, ) -> EventProcessStatus

Called when the user confirms the text (Enter or similar).
Source§

fn on_text_changed( &mut self, _handle: Handle<RichTextField>, ) -> EventProcessStatus

Called after the text content changes.
Source§

impl<T> TabEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_tab_changed( &mut self, _handle: Handle<Tab>, _new_tab_index: u32, _old_tabl_index: u32, ) -> EventProcessStatus

Called when the selected page changes from old_tabl_index to new_tab_index.
Source§

impl<T> TextFieldEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_validate( &mut self, _handle: Handle<TextField>, _text: &str, ) -> EventProcessStatus

Called when the user confirms the text (Enter, if super::Flags::ProcessEnter is set).
Source§

fn on_text_changed(&mut self, _handle: Handle<TextField>) -> EventProcessStatus

Called after the text content changes.
Source§

impl<T> ThreeStateBoxEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_status_changed( &mut self, _handle: Handle<ThreeStateBox>, _state: State, ) -> EventProcessStatus

Called when the state changes to state (checked, unchecked, or unknown).
Source§

impl<T> TimePickerEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_time_changed( &mut self, _handle: Handle<TimePicker>, _time: NaiveTime, ) -> EventProcessStatus

Called when the selected time changes.
Source§

impl<T> TimerEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_start(&mut self) -> EventProcessStatus

The timer has started.
Source§

fn on_resume(&mut self, _ticks: u64) -> EventProcessStatus

The timer resumed after a pause. ticks is the count at resume.
Source§

fn on_pause(&mut self, _ticks: u64) -> EventProcessStatus

The timer was paused. ticks is the count at pause.
Source§

fn on_update(&mut self, _ticks: u64) -> EventProcessStatus

A periodic tick. ticks is the current count.
Source§

impl<T> ToggleButtonEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_selection_changed( &mut self, _handle: Handle<ToggleButton>, _selected: bool, ) -> EventProcessStatus

Called when the toggle button is toggled. selected is the new pressed state.
Source§

impl<T> ToolBarEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_button_clicked(&mut self, _handle: Handle<Button>) -> EventProcessStatus

Called when a toolbar button is clicked. Read more
Source§

fn on_checkbox_clicked( &mut self, _handle: Handle<CheckBox>, _checked: bool, ) -> EventProcessStatus

Called when a toolbar checkbox is clicked, changing its checked state. Read more
Source§

fn on_choice_selected( &mut self, _handle: Handle<SingleChoice>, ) -> EventProcessStatus

Called when a toolbar single choice item is selected. Read more
Source§

impl<T> WindowEvents for GraphView<T>
where T: GraphNode + 'static,

Source§

fn on_layout_changed(&mut self, _old_layout: Rect, _new_layout: Rect)

Called after the window’s rectangle changes from old_layout to new_layout.
Source§

fn on_activate(&mut self)

called whenver the window receives focus
Source§

fn on_deactivate(&mut self)

called whenever the window loses focus.
Source§

fn on_accept(&mut self)

called whenever the ENTER key is intercepted by the Window For modal windows the behavior should be to use .exit_with(...) method to exit. for a regular (non-modal) window this callback is never called)
Source§

fn on_cancel(&mut self) -> ActionRequest

called whenever the ESC key is interpreted by the Window Read more

Auto Trait Implementations§

§

impl<T> Freeze for GraphView<T>
where Graph<T>: Freeze,

§

impl<T> RefUnwindSafe for GraphView<T>
where Graph<T>: RefUnwindSafe,

§

impl<T> Send for GraphView<T>
where Graph<T>: Send,

§

impl<T> Sync for GraphView<T>
where Graph<T>: Sync,

§

impl<T> Unpin for GraphView<T>
where Graph<T>: Unpin,

§

impl<T> UnsafeUnpin for GraphView<T>
where Graph<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for GraphView<T>
where Graph<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more