AnnotatingController

Controller for annotation mode, provided via OnAnnotatingModeChangeListener callbacks.

This is the primary interface for programmatically interacting with annotation mode. It provides methods for managing the active annotation tool, querying and modifying the current annotation selection, toggling the property inspector, and accessing annotation preferences.

Not to be confused with AnnotatingInspectorController, which controls the property inspector panel UI (show/hide, bind/unbind lifecycle).

Functions

Link copied to clipboard
Register a OnAnnotatingModeChangeListener to get notified when annotation mode (creation or editing) gets updated.
Link copied to clipboard
Register a OnAnnotatingModeSettingsChangeListener to get notified when annotation mode settings get updated.
Link copied to clipboard
abstract fun bindAnnotationInspectorController(@NonNull annotationInspectorController: AnnotationInspectorController)
Binds to the annotation inspector controller for managing annotation inspector.
Link copied to clipboard
abstract fun changeAnnotationCreationMode(@NonNull annotationTool: AnnotationTool, @NonNull annotationToolVariant: AnnotationToolVariant)
Starts an annotation creation mode with different annotation tool selected.
Link copied to clipboard
open fun clearSelection()
Clears the current annotation selection.
Link copied to clipboard
Deletes currently selected annotations from the document.
Link copied to clipboard
abstract fun displayScalePicker()
Displays/hides an annotation inspector for the measurement annotation types.
Link copied to clipboard
Starts playback mode for the currently selected sound annotation.
Link copied to clipboard
Starts recording mode for the currently selected sound annotation.
Link copied to clipboard
Returns annotation creation tool that is currently active.
Link copied to clipboard
Returns the variant of the annotation creation tool that is currently active.
Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
abstract fun getAlpha(): Float
Gets alpha set to the annotation creation mode.
Link copied to clipboard
Returns an annotation editing preferences.
Link copied to clipboard
Gets border style preset set to the annotation creation mode.
Link copied to clipboard
abstract fun getColor(): Int
Gets current color set to the annotation creation mode.
Link copied to clipboard
Returns an active configuration.
Link copied to clipboard
Returns currently selected annotations (if any).
Link copied to clipboard
Returns the currently selected annotation - only if there's just a single one selected.
Link copied to clipboard
abstract fun getFillColor(): Int
Gets fill color set to the annotation creation mode.
Link copied to clipboard
abstract fun getFont(): Font
Gets the font set to the annotation creation mode.
Link copied to clipboard
Returns current line ending styles for drawn lines.
Link copied to clipboard
Gets the MeasurementValueConfiguration for measurement annotations.
Link copied to clipboard
abstract fun getOutlineColor(): Int
Gets outline color set to the annotation creation mode.
Link copied to clipboard
abstract fun getOverlayText(): String
Gets the overlay text set to the annotation creation mode.
Link copied to clipboard
Returns whether the overlay text should be repeated or not.
Link copied to clipboard
@FloatRange(from = 1)
abstract fun getTextSize(): Float
Gets text size set to the annotation creation mode.
Link copied to clipboard
@FloatRange(from = 0.0)
abstract fun getThickness(): Float
Gets thickness set to the annotation creation mode.
Link copied to clipboard
Returns whether there are any currently selected annotations.
Link copied to clipboard
Checks if all currently selected annotations can be copied.
open fun isCopyEnabled(@Nullable annotations: List<Annotation>): Boolean
Checks if all provided annotations can be copied.
Link copied to clipboard
open fun isCutEnabled(): Boolean
Checks if all currently selected annotations can be cut.
open fun isCutEnabled(@Nullable annotations: List<Annotation>): Boolean
Checks if all provided annotations can be cut.
Link copied to clipboard
Checks if all currently selected annotations can be deleted.
open fun isDeleteEnabled(@Nullable annotations: List<Annotation>): Boolean
Checks if all provided annotations can be deleted.
Link copied to clipboard
open fun recordAnnotationZIndexEdit(@NonNull annotation: Annotation, oldZIndex: Int, newZIndex: Int)
Records the z-index being changed on the specified annotation.
Link copied to clipboard
open fun selectAnnotations(@NonNull annotations: List<Annotation>)
Selects the specified annotations for editing.
Link copied to clipboard
abstract fun setAlpha(@FloatRange(from = 0.0, to = 1.0) alpha: Float)
Sets alpha to the annotation creation mode.
Link copied to clipboard
abstract fun setBorderStylePreset(@NonNull borderPreset: BorderStylePreset)
Sets border preset to the annotation creation mode.
Link copied to clipboard
abstract fun setColor(@ColorInt color: Int)
Sets color for the annotation creation mode.
Link copied to clipboard
abstract fun setFillColor(@ColorInt fillColor: Int)
Sets fill color for the annotation creation mode.
Link copied to clipboard
abstract fun setFont(@NonNull font: Font)
Sets the font to the annotation creation mode.
Link copied to clipboard
abstract fun setLineEnds(@NonNull lineEnd1: LineEndType, @NonNull lineEnd2: LineEndType)
Sets line ending style for drawn lines.
Link copied to clipboard
Sets the MeasurementValueConfiguration for measurement annotations.
Link copied to clipboard
abstract fun setOutlineColor(@ColorInt outlineColor: Int)
Sets outline color for the annotation creation mode.
Link copied to clipboard
abstract fun setOverlayText(@NonNull overlayText: String)
Sets the overlay text to the annotation creation mode.
Link copied to clipboard
abstract fun setRepeatOverlayText(repeatOverlayText: Boolean)
Sets if the overlay text should be repeated.
Link copied to clipboard
abstract fun setTextSize(@FloatRange(from = 1) textSize: Float)
Sets text size to the annotation creation mode.
Link copied to clipboard
abstract fun setThickness(@FloatRange(from = 0.0) thickness: Float)
Sets thickness to the annotation creation mode.
Link copied to clipboard
Whether annotation inspector toolbar icon should be visible.
Link copied to clipboard
Whether play button should be displayed for the selected sound annotation.
Link copied to clipboard
Whether record button should be displayed for the selected sound annotation.
Link copied to clipboard
abstract fun showAnnotationEditor(@NonNull annotation: Annotation)
Shows annotation editor for the passed annotation.
Link copied to clipboard
Temporarily hides the selected/edited annotation view and shows its relative position on the page.
Link copied to clipboard
open fun startRecording()
Starts recording the edits for undo/redo support.
Link copied to clipboard
open fun stopRecording()
Stops recording the edits, notifies the result and clears current record, so calling startRecording will start from clean state.
Link copied to clipboard
Displays/hides an annotation inspector for the selected annotation type.
Link copied to clipboard
Unbinds from previously bound annotation inspector controller.