pub struct GroupManager { /* private fields */ }Expand description
Group manager for handling group operations
Implementations§
Source§impl GroupManager
impl GroupManager
Sourcepub fn create_group(
&mut self,
group_id: GroupId,
members: HashSet<NodeId>,
) -> Result<()>
pub fn create_group( &mut self, group_id: GroupId, members: HashSet<NodeId>, ) -> Result<()>
Create a new group with the given members
Sourcepub fn get_group_mut(&mut self, group_id: &GroupId) -> Option<&mut Group>
pub fn get_group_mut(&mut self, group_id: &GroupId) -> Option<&mut Group>
Get a mutable reference to a group by ID
Sourcepub fn get_node_group(&self, node_id: &NodeId) -> Option<&GroupId>
pub fn get_node_group(&self, node_id: &NodeId) -> Option<&GroupId>
Get the group ID for a node
Sourcepub fn dissolve_group(&mut self, group_id: &GroupId) -> Result<HashSet<NodeId>>
pub fn dissolve_group(&mut self, group_id: &GroupId) -> Result<HashSet<NodeId>>
Dissolve a group and return its members
Sourcepub fn all_groups(&self) -> &HashMap<GroupId, Group>
pub fn all_groups(&self) -> &HashMap<GroupId, Group>
Get all groups
Sourcepub fn node_mappings(&self) -> &HashMap<NodeId, GroupId>
pub fn node_mappings(&self) -> &HashMap<NodeId, GroupId>
Get all node-to-group mappings
Sourcepub fn add_node_to_group(
&mut self,
group_id: &GroupId,
node_id: NodeId,
) -> Result<()>
pub fn add_node_to_group( &mut self, group_id: &GroupId, node_id: NodeId, ) -> Result<()>
Add a node to an existing group
Sourcepub fn remove_node_from_group(
&mut self,
group_id: &GroupId,
node_id: &NodeId,
) -> Result<()>
pub fn remove_node_from_group( &mut self, group_id: &GroupId, node_id: &NodeId, ) -> Result<()>
Remove a node from a group
Sourcepub fn set_group_name(
&mut self,
group_id: &GroupId,
name: Option<String>,
) -> Result<()>
pub fn set_group_name( &mut self, group_id: &GroupId, name: Option<String>, ) -> Result<()>
Set the name of a group
Sourcepub fn calculate_group_bounds<N, E>(
&mut self,
group_id: &GroupId,
graph: &Graph<N, E>,
) -> Result<()>
pub fn calculate_group_bounds<N, E>( &mut self, group_id: &GroupId, graph: &Graph<N, E>, ) -> Result<()>
Calculate the bounding rectangle for a group based on its member positions
Sourcepub fn update_group_bounds<N, E>(
&mut self,
group_id: &GroupId,
graph: &Graph<N, E>,
) -> Result<()>
pub fn update_group_bounds<N, E>( &mut self, group_id: &GroupId, graph: &Graph<N, E>, ) -> Result<()>
Update group bounds based on current member positions
Sourcepub fn group_count(&self) -> usize
pub fn group_count(&self) -> usize
Get the number of groups
Sourcepub fn is_node_grouped(&self, node_id: &NodeId) -> bool
pub fn is_node_grouped(&self, node_id: &NodeId) -> bool
Check if a node is in any group
Sourcepub fn start_group_drag<N, E>(
&mut self,
group_id: &GroupId,
start_position: Position,
graph: &Graph<N, E>,
) -> Result<()>
pub fn start_group_drag<N, E>( &mut self, group_id: &GroupId, start_position: Position, graph: &Graph<N, E>, ) -> Result<()>
Start a group drag operation
Sourcepub fn update_group_drag<N, E>(
&mut self,
new_position: Position,
graph: &mut Graph<N, E>,
) -> Result<Position>
pub fn update_group_drag<N, E>( &mut self, new_position: Position, graph: &mut Graph<N, E>, ) -> Result<Position>
Update group drag position
Sourcepub fn complete_group_drag(&mut self) -> Result<GroupId>
pub fn complete_group_drag(&mut self) -> Result<GroupId>
Complete group drag operation
Sourcepub fn cancel_group_drag<N, E>(
&mut self,
graph: &mut Graph<N, E>,
) -> Result<GroupId>
pub fn cancel_group_drag<N, E>( &mut self, graph: &mut Graph<N, E>, ) -> Result<GroupId>
Cancel group drag operation and restore original positions
Sourcepub fn is_group_dragging(&self) -> bool
pub fn is_group_dragging(&self) -> bool
Check if a group is currently being dragged
Sourcepub fn get_dragging_group(&self) -> Option<&GroupId>
pub fn get_dragging_group(&self) -> Option<&GroupId>
Get the current dragging group ID (if any)
Sourcepub fn get_drag_delta(&self) -> Option<Position>
pub fn get_drag_delta(&self) -> Option<Position>
Get the current drag delta (if any)
Sourcepub fn has_active_drag(&self) -> bool
pub fn has_active_drag(&self) -> bool
Check if there’s an active drag operation
Trait Implementations§
Source§impl Clone for GroupManager
impl Clone for GroupManager
Source§fn clone(&self) -> GroupManager
fn clone(&self) -> GroupManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more