AnnotationController<T> class
Controller for managing annotations in the node flow
This controller provides methods for creating, selecting, moving, and managing annotations within the node flow editor. All operations automatically handle MobX reactivity and coordinate with the parent NodeFlowController.
Key behaviors:
- Snap-to-grid: Annotations respect the parent controller's snap-to-grid settings
- Unified selection: Works with the unified selection system across nodes/connections
- Theme integration: Automatically uses NodeFlowTheme for consistent styling
Constructors
-
AnnotationController(NodeFlowController<
T> _parentController)
Properties
- annotationCursor → MouseCursor
-
no setter
-
annotations
→ Map<
String, Annotation> -
no setter
- draggedAnnotationId → String?
-
no setter
- hasAnnotationSelection → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightedGroupId → String?
-
no setter
- isMovingGroupNodes → bool
-
no setter
- lastPointerPosition → Offset?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedAnnotationIds
→ Set<
String> -
Get all currently selected annotation IDs
no setter
-
sortedAnnotations
→ List<
Annotation> -
no setter
Methods
-
addAnnotation(
Annotation annotation) → void -
addNodeDependency(
String annotationId, String nodeId, {AnnotationDependencyType type = AnnotationDependencyType.follow}) → void -
bringAnnotationForward(
String annotationId) → void -
bringAnnotationToFront(
String annotationId) → void -
clearAnnotationSelection(
) → void - Clear all annotation selections
-
clearDragHighlight(
) → void - Clear drag highlight when node drag ends
-
clearNodeDependencies(
String annotationId) → void -
createGroupAnnotation(
{required String id, required String title, required Set< String> nodeIds, required Map<String, Node< nodes, EdgeInsets padding = const EdgeInsets.all(20.0), Color color = Colors.blue}) → GroupAnnotationT> > -
createMarkerAnnotation(
{required String id, required Offset position, MarkerType markerType = MarkerType.info, double size = 24.0, Color color = Colors.red, String? tooltip, Offset offset = Offset.zero}) → MarkerAnnotation -
createStickyAnnotation(
{required String id, required Offset position, required String text, double width = 200.0, double height = 100.0, Color color = Colors.yellow, Offset offset = Offset.zero}) → StickyAnnotation -
deleteSelectedAnnotations(
) → void -
dispose(
) → void -
findIntersectingGroup(
String nodeId) → GroupAnnotation? - Check if a node intersects with any group annotation Returns the first intersecting group, or null if none found
-
getAnnotation(
String annotationId) → Annotation? -
getAnnotationsDependingOnNode(
String nodeId) → List< Annotation> -
handleCommandDragGroupOperation(
String nodeId, bool isCommandPressed) → void - Handle Command+drag group operations (add nodes to groups)
-
hideAllAnnotations(
) → void -
internalEndAnnotationDrag(
) → void -
internalHitTestAnnotations(
Offset point) → Annotation? -
internalMoveAnnotationDrag(
Offset newPointerPosition, Offset graphDelta, Map< String, Node< nodes) → voidT> > -
internalSelectAnnotation(
String annotationId, {bool toggle = false}) → void -
internalStartAnnotationDrag(
String annotationId, Offset pointerPosition) → void -
internalUpdateAnnotationCursor(
MouseCursor cursor) → void -
internalUpdateDependentAnnotations(
Map< String, Node< nodes) → voidT> > -
isAnnotationSelected(
String annotationId) → bool - Check if a specific annotation is currently selected
-
isGroupHighlighted(
String groupId) → bool - Check if a group is currently highlighted
-
moveSelectedAnnotations(
Offset delta) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeAnnotation(
String annotationId) → void -
removeNodeDependency(
String annotationId, String nodeId) → void -
resetGroupMoveFlag(
) → void -
selectAnnotation(
String annotationId, {bool toggle = false}) → void - Select or deselect an annotation
-
sendAnnotationBackward(
String annotationId) → void -
sendAnnotationToBack(
String annotationId) → void -
setAnnotationVisibility(
String annotationId, bool visible) → void -
showAllAnnotations(
) → void -
toString(
) → String -
A string representation of this object.
inherited
-
updateAnnotation(
String annotationId, Annotation updatedAnnotation) → void -
updateDragHighlight(
String nodeId, bool isCommandPressed) → void - Update visual feedback during node drag (only during Command+drag)
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited