Interface AnnotationCreationController
-
- All Implemented Interfaces:
-
com.pspdfkit.ui.special_mode.controller.base.FragmentSpecialModeController
,com.pspdfkit.ui.special_mode.controller.base.SpecialModeController
public interface AnnotationCreationController implements FragmentSpecialModeController
Default controller given when entering annotation creation mode. Used to control annotation creation mode properties and actions.
-
-
Method Summary
Modifier and Type Method Description abstract AnnotationTool
getActiveAnnotationTool()
Returns annotation creation tool that is currently active. abstract AnnotationToolVariant
getActiveAnnotationToolVariant()
Returns the variant of the annotation creation tool that is currently active. abstract AnnotationManager
getAnnotationManager()
Returns an annotation manager which you can use to register listeners from the controller. abstract AnnotationPreferencesManager
getAnnotationPreferences()
Returns an annotation editing preferences. abstract void
changeAnnotationCreationMode(@NonNull() AnnotationTool annotationTool, @NonNull() AnnotationToolVariant annotationToolVariant)
Starts an annotation creation mode with different annotation tool selected. abstract PdfConfiguration
getConfiguration()
Returns an active configuration. abstract int
getColor()
Gets current color set to the annotation creation mode. abstract void
setColor(@ColorInt() int color)
Sets color for the annotation creation mode. abstract int
getFillColor()
Gets fill color set to the annotation creation mode. abstract void
setFillColor(@ColorInt() int fillColor)
Sets fill color for the annotation creation mode. abstract int
getOutlineColor()
Gets outline color set to the annotation creation mode. abstract void
setOutlineColor(@ColorInt() int outlineColor)
Sets outline color for the annotation creation mode. abstract float
getThickness()
Gets thickness set to the annotation creation mode. abstract void
setThickness(@FloatRange(from = 0.0) float thickness)
Sets thickness to the annotation creation mode. abstract float
getTextSize()
Gets text size set to the annotation creation mode. abstract void
setTextSize(@FloatRange(from = 1) float textSize)
Sets text size to the annotation creation mode. abstract void
setBorderStylePreset(@NonNull() BorderStylePreset borderPreset)
Sets border preset to the annotation creation mode. abstract BorderStylePreset
getBorderStylePreset()
Gets border style preset set to the annotation creation mode. abstract void
setLineEnds(@NonNull() LineEndType lineEnd1, @NonNull() LineEndType lineEnd2)
Sets line ending style for drawn lines. abstract Pair<LineEndType, LineEndType>
getLineEnds()
Returns current line ending styles for drawn lines. abstract void
setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha)
Sets alpha to the annotation creation mode. abstract float
getAlpha()
Gets alpha set to the annotation creation mode. abstract void
setFont(@NonNull() Font font)
Sets the font to the annotation creation mode. abstract Font
getFont()
Gets the font set to the annotation creation mode. abstract void
setOverlayText(@NonNull() String overlayText)
Sets the overlay text to the annotation creation mode. abstract String
getOverlayText()
Gets the overlay text set to the annotation creation mode. abstract void
setRepeatOverlayText(boolean repeatOverlayText)
Sets if the overlay text should be repeated. abstract boolean
getRepeatOverlayText()
Returns whether the overlay text should be repeated or not. abstract void
setMeasurementValueConfiguration(@Nullable() MeasurementValueConfiguration configuration)
Sets the MeasurementValueConfiguration for measurement annotations. abstract MeasurementValueConfiguration
getMeasurementValueConfiguration()
Gets the MeasurementValueConfiguration for measurement annotations. abstract boolean
shouldDisplayPicker()
Whether annotation inspector toolbar icon should be visible. abstract void
toggleAnnotationInspector()
Displays/hides an annotation inspector for the selected annotation type. abstract void
bindAnnotationInspectorController(@NonNull() AnnotationInspectorController annotationInspectorController)
Binds to the annotation inspector controller for managing annotation inspector. abstract void
unbindAnnotationInspectorController()
Unbinds from previously bound annotation inspector controller. abstract void
showAnnotationEditor(@NonNull() Annotation annotation)
Shows annotation editor for the passed annotation. abstract void
displayScalePicker()
Displays/hides an annotation inspector for the measurement annotation types. -
-
Method Detail
-
getActiveAnnotationTool
@Nullable() abstract AnnotationTool getActiveAnnotationTool()
Returns annotation creation tool that is currently active.
- Returns:
Active annotation tool. NONE if annotation creation mode is active but no annotation tool is selected,
null
if annotation creation mode is inactive.
-
getActiveAnnotationToolVariant
@Nullable() abstract AnnotationToolVariant getActiveAnnotationToolVariant()
Returns the variant of the annotation creation tool that is currently active.
- Returns:
Active annotation tool variant.
-
getAnnotationManager
@NonNull() abstract AnnotationManager getAnnotationManager()
Returns an annotation manager which you can use to register listeners from the controller.
- Returns:
Annotation manager managing the annotation editing listeners.
-
getAnnotationPreferences
@NonNull() abstract AnnotationPreferencesManager getAnnotationPreferences()
Returns an annotation editing preferences.
- Returns:
Annotation preferences used by this controller.
-
changeAnnotationCreationMode
abstract void changeAnnotationCreationMode(@NonNull() AnnotationTool annotationTool, @NonNull() AnnotationToolVariant annotationToolVariant)
Starts an annotation creation mode with different annotation tool selected.
- Parameters:
annotationTool
- New annotation tool.annotationToolVariant
- Variant of the annotation tool to start.
-
getConfiguration
@NonNull() abstract PdfConfiguration getConfiguration()
Returns an active configuration.
- Returns:
Current configuration.
-
getColor
@ColorInt() abstract int getColor()
Gets current color set to the annotation creation mode.
- Returns:
Annotation creation mode color, displayed in the color circle starting up a color picker.
-
setColor
abstract void setColor(@ColorInt() int color)
Sets color for the annotation creation mode.
- Parameters:
color
- Annotation creation mode color.
-
getFillColor
@ColorInt() abstract int getFillColor()
Gets fill color set to the annotation creation mode.
- Returns:
Annotation creation mode fill color.
-
setFillColor
abstract void setFillColor(@ColorInt() int fillColor)
Sets fill color for the annotation creation mode.
- Parameters:
fillColor
- Annotation creation mode fill color.
-
getOutlineColor
@ColorInt() abstract int getOutlineColor()
Gets outline color set to the annotation creation mode.
- Returns:
Annotation creation mode outline color.
-
setOutlineColor
abstract void setOutlineColor(@ColorInt() int outlineColor)
Sets outline color for the annotation creation mode.
- Parameters:
outlineColor
- Annotation creation mode outline color.
-
getThickness
@FloatRange(from = 0.0) abstract float getThickness()
Gets thickness set to the annotation creation mode.
- Returns:
Thickness in PDF points (font size for FREETEXT annotations).
-
setThickness
abstract void setThickness(@FloatRange(from = 0.0) float thickness)
Sets thickness to the annotation creation mode.
- Parameters:
thickness
- Thickness in PDF points (font size for FREETEXT annotations).
-
getTextSize
@FloatRange(from = 1) abstract float getTextSize()
Gets text size set to the annotation creation mode.
- Returns:
Text size in PDF points.
-
setTextSize
abstract void setTextSize(@FloatRange(from = 1) float textSize)
Sets text size to the annotation creation mode.
- Parameters:
textSize
- Text size in PDF points.
-
setBorderStylePreset
abstract void setBorderStylePreset(@NonNull() BorderStylePreset borderPreset)
Sets border preset to the annotation creation mode.
- Parameters:
borderPreset
- Required border style preset.
-
getBorderStylePreset
@NonNull() abstract BorderStylePreset getBorderStylePreset()
Gets border style preset set to the annotation creation mode.
- Returns:
Border style preset.
-
setLineEnds
abstract void setLineEnds(@NonNull() LineEndType lineEnd1, @NonNull() LineEndType lineEnd2)
Sets line ending style for drawn lines.
- Parameters:
lineEnd1
- LineEndType for start of the line.lineEnd2
- LineEndType for end of the line.
-
getLineEnds
@NonNull() abstract Pair<LineEndType, LineEndType> getLineEnds()
Returns current line ending styles for drawn lines.
- Returns:
Pair of start and end line ending styles. If they're not set, returns NONE.
-
setAlpha
abstract void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha)
Sets alpha to the annotation creation mode.
- Parameters:
alpha
- Alpha in percent from 0 to 1.
-
getAlpha
@FloatRange(from = 0.0, to = 1.0) abstract float getAlpha()
Gets alpha set to the annotation creation mode.
- Returns:
Alpha in percent from 0 to 1.
-
setFont
abstract void setFont(@NonNull() Font font)
Sets the font to the annotation creation mode.
- Parameters:
font
- The font to use.
-
getFont
abstract Font getFont()
Gets the font set to the annotation creation mode.
- Returns:
The font set.
-
setOverlayText
abstract void setOverlayText(@NonNull() String overlayText)
Sets the overlay text to the annotation creation mode.
- Parameters:
overlayText
- The overlay text to use.
-
getOverlayText
@NonNull() abstract String getOverlayText()
Gets the overlay text set to the annotation creation mode.
- Returns:
The overlay text that is set.
-
setRepeatOverlayText
abstract void setRepeatOverlayText(boolean repeatOverlayText)
Sets if the overlay text should be repeated.
- Parameters:
repeatOverlayText
- If the overlay text should be repeated.
-
getRepeatOverlayText
abstract boolean getRepeatOverlayText()
Returns whether the overlay text should be repeated or not.
- Returns:
Whether the overlay text should be repeated or not.
-
setMeasurementValueConfiguration
abstract void setMeasurementValueConfiguration(@Nullable() MeasurementValueConfiguration configuration)
Sets the MeasurementValueConfiguration for measurement annotations.
- Parameters:
configuration
- The MeasurementValueConfiguration to use.
-
getMeasurementValueConfiguration
abstract MeasurementValueConfiguration getMeasurementValueConfiguration()
Gets the MeasurementValueConfiguration for measurement annotations.
- Returns:
The float MeasurementValueConfiguration tp ise.
-
shouldDisplayPicker
abstract boolean shouldDisplayPicker()
Whether annotation inspector toolbar icon should be visible.
-
toggleAnnotationInspector
abstract void toggleAnnotationInspector()
Displays/hides an annotation inspector for the selected annotation type.
-
bindAnnotationInspectorController
abstract void bindAnnotationInspectorController(@NonNull() AnnotationInspectorController annotationInspectorController)
Binds to the annotation inspector controller for managing annotation inspector.
- Parameters:
annotationInspectorController
- Controller for managing annotation inspector.
-
unbindAnnotationInspectorController
abstract void unbindAnnotationInspectorController()
Unbinds from previously bound annotation inspector controller.
-
showAnnotationEditor
abstract void showAnnotationEditor(@NonNull() Annotation annotation)
Shows annotation editor for the passed annotation.
- Parameters:
annotation
- Annotation for which to show the editor.
-
displayScalePicker
abstract void displayScalePicker()
Displays/hides an annotation inspector for the measurement annotation types.
-
-
-
-