public interface

AnnotationPreferencesManager

com.pspdfkit.annotations.defaults.AnnotationPreferencesManager

Class Overview

Manager providing access to annotation editing preferences.

Summary

Public Methods
abstract float getAlpha(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation alpha from preferences.
abstract float getAlpha(AnnotationTool annotationTool)
Gets last configured annotation alpha from preferences.
abstract String getAnnotationCreator()
Retrieve annotation creator from PSPDFKitPreferences.
abstract BorderStylePreset getBorderStylePreset(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation border preset from preferences.
abstract BorderStylePreset getBorderStylePreset(AnnotationTool annotationTool)
Gets last configured annotation border preset from preferences.
abstract int getColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Retrieve last configured color from preferences.
abstract int getColor(AnnotationTool annotationTool)
Retrieve last configured color from preferences.
abstract int getFillColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Retrieve last configured fill color from preferences.
abstract int getFillColor(AnnotationTool annotationTool)
Retrieve last configured fill color from preferences.
abstract FloatPrecision getFloatPrecision(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation precision from preferences.
abstract FloatPrecision getFloatPrecision(AnnotationTool annotationTool)
Gets last configured annotation precision from preferences.
abstract Font getFont(AnnotationTool annotationTool)
Gets last configured annotation font from preferences.
abstract Font getFont(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation font from preferences.
abstract Pair<LineEndTypeLineEndType> getLineEnds(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation line ends types from preferences.
abstract Pair<LineEndTypeLineEndType> getLineEnds(AnnotationTool annotationTool)
Gets last configured annotation line ends types from preferences.
abstract Scale getMeasurementScale(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation scale from preferences.
abstract Scale getMeasurementScale(AnnotationTool annotationTool)
Gets last configured annotation scale from preferences.
abstract String getNoteAnnotationIcon(AnnotationTool annotationTool)
Gets last configured annotation icon from preferences.
abstract String getNoteAnnotationIcon(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation icon from preferences.
abstract int getOutlineColor(AnnotationTool annotationTool)
Retrieve last configured outline color from preferences.
abstract int getOutlineColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Retrieve last configured outline color from preferences.
abstract String getOverlayText(AnnotationTool annotationTool)
Gets last configured overlay text from preferences.
abstract String getOverlayText(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured overlay text from preferences.
abstract boolean getRepeatOverlayText(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured repeat overlay text setting from preferences.
abstract boolean getRepeatOverlayText(AnnotationTool annotationTool)
Gets last configured repeat overlay text setting from preferences.
abstract float getTextSize(AnnotationTool annotationTool)
Gets last configured text size from preferences.
abstract float getTextSize(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured text size from preferences.
abstract float getThickness(AnnotationTool annotationTool, AnnotationToolVariant toolVariant)
Gets last configured annotation thickness from preferences.
abstract float getThickness(AnnotationTool annotationTool)
Gets last configured annotation thickness from preferences.
abstract boolean isAnnotationCreatorSet()
Checks if the annotation creator has been set.
abstract boolean isMeasurementSnappingEnabled()
Returns true if snapping to page graphics for measurement tools is enabled.
abstract void setAlpha(AnnotationTool annotationTool, float alpha)
Sets annotation alpha to preferences.
abstract void setAlpha(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float alpha)
Sets annotation alpha to preferences.
abstract void setBorderStylePreset(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, BorderStylePreset borderStylePreset)
Sets annotation border preset to preferences.
abstract void setBorderStylePreset(AnnotationTool annotationTool, BorderStylePreset borderStylePreset)
Sets annotation border preset to preferences.
abstract void setColor(AnnotationTool annotationTool, int color)
Sets annotation color to preferences.
abstract void setColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)
Sets annotation color to preferences.
abstract void setFillColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)
Sets annotation fill color to preferences.
abstract void setFillColor(AnnotationTool annotationTool, int color)
Sets annotation fill color to preferences.
abstract void setFloatPrecision(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, FloatPrecision precision)
Sets annotation precision to preferences.
abstract void setFloatPrecision(AnnotationTool annotationTool, FloatPrecision precision)
Sets annotation precision to preferences.
abstract void setFont(AnnotationTool annotationTool, Font font)
Sets annotation font to preferences.
abstract void setFont(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, Font font)
Sets annotation font to preferences.
abstract void setLineEnds(AnnotationTool annotationTool, LineEndType lineEnd1, LineEndType lineEnd2)
Sets line end types to preferences.
abstract void setLineEnds(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, LineEndType lineEnd1, LineEndType lineEnd2)
Sets line end types to preferences.
abstract void setMeasurementScale(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, Scale measurementScale)
Sets annotation scale to preferences.
abstract void setMeasurementScale(AnnotationTool annotationTool, Scale measurementScale)
Sets annotation scale to preferences.
abstract void setMeasurementSnappingEnabled(boolean enabled)
Enables snapping to page graphics for measurement tools.
abstract void setNoteAnnotationIcon(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, String iconName)
Sets annotation icon name to preferences.
abstract void setNoteAnnotationIcon(AnnotationTool annotationTool, String iconName)
Sets annotation icon name to preferences.
abstract void setOutlineColor(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)
Sets annotation outline color to preferences.
abstract void setOutlineColor(AnnotationTool annotationTool, int color)
Sets annotation outline color to preferences.
abstract void setOverlayText(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, String overlayText)
Sets the overlay text to preferences.
abstract void setOverlayText(AnnotationTool annotationTool, String overlayText)
Sets the overlay text to preferences.
abstract void setRepeatOverlayText(AnnotationTool annotationTool, boolean repeatOverlayText)
Sets the last configured repeat overlay text setting to preferences.
abstract void setRepeatOverlayText(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, boolean repeatOverlayText)
Sets the last configured repeat overlay text setting to preferences.
abstract void setTextSize(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float textSize)
Sets text size to preferences.
abstract void setTextSize(AnnotationTool annotationTool, float textSize)
Sets text size to preferences.
abstract void setThickness(AnnotationTool annotationTool, float thickness)
Sets annotation thickness to preferences.
abstract void setThickness(AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float thickness)
Sets annotation thickness to preferences.

Public Methods

public abstract float getAlpha (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation alpha from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation alpha or default alpha if not available.

public abstract float getAlpha (AnnotationTool annotationTool)

Gets last configured annotation alpha from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation alpha or default alpha if not available.

public abstract String getAnnotationCreator ()

Retrieve annotation creator from PSPDFKitPreferences.

Returns
  • Annotation creator if configured, null when not.

public abstract BorderStylePreset getBorderStylePreset (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation border preset from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation border preset or default if not available.

public abstract BorderStylePreset getBorderStylePreset (AnnotationTool annotationTool)

Gets last configured annotation border preset from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation border preset or default if not available.

public abstract int getColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Retrieve last configured color from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured color from preferences or default color if not available.

public abstract int getColor (AnnotationTool annotationTool)

Retrieve last configured color from preferences. Uses default tool variant.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured color from preferences or default color if not available.

public abstract int getFillColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Retrieve last configured fill color from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured fill color from preferences or default fill color if not available.

public abstract int getFillColor (AnnotationTool annotationTool)

Retrieve last configured fill color from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured fill color from preferences or default fill color if not available.

public abstract FloatPrecision getFloatPrecision (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation precision from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation precision or default precision if not available.

public abstract FloatPrecision getFloatPrecision (AnnotationTool annotationTool)

Gets last configured annotation precision from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation precision or default precision if not available.

public abstract Font getFont (AnnotationTool annotationTool)

Gets last configured annotation font from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation font or default annotation font if not available.

public abstract Font getFont (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation font from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation font or default annotation font if not available.

public abstract Pair<LineEndTypeLineEndType> getLineEnds (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation line ends types from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation line ends or default if not available.

public abstract Pair<LineEndTypeLineEndType> getLineEnds (AnnotationTool annotationTool)

Gets last configured annotation line ends types from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation line ends or default if not available.

public abstract Scale getMeasurementScale (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation scale from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation scale or default scale if not available.

public abstract Scale getMeasurementScale (AnnotationTool annotationTool)

Gets last configured annotation scale from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation scale or default scale if not available.

public abstract String getNoteAnnotationIcon (AnnotationTool annotationTool)

Gets last configured annotation icon from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation icon name or default if not available.

public abstract String getNoteAnnotationIcon (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation icon from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation icon name or default if not available.

public abstract int getOutlineColor (AnnotationTool annotationTool)

Retrieve last configured outline color from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured outline color from preferences or default outline color if not available.

public abstract int getOutlineColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Retrieve last configured outline color from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured outline color from preferences or default outline color if not available.

public abstract String getOverlayText (AnnotationTool annotationTool)

Gets last configured overlay text from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • The last configured overlay text or default overlay text if not available.

public abstract String getOverlayText (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured overlay text from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • The last configured overlay text or default overlay text if not available.

public abstract boolean getRepeatOverlayText (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured repeat overlay text setting from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • The last configured repeat overlay text setting.

public abstract boolean getRepeatOverlayText (AnnotationTool annotationTool)

Gets last configured repeat overlay text setting from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • The last configured repeat overlay text setting.

public abstract float getTextSize (AnnotationTool annotationTool)

Gets last configured text size from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured text size from preferences or default size if not available.

public abstract float getTextSize (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured text size from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured text size from preferences or default size if not available.

public abstract float getThickness (AnnotationTool annotationTool, AnnotationToolVariant toolVariant)

Gets last configured annotation thickness from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
Returns
  • Last configured annotation thickness or default thickness if not available.

public abstract float getThickness (AnnotationTool annotationTool)

Gets last configured annotation thickness from preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
Returns
  • Last configured annotation thickness or default thickness if not available.

public abstract boolean isAnnotationCreatorSet ()

Checks if the annotation creator has been set.

Returns
  • return false if the annotation creator has not been set, true otherwise.

public abstract boolean isMeasurementSnappingEnabled ()

Returns true if snapping to page graphics for measurement tools is enabled. This is a global setting and is not tied to any particular annotation.

Returns
  • true if snapping is enabled, false otherwise.

public abstract void setAlpha (AnnotationTool annotationTool, float alpha)

Sets annotation alpha to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
alpha Thickness in pt.

public abstract void setAlpha (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float alpha)

Sets annotation alpha to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
alpha Thickness in pt.

public abstract void setBorderStylePreset (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, BorderStylePreset borderStylePreset)

Sets annotation border preset to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
borderStylePreset Border style preset to set.

public abstract void setBorderStylePreset (AnnotationTool annotationTool, BorderStylePreset borderStylePreset)

Sets annotation border preset to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
borderStylePreset Border style preset to set.

public abstract void setColor (AnnotationTool annotationTool, int color)

Sets annotation color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
color Color to set.

public abstract void setColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)

Sets annotation color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
color Color to set.

public abstract void setFillColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)

Sets annotation fill color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
color Color to set.

public abstract void setFillColor (AnnotationTool annotationTool, int color)

Sets annotation fill color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
color Color to set.

public abstract void setFloatPrecision (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, FloatPrecision precision)

Sets annotation precision to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
precision Float value decimal place precision.

public abstract void setFloatPrecision (AnnotationTool annotationTool, FloatPrecision precision)

Sets annotation precision to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
precision Float value decimal place precision.

public abstract void setFont (AnnotationTool annotationTool, Font font)

Sets annotation font to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
font Font to set.

public abstract void setFont (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, Font font)

Sets annotation font to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
font Font to set.

public abstract void setLineEnds (AnnotationTool annotationTool, LineEndType lineEnd1, LineEndType lineEnd2)

Sets line end types to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
lineEnd1 LineEndType for start of the line.
lineEnd2 LineEndType for end of the line.

public abstract void setLineEnds (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, LineEndType lineEnd1, LineEndType lineEnd2)

Sets line end types to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
lineEnd1 LineEndType for start of the line.
lineEnd2 LineEndType for end of the line.

public abstract void setMeasurementScale (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, Scale measurementScale)

Sets annotation scale to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
measurementScale Scale object with values to set measurement scale.

public abstract void setMeasurementScale (AnnotationTool annotationTool, Scale measurementScale)

Sets annotation scale to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
measurementScale Scale object with values to set measurement scale.

public abstract void setMeasurementSnappingEnabled (boolean enabled)

Enables snapping to page graphics for measurement tools. This is a global setting and is not tied to any particular annotation.

Parameters
enabled true to enable measurement snapping, false to disable it.

public abstract void setNoteAnnotationIcon (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, String iconName)

Sets annotation icon name to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
iconName Name of the icon.

public abstract void setNoteAnnotationIcon (AnnotationTool annotationTool, String iconName)

Sets annotation icon name to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
iconName Name of the icon.

public abstract void setOutlineColor (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, int color)

Sets annotation outline color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
color Color to set.

public abstract void setOutlineColor (AnnotationTool annotationTool, int color)

Sets annotation outline color to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
color Color to set.

public abstract void setOverlayText (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, String overlayText)

Sets the overlay text to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
overlayText The overlay text to set.

public abstract void setOverlayText (AnnotationTool annotationTool, String overlayText)

Sets the overlay text to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
overlayText The overlay text to set.

public abstract void setRepeatOverlayText (AnnotationTool annotationTool, boolean repeatOverlayText)

Sets the last configured repeat overlay text setting to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
repeatOverlayText The repeat overlay text setting to set.

public abstract void setRepeatOverlayText (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, boolean repeatOverlayText)

Sets the last configured repeat overlay text setting to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
repeatOverlayText The repeat overlay text setting to set.

public abstract void setTextSize (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float textSize)

Sets text size to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
textSize Text size in pt.

public abstract void setTextSize (AnnotationTool annotationTool, float textSize)

Sets text size to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
textSize Text size in pt.

public abstract void setThickness (AnnotationTool annotationTool, float thickness)

Sets annotation thickness to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
thickness Thickness in pt.

public abstract void setThickness (AnnotationTool annotationTool, AnnotationToolVariant toolVariant, float thickness)

Sets annotation thickness to preferences.

Parameters
annotationTool Annotation tool for which we need the preferences.
toolVariant Variant of the annotation tool.
thickness Thickness in pt.