pub struct SelectionManager { /* private fields */ }Expand description
Selection state manager
Implementations§
Source§impl SelectionManager
impl SelectionManager
Sourcepub fn selected_nodes(&self) -> &HashSet<NodeId>
pub fn selected_nodes(&self) -> &HashSet<NodeId>
Get currently selected nodes
Sourcepub fn is_selected(&self, node_id: &NodeId) -> bool
pub fn is_selected(&self, node_id: &NodeId) -> bool
Check if a node is selected
Sourcepub fn selection_count(&self) -> usize
pub fn selection_count(&self) -> usize
Get the number of selected nodes
Sourcepub fn select_node(&mut self, node_id: NodeId)
pub fn select_node(&mut self, node_id: NodeId)
Select a node (behavior depends on current mode)
Sourcepub fn toggle_node(&mut self, node_id: NodeId)
pub fn toggle_node(&mut self, node_id: NodeId)
Toggle node selection (add if not selected, remove if selected)
Sourcepub fn deselect_node(&mut self, node_id: &NodeId)
pub fn deselect_node(&mut self, node_id: &NodeId)
Deselect a node
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear all selections
Sourcepub fn set_mode(&mut self, mode: SelectionMode)
pub fn set_mode(&mut self, mode: SelectionMode)
Set selection mode
Sourcepub fn mode(&self) -> &SelectionMode
pub fn mode(&self) -> &SelectionMode
Get current selection mode
Sourcepub fn start_rectangle_selection(&mut self, start: Position)
pub fn start_rectangle_selection(&mut self, start: Position)
Start rectangle selection
Sourcepub fn update_rectangle_selection(&mut self, end: Position)
pub fn update_rectangle_selection(&mut self, end: Position)
Update rectangle selection
Sourcepub fn complete_rectangle_selection<N, E>(
&mut self,
graph: &Graph<N, E>,
) -> Vec<NodeId>
pub fn complete_rectangle_selection<N, E>( &mut self, graph: &Graph<N, E>, ) -> Vec<NodeId>
Complete rectangle selection and select nodes within bounds
Sourcepub fn rectangle_bounds(&self) -> Option<(Position, Position)>
pub fn rectangle_bounds(&self) -> Option<(Position, Position)>
Get rectangle selection bounds
Select nodes by keyboard navigation (move selection to next/previous node)
Sourcepub fn handle_keyboard_shortcut<N, E>(
&mut self,
graph: &Graph<N, E>,
shortcut: KeyboardShortcut,
)
pub fn handle_keyboard_shortcut<N, E>( &mut self, graph: &Graph<N, E>, shortcut: KeyboardShortcut, )
Handle keyboard shortcuts for selection management (read-only operations)
Sourcepub fn handle_destructive_keyboard_shortcut<N, E>(
&mut self,
graph: &mut Graph<N, E>,
shortcut: KeyboardShortcut,
)
pub fn handle_destructive_keyboard_shortcut<N, E>( &mut self, graph: &mut Graph<N, E>, shortcut: KeyboardShortcut, )
Handle destructive keyboard shortcuts that modify the graph
Sourcepub fn set_visual_feedback(
&mut self,
node_id: &NodeId,
feedback: VisualFeedback,
)
pub fn set_visual_feedback( &mut self, node_id: &NodeId, feedback: VisualFeedback, )
Set visual feedback for a node
Sourcepub fn get_visual_feedback(&self, node_id: &NodeId) -> Option<&VisualFeedback>
pub fn get_visual_feedback(&self, node_id: &NodeId) -> Option<&VisualFeedback>
Get visual feedback for a node
Sourcepub fn has_visual_feedback(&self, node_id: &NodeId) -> bool
pub fn has_visual_feedback(&self, node_id: &NodeId) -> bool
Check if a node has visual feedback
Sourcepub fn set_hover_state(&mut self, node_id: &NodeId, hovered: bool)
pub fn set_hover_state(&mut self, node_id: &NodeId, hovered: bool)
Set hover state for a node
Sourcepub fn set_highlight_state(&mut self, node_id: &NodeId, highlighted: bool)
pub fn set_highlight_state(&mut self, node_id: &NodeId, highlighted: bool)
Set highlight state for a node
Sourcepub fn set_animation_progress(&mut self, node_id: &NodeId, progress: f64)
pub fn set_animation_progress(&mut self, node_id: &NodeId, progress: f64)
Set animation progress for a node
Sourcepub fn nodes_with_visual_feedback(&self) -> Vec<NodeId>
pub fn nodes_with_visual_feedback(&self) -> Vec<NodeId>
Get all nodes with visual feedback
Sourcepub fn clear_all_visual_feedbacks(&mut self)
pub fn clear_all_visual_feedbacks(&mut self)
Clear all visual feedback
Sourcepub fn clear_visual_feedback(&mut self, node_id: &NodeId)
pub fn clear_visual_feedback(&mut self, node_id: &NodeId)
Clear visual feedback for a specific node
Sourcepub fn select_all<N, E>(&mut self, graph: &Graph<N, E>)
pub fn select_all<N, E>(&mut self, graph: &Graph<N, E>)
Select all nodes in the graph
Sourcepub fn select_group(&mut self, group_manager: &GroupManager, group_id: &GroupId)
pub fn select_group(&mut self, group_manager: &GroupManager, group_id: &GroupId)
Select a group (replacing current selection)
Sourcepub fn select_node_with_group(
&mut self,
group_manager: &GroupManager,
node_id: NodeId,
select_whole_group: bool,
)
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
Sourcepub fn get_selected_groups(
&self,
group_manager: &GroupManager,
) -> HashSet<GroupId>
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
impl Clone for SelectionManager
Source§fn clone(&self) -> SelectionManager
fn clone(&self) -> SelectionManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more