SelectionManager

Struct SelectionManager 

Source
pub struct SelectionManager { /* private fields */ }
Expand description

Selection state manager

Implementations§

Source§

impl SelectionManager

Source

pub fn new() -> Self

Create a new selection manager

Source

pub fn selected_nodes(&self) -> &HashSet<NodeId>

Get currently selected nodes

Source

pub fn is_selected(&self, node_id: &NodeId) -> bool

Check if a node is selected

Source

pub fn selection_count(&self) -> usize

Get the number of selected nodes

Source

pub fn select_node(&mut self, node_id: NodeId)

Select a node (behavior depends on current mode)

Source

pub fn toggle_node(&mut self, node_id: NodeId)

Toggle node selection (add if not selected, remove if selected)

Source

pub fn deselect_node(&mut self, node_id: &NodeId)

Deselect a node

Source

pub fn clear_selection(&mut self)

Clear all selections

Source

pub fn set_mode(&mut self, mode: SelectionMode)

Set selection mode

Source

pub fn mode(&self) -> &SelectionMode

Get current selection mode

Source

pub fn start_rectangle_selection(&mut self, start: Position)

Start rectangle selection

Source

pub fn update_rectangle_selection(&mut self, end: Position)

Update rectangle selection

Source

pub fn complete_rectangle_selection<N, E>( &mut self, graph: &Graph<N, E>, ) -> Vec<NodeId>
where N: Clone, E: Clone,

Complete rectangle selection and select nodes within bounds

Source

pub fn rectangle_bounds(&self) -> Option<(Position, Position)>

Get rectangle selection bounds

Source

pub fn navigate_selection<N, E>( &mut self, graph: &Graph<N, E>, direction: NavigationDirection, ) -> Option<NodeId>
where N: Clone, E: Clone,

Select nodes by keyboard navigation (move selection to next/previous node)

Source

pub fn handle_keyboard_shortcut<N, E>( &mut self, graph: &Graph<N, E>, shortcut: KeyboardShortcut, )
where N: Clone, E: Clone,

Handle keyboard shortcuts for selection management (read-only operations)

Source

pub fn handle_destructive_keyboard_shortcut<N, E>( &mut self, graph: &mut Graph<N, E>, shortcut: KeyboardShortcut, )
where N: Clone, E: Clone,

Handle destructive keyboard shortcuts that modify the graph

Source

pub fn set_visual_feedback( &mut self, node_id: &NodeId, feedback: VisualFeedback, )

Set visual feedback for a node

Source

pub fn get_visual_feedback(&self, node_id: &NodeId) -> Option<&VisualFeedback>

Get visual feedback for a node

Source

pub fn has_visual_feedback(&self, node_id: &NodeId) -> bool

Check if a node has visual feedback

Source

pub fn set_hover_state(&mut self, node_id: &NodeId, hovered: bool)

Set hover state for a node

Source

pub fn set_highlight_state(&mut self, node_id: &NodeId, highlighted: bool)

Set highlight state for a node

Source

pub fn set_animation_progress(&mut self, node_id: &NodeId, progress: f64)

Set animation progress for a node

Source

pub fn nodes_with_visual_feedback(&self) -> Vec<NodeId>

Get all nodes with visual feedback

Source

pub fn clear_all_visual_feedbacks(&mut self)

Clear all visual feedback

Source

pub fn clear_visual_feedback(&mut self, node_id: &NodeId)

Clear visual feedback for a specific node

Source

pub fn select_all<N, E>(&mut self, graph: &Graph<N, E>)

Select all nodes in the graph

Source

pub fn select_group(&mut self, group_manager: &GroupManager, group_id: &GroupId)

Select a group (replacing current selection)

Source

pub fn select_node_with_group( &mut self, group_manager: &GroupManager, node_id: NodeId, select_whole_group: bool, )

Select a node, optionally selecting its entire group

Source

pub fn get_selected_groups( &self, group_manager: &GroupManager, ) -> HashSet<GroupId>

Get all groups that have at least one selected node

Trait Implementations§

Source§

impl Clone for SelectionManager

Source§

fn clone(&self) -> SelectionManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SelectionManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SelectionManager

Source§

fn default() -> SelectionManager

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.