public class

ToolStyleConfig

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.config.ToolStyleConfig

Class Overview

A helper class for configuring style of annotation creator tools.

Summary

Fields
public static String KEY_PREF_PRESET_INDEX
Public Constructors
ToolStyleConfig()
Class constructor
Public Methods
void addAnnotPresetMap(int annotType, int attrRes)
Add Customized default style for annotation
void addDefaultStyleMap(int annotType, int styleRes)
Add Customized default style for annotation
AnnotStyle getAnnotPresetStyle(Context context, int annotType, int index)
Gets annotation preset style saved in settings
AnnotStyle getAnnotPresetStyle(Context context, int annotType, int index, String suffix)
Gets annotation preset style saved in settings
String getAnnotationPropertySettingsKey(int annotType, String extraTag, String mode)
Gets color key to put in settings
String getBorderStyleKey(int annotType, String extraTag)
String getColorKey(int annotType, String extraTag)
AnnotStyle getCustomAnnotStyle(Context context, int annotType, String extraTag)
Gets custom annotation style from settings
ShapeBorderStyle getCustomBorderStyleMode(Context context, int annotType, String extraTag)
Gets borderStyle mode saved in settings
int getCustomColor(Context context, int annotType, String extraTag)
Gets color saved in settings
String getCustomDateFormat(Context context, int annotType, String extraTag)
Gets date format saved in settings
Eraser.EraserType getCustomEraserType(Context context, int annotType, String extraTag)
Gets the eraser type saved in settings
int getCustomFillColor(Context context, int annotType, String extraTag)
Gets fill color saved in settings
String getCustomFontName(Context context, int annotType, String extraTag)
Gets font name saved in settings
int getCustomHorizontalAlignment(Context context, int annotType, String extraTag)
String getCustomIconName(Context context, int annotType, String extraTag)
Gets icon name saved in settings
Eraser.InkEraserMode getCustomInkEraserMode(Context context, int annotType, String extraTag)
Gets the ink eraser mode saved in settings
LineEndingStyle getCustomLineEndStyleMode(Context context, int annotType, String extraTag)
Gets lineEndStyle mode saved in settings
LineEndingStyle getCustomLineStartStyleMode(Context context, int annotType, String extraTag)
Gets lineStartStyle mode saved in settings
LineStyle getCustomLineStyleMode(Context context, int annotType, String extraTag)
Gets lineStyle mode saved in settings
float getCustomOpacity(Context context, int annotType, String extraTag)
Gets opacity saved in settings
boolean getCustomPressureSensitive(Context context, int annotType, String extraTag)
Gets the eraser type saved in settings
String getCustomRulerBaseUnit(Context context, int annotType, String extraTag)
Gets ruler base unit saved in settings
float getCustomRulerBaseValue(Context context, int annotType, String extraTag)
Gets ruler base value saved in settings
int getCustomRulerPrecision(Context context, int annotType, String extraTag)
Gets ruler translate unit saved in settings
String getCustomRulerTranslateUnit(Context context, int annotType, String extraTag)
Gets ruler translate unit saved in settings
float getCustomRulerTranslateValue(Context context, int annotType, String extraTag)
Gets ruler translate value saved in settings
int getCustomTextColor(Context context, int annotType, String extraTag)
Gets text color saved in settings
float getCustomTextSize(Context context, int annotType, String extraTag)
Gets text size saved in settings
float getCustomThickness(Context context, int annotType, String extraTag)
Gets thickness saved in settings
int getCustomVerticalAlignment(Context context, int annotType, String extraTag)
String getDateFormatKey(int annotType, String extraTag)
AnnotStyle getDefaultAnnotPresetStyle(Context context, int annotType, int index, int attrRes, int arrayRes)
Gets default annotation preset style defined in attribute, style, and array resource
AnnotStyle getDefaultAnnotStyle(Context context, int annotType)
Gets default annotation style defined in attrs
int getDefaultAttr(int annotType)
Gets default tool style
ShapeBorderStyle getDefaultBorderStyle(Context context, int annotType)
Gets default border style for the given annotation type.
ShapeBorderStyle getDefaultBorderStyle(Context context, int defAttrRes, int defStyleRes)
Gets default border style
int getDefaultColor(Context context, int annotType, String extraTag)
Gets default tool color
int getDefaultColor(Context context, int defStyleAttr, int defStyleRes)
Gets default tool color
int getDefaultColor(Context context, int annotType)
Gets default color
String getDefaultDateFormat(Context context, int defAttrRes, int defStyleRes)
Gets default date format
String getDefaultDateFormat(Context context, int annotType)
Gets default date format
Eraser.EraserType getDefaultEraserType()
int getDefaultFillColor(Context context, int annotType)
Gets default fill color
int getDefaultFillColor(Context context, int defAttrRes, int defStyleRes)
Gets default fill color
String getDefaultFont(Context context, int defAttrRes, int defStyleRes)
Gets default font
String getDefaultFont(Context context, int annotType)
Gets default font
int getDefaultHorizontalAlignment(Context context, int annotType)
Gets the horizontal text alignment
int getDefaultHorizontalAlignment(Context context, int defAttrRes, int defStyleRes)
Gets the horizontal text alignment
String getDefaultIcon(Context context, int annotType)
Gets default icon
String getDefaultIcon(Context context, int defAttrRes, int defStyleRes)
Gets default icon
LineEndingStyle getDefaultLineEndStyle(Context context, int annotType)
Gets default line end style for the given annotation type.
LineEndingStyle getDefaultLineEndStyle(Context context, int defAttrRes, int defStyleRes)
Gets default line end style
LineEndingStyle getDefaultLineStartStyle(Context context, int annotType)
Gets default line start style for the given annotation type.
LineEndingStyle getDefaultLineStartStyle(Context context, int defAttrRes, int defStyleRes)
Gets default line start style
LineStyle getDefaultLineStyle(Context context, int defAttrRes, int defStyleRes)
Gets default line style
LineStyle getDefaultLineStyle(Context context, int annotType)
Gets default line style for the given annotation type.
float getDefaultMaxTextSize(Context context, int defAttrRes, int defStyleRes)
Gets default maximum text size
float getDefaultMaxTextSize(Context context)
Gets default maximum text size
float getDefaultMaxThickness(Context context, int defAttrRes, int defStyleRes)
Gets default maximum thickness
float getDefaultMaxThickness(Context context, int annotType)
Gets default maximum thickness
float getDefaultMinTextSize(Context context)
Gets default minimum text size
float getDefaultMinTextSize(Context context, int defAttrRes, int defStyleRes)
Gets default minimum text size
float getDefaultMinThickness(Context context, int annotType)
Gets default minimum thickness
float getDefaultMinThickness(Context context, int defAttrRes, int defStyleRes)
Gets default minimum thickness
float getDefaultOpacity(Context context, int annotType)
Gets default opacity
float getDefaultOpacity(Context context, int defAttrRes, int defStyleRes)
Gets default opacity
int getDefaultPresetsArrayRes(int annotType)
Gets default tool style
boolean getDefaultPressureSensitivity(Context context, int annotType)
Gets whether freehand will use pressure sensitive calculation
boolean getDefaultPressureSensitivity(Context context, int defAttrRes, int defStyleRes)
Gets whether freehand will use pressure sensitive calculation
String getDefaultRulerBaseUnit(Context context, int defAttrRes, int defStyleRes)
Gets default ruler scale base unit
String getDefaultRulerBaseUnit(Context context, int annotType)
Gets default ruler scale base unit
float getDefaultRulerBaseValue(Context context, int defAttrRes, int defStyleRes)
Gets default ruler scale base value
float getDefaultRulerBaseValue(Context context, int annotType)
Gets default ruler scale base value
int getDefaultRulerPrecision(Context context, int defAttrRes, int defStyleRes)
Gets default ruler precision
int getDefaultRulerPrecision(Context context, int annotType)
Gets default ruler precision
String getDefaultRulerTranslateUnit(Context context, int annotType)
Gets default ruler scale base unit
String getDefaultRulerTranslateUnit(Context context, int defAttrRes, int defStyleRes)
Gets default ruler scale base unit
float getDefaultRulerTranslateValue(Context context, int annotType)
Gets default ruler scale translate value
float getDefaultRulerTranslateValue(Context context, int defAttrRes, int defStyleRes)
Gets default ruler scale translate value
int getDefaultStyle(int annotType)
Gets default tool style
int getDefaultTextColor(Context context, int attrRes, int defStyleRes)
Gets default text color
int getDefaultTextColor(Context context)
This method is deprecated. use getDefaultTextColor(Context, int) instead
int getDefaultTextColor(Context context, int annotType)
Gets default text color for the given annotation type.
float getDefaultTextSize(Context context, int defAttrRes, int defStyleRes)
Gets default font size
float getDefaultTextSize(Context context, int annotType)
Gets default font size for the given annotation type.
float getDefaultThickness(Context context, int annotType)
Gets default thickness
float getDefaultThickness(Context context, int defAttrRes, int defStyleRes)
Gets default thickness
float getDefaultThicknessRange(Context context, int defAttrRes, int defStyleRes)
Gets thickness range
float getDefaultThicknessRange(Context context, int annotType)
Gets thickness range
int getDefaultVerticalAlignment(Context context, int annotType)
Gets the vertical text alignment
int getDefaultVerticalAlignment(Context context, int defAttrRes, int defStyleRes)
Gets the vertical text alignment
String getEraserTypeKey(int annotType, String extraTag)
String getFillColorKey(int annotType, String extraTag)
String getFontKey(int annotType, String extraTag)
Set<String> getFreeTextFonts()
Gets the list of free text fonts to have as options in the properties popup (Gets whiteList fonts among the PDFNet system fonts)
Set<String> getFreeTextFontsFromAssets()
Gets custom font list from Assets for free text tool
Set<String> getFreeTextFontsFromStorage()
Gets custom font list from Storage for free text tool
String getHorizontalAlignmentKey(int annotType, String extraTag)
String getIconKey(int annotType, String extraTag)
ArrayList<String> getIconsList(Context context, int defAttrRes, int defArrayRes)
Gets icon list based on given attribute resource and default array resource
ArrayList<String> getIconsList(Context context)
Gets default icon list
String getInkEraserModeKey(int annotType, String extraTag)
static ToolStyleConfig getInstance()
int getLastSelectedPresetIndex(Context context, int toolbarItemType, String toolbarStyleId)
String getLineEndStyleKey(int annotType, String extraTag)
String getLineStartStyleKey(int annotType, String extraTag)
String getLineStyleKey(int annotType, String extraTag)
String getOpacityKey(int annotType, String extraTag)
int getPresetColor(Context context, int index, int attrRes, int arrayRes, int defaultStyleRes)
Gets preset color
int getPresetsAttr(int annotType)
Gets presets attr
String getPressureSensitiveKey(int annotType, String extraTag)
String getRulerBaseUnitKey(int annotType, String extraTag)
String getRulerBaseValueKey(int annotType, String extraTag)
String getRulerPrecisionKey(int annotType, String extraTag)
String getRulerTranslateUnitKey(int annotType, String extraTag)
String getRulerTranslateValueKey(int annotType, String extraTag)
String getTextColorKey(int annotType, String extraTag)
String getTextMarkupTypeKey(int annotType, String extraTag)
String getTextSizeKey(int annotType, String extraTag)
String getThicknessKey(int annotType, String extraTag)
String getVerticalAlignmentKey(int annotType, String extraTag)
int numberOfAnnotPresetStyles(Context context, int annotType)
Returns the number of presets defined in styles for given annot type
void saveAnnotStyle(Context context, AnnotStyle annotStyle, String extraTag)
Save annotation style to settings.
void setDefaultEraserType(Eraser.EraserType type)
void setFreeTextFonts(Set<String> freeTextFonts)
Sets list of free text fonts to have as options in the properties popup.
void setFreeTextFontsFromAssets(Set<String> fontNameList)
Sets custom font list from Assets for free text tool if sets font list from Assets, then it is not possible to set font list from storage The system fonts list won't load anymore
void setFreeTextFontsFromStorage(Set<String> fontPathList)
Sets custom font list from device storage for free text tool if font list from Assets is not set, then it's possible to set font list from storage The system fonts list won't load anymore
void setLastSelectedPresetIndex(Context context, int toolbarItemType, String toolbarStyleId, int index)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static String KEY_PREF_PRESET_INDEX

Public Constructors

public ToolStyleConfig ()

Class constructor

Public Methods

public void addAnnotPresetMap (int annotType, int attrRes)

Add Customized default style for annotation

Parameters
annotType annotation mode
attrRes preset attribute resource

public void addDefaultStyleMap (int annotType, int styleRes)

Add Customized default style for annotation

Parameters
annotType annotation mode
styleRes annotation style resource

public AnnotStyle getAnnotPresetStyle (Context context, int annotType, int index)

Gets annotation preset style saved in settings

Parameters
context The context
annotType annotation type
index index of the preset
Returns
  • annotation style

public AnnotStyle getAnnotPresetStyle (Context context, int annotType, int index, String suffix)

Gets annotation preset style saved in settings

Parameters
context The context
annotType annotation type
index index of the preset
suffix suffix string to uniquely identify this annot style
Returns
  • annotation style

public String getAnnotationPropertySettingsKey (int annotType, String extraTag, String mode)

Gets color key to put in settings

Parameters
annotType The annotation mode
extraTag extra tag
mode mode
Returns
  • key

public String getBorderStyleKey (int annotType, String extraTag)

public String getColorKey (int annotType, String extraTag)

public AnnotStyle getCustomAnnotStyle (Context context, int annotType, String extraTag)

Gets custom annotation style from settings

Parameters
context the context
annotType tool mode
Returns
  • annotation style

public ShapeBorderStyle getCustomBorderStyleMode (Context context, int annotType, String extraTag)

Gets borderStyle mode saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • BorderStyle saved in settings

public int getCustomColor (Context context, int annotType, String extraTag)

Gets color saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • color in settings

public String getCustomDateFormat (Context context, int annotType, String extraTag)

Gets date format saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • date format in settings

public Eraser.EraserType getCustomEraserType (Context context, int annotType, String extraTag)

Gets the eraser type saved in settings

Parameters
context the context
annotType annotation type
extraTag extra tag for settings
Returns
  • the eraser type saved in settings

public int getCustomFillColor (Context context, int annotType, String extraTag)

Gets fill color saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • fill color in settings

public String getCustomFontName (Context context, int annotType, String extraTag)

Gets font name saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • font name in settings

public int getCustomHorizontalAlignment (Context context, int annotType, String extraTag)

public String getCustomIconName (Context context, int annotType, String extraTag)

Gets icon name saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • icon name in settings

public Eraser.InkEraserMode getCustomInkEraserMode (Context context, int annotType, String extraTag)

Gets the ink eraser mode saved in settings

Parameters
context the context
annotType annotation type
extraTag extra tag for settings
Returns
  • the eraser type saved in settings

public LineEndingStyle getCustomLineEndStyleMode (Context context, int annotType, String extraTag)

Gets lineEndStyle mode saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • LineEndingStyle saved in settings

public LineEndingStyle getCustomLineStartStyleMode (Context context, int annotType, String extraTag)

Gets lineStartStyle mode saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • LineEndingStyle saved in settings

public LineStyle getCustomLineStyleMode (Context context, int annotType, String extraTag)

Gets lineStyle mode saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • LineStyle saved in settings

public float getCustomOpacity (Context context, int annotType, String extraTag)

Gets opacity saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • opacity in settings

public boolean getCustomPressureSensitive (Context context, int annotType, String extraTag)

Gets the eraser type saved in settings

Parameters
context the context
annotType annotation type
extraTag extra tag for settings
Returns
  • the eraser type saved in settings

public String getCustomRulerBaseUnit (Context context, int annotType, String extraTag)

Gets ruler base unit saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • ruler base unit in settings

public float getCustomRulerBaseValue (Context context, int annotType, String extraTag)

Gets ruler base value saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • ruler base value in settings

public int getCustomRulerPrecision (Context context, int annotType, String extraTag)

Gets ruler translate unit saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • ruler translate unit in settings

public String getCustomRulerTranslateUnit (Context context, int annotType, String extraTag)

Gets ruler translate unit saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • ruler translate unit in settings

public float getCustomRulerTranslateValue (Context context, int annotType, String extraTag)

Gets ruler translate value saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • ruler translate value in settings

public int getCustomTextColor (Context context, int annotType, String extraTag)

Gets text color saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • text color in settings

public float getCustomTextSize (Context context, int annotType, String extraTag)

Gets text size saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • text size in settings

public float getCustomThickness (Context context, int annotType, String extraTag)

Gets thickness saved in settings

Parameters
context The context
annotType annotation type
extraTag extra tag for settings
Returns
  • thickness in settings

public int getCustomVerticalAlignment (Context context, int annotType, String extraTag)

public String getDateFormatKey (int annotType, String extraTag)

public AnnotStyle getDefaultAnnotPresetStyle (Context context, int annotType, int index, int attrRes, int arrayRes)

Gets default annotation preset style defined in attribute, style, and array resource

Parameters
context The context
annotType annotation type
index index of annotation type
attrRes attribute resource for annotation preset
arrayRes array resource for defining presets of annotation style
Returns
  • annotation style of preset

public AnnotStyle getDefaultAnnotStyle (Context context, int annotType)

Gets default annotation style defined in attrs

Parameters
context the context
annotType tool mode
Returns
  • annotation style

public int getDefaultAttr (int annotType)

Gets default tool style

Parameters
annotType annotation tool mode
Returns
  • style resource

public ShapeBorderStyle getDefaultBorderStyle (Context context, int annotType)

Gets default border style for the given annotation type.

Parameters
context The context
annotType The annotation type
Returns
  • default border style

public ShapeBorderStyle getDefaultBorderStyle (Context context, int defAttrRes, int defStyleRes)

Gets default border style

Parameters
context The context
Returns
  • default border style

public int getDefaultColor (Context context, int annotType, String extraTag)

Gets default tool color

Parameters
context The context
annotType annotation tool mode
extraTag extra tag
Returns
  • color

public int getDefaultColor (Context context, int defStyleAttr, int defStyleRes)

Gets default tool color

Parameters
context The context
Returns
  • color

public int getDefaultColor (Context context, int annotType)

Gets default color

Parameters
context The context
annotType annotation tool mode
Returns
  • color

public String getDefaultDateFormat (Context context, int defAttrRes, int defStyleRes)

Gets default date format

Parameters
context The context
Returns
  • default date format

public String getDefaultDateFormat (Context context, int annotType)

Gets default date format

Parameters
context The context
annotType annotation tool mode
Returns
  • default date format

public Eraser.EraserType getDefaultEraserType ()

public int getDefaultFillColor (Context context, int annotType)

Gets default fill color

Parameters
context The context
annotType The annotation type
Returns
  • default fill color

public int getDefaultFillColor (Context context, int defAttrRes, int defStyleRes)

Gets default fill color

Parameters
context context
Returns
  • default fill color

public String getDefaultFont (Context context, int defAttrRes, int defStyleRes)

Gets default font

Parameters
context context
Returns
  • default font

public String getDefaultFont (Context context, int annotType)

Gets default font

Parameters
context context
annotType annotation tool mode
Returns
  • default font

public int getDefaultHorizontalAlignment (Context context, int annotType)

Gets the horizontal text alignment

Parameters
context the context
annotType annotation tool mode
Returns
  • the horizontal text alignment

public int getDefaultHorizontalAlignment (Context context, int defAttrRes, int defStyleRes)

Gets the horizontal text alignment

Parameters
context the context
Returns
  • the horizontal text alignment

public String getDefaultIcon (Context context, int annotType)

Gets default icon

Parameters
context context
annotType annotation tool mode
Returns
  • default icon

public String getDefaultIcon (Context context, int defAttrRes, int defStyleRes)

Gets default icon

Parameters
context context
Returns
  • default icon

public LineEndingStyle getDefaultLineEndStyle (Context context, int annotType)

Gets default line end style for the given annotation type.

Parameters
context The context
annotType The annotation type
Returns
  • default line end style

public LineEndingStyle getDefaultLineEndStyle (Context context, int defAttrRes, int defStyleRes)

Gets default line end style

Parameters
context The context
Returns
  • default line end style

public LineEndingStyle getDefaultLineStartStyle (Context context, int annotType)

Gets default line start style for the given annotation type.

Parameters
context The context
annotType The annotation type
Returns
  • default line start style

public LineEndingStyle getDefaultLineStartStyle (Context context, int defAttrRes, int defStyleRes)

Gets default line start style

Parameters
context The context
Returns
  • default line start style

public LineStyle getDefaultLineStyle (Context context, int defAttrRes, int defStyleRes)

Gets default line style

Parameters
context The context
Returns
  • default line style

public LineStyle getDefaultLineStyle (Context context, int annotType)

Gets default line style for the given annotation type.

Parameters
context The context
annotType The annotation type
Returns
  • default line style

public float getDefaultMaxTextSize (Context context, int defAttrRes, int defStyleRes)

Gets default maximum text size

Parameters
context context
Returns
  • maximum text size

public float getDefaultMaxTextSize (Context context)

Gets default maximum text size

Parameters
context context
Returns
  • maximum text size

public float getDefaultMaxThickness (Context context, int defAttrRes, int defStyleRes)

Gets default maximum thickness

Parameters
context context
Returns
  • maximum thickness

public float getDefaultMaxThickness (Context context, int annotType)

Gets default maximum thickness

Parameters
context context
annotType The annotation type
Returns
  • maximum thickness

public float getDefaultMinTextSize (Context context)

Gets default minimum text size

Parameters
context context
Returns
  • minimum text size

public float getDefaultMinTextSize (Context context, int defAttrRes, int defStyleRes)

Gets default minimum text size

Parameters
context context
Returns
  • minimum text size

public float getDefaultMinThickness (Context context, int annotType)

Gets default minimum thickness

Parameters
context context
annotType annotation tool mode
Returns
  • minimum thickness

public float getDefaultMinThickness (Context context, int defAttrRes, int defStyleRes)

Gets default minimum thickness

Parameters
context context
Returns
  • minimum thickness

public float getDefaultOpacity (Context context, int annotType)

Gets default opacity

Parameters
context context
annotType annotation tool mode
Returns
  • default opacity

public float getDefaultOpacity (Context context, int defAttrRes, int defStyleRes)

Gets default opacity

Parameters
context context
Returns
  • default opacity

public int getDefaultPresetsArrayRes (int annotType)

Gets default tool style

Parameters
annotType annotation tool mode
Returns
  • style resource

public boolean getDefaultPressureSensitivity (Context context, int annotType)

Gets whether freehand will use pressure sensitive calculation

Parameters
context context
Returns
  • default pressure sensitive option

public boolean getDefaultPressureSensitivity (Context context, int defAttrRes, int defStyleRes)

Gets whether freehand will use pressure sensitive calculation

Parameters
context context
Returns
  • default pressure sensitive option

public String getDefaultRulerBaseUnit (Context context, int defAttrRes, int defStyleRes)

Gets default ruler scale base unit

Parameters
context The context
Returns
  • default unit

public String getDefaultRulerBaseUnit (Context context, int annotType)

Gets default ruler scale base unit

Parameters
context The context
annotType annotation tool mode
Returns
  • default unit

public float getDefaultRulerBaseValue (Context context, int defAttrRes, int defStyleRes)

Gets default ruler scale base value

Parameters
context The context
Returns
  • default value

public float getDefaultRulerBaseValue (Context context, int annotType)

Gets default ruler scale base value

Parameters
context The context
annotType annotation tool mode
Returns
  • default value

public int getDefaultRulerPrecision (Context context, int defAttrRes, int defStyleRes)

Gets default ruler precision

Parameters
context The context
Returns
  • default value

public int getDefaultRulerPrecision (Context context, int annotType)

Gets default ruler precision

Parameters
context The context
annotType annotation tool mode
Returns
  • default value

public String getDefaultRulerTranslateUnit (Context context, int annotType)

Gets default ruler scale base unit

Parameters
context The context
annotType annotation tool mode
Returns
  • default unit

public String getDefaultRulerTranslateUnit (Context context, int defAttrRes, int defStyleRes)

Gets default ruler scale base unit

Parameters
context The context
Returns
  • default unit

public float getDefaultRulerTranslateValue (Context context, int annotType)

Gets default ruler scale translate value

Parameters
context The context
annotType annotation tool mode
Returns
  • default value

public float getDefaultRulerTranslateValue (Context context, int defAttrRes, int defStyleRes)

Gets default ruler scale translate value

Parameters
context The context
Returns
  • default value

public int getDefaultStyle (int annotType)

Gets default tool style

Parameters
annotType annotation tool mode
Returns
  • style resource

public int getDefaultTextColor (Context context, int attrRes, int defStyleRes)

Gets default text color

Parameters
context the context
attrRes attribute resource
defStyleRes default style resource
Returns
  • color

public int getDefaultTextColor (Context context)

This method is deprecated.
use getDefaultTextColor(Context, int) instead

Gets default text color

Parameters
context the context
Returns
  • color

public int getDefaultTextColor (Context context, int annotType)

Gets default text color for the given annotation type.

Parameters
context the context
annotType the annotation type
Returns
  • color

public float getDefaultTextSize (Context context, int defAttrRes, int defStyleRes)

Gets default font size

Parameters
context The context
Returns
  • default font size

public float getDefaultTextSize (Context context, int annotType)

Gets default font size for the given annotation type.

Parameters
context The context
annotType The annotation type
Returns
  • default font size

public float getDefaultThickness (Context context, int annotType)

Gets default thickness

Parameters
context The context
annotType annotation tool mode
Returns
  • default thickness

public float getDefaultThickness (Context context, int defAttrRes, int defStyleRes)

Gets default thickness

Parameters
context The context
Returns
  • default thickness

public float getDefaultThicknessRange (Context context, int defAttrRes, int defStyleRes)

Gets thickness range

Parameters
context context
Returns
  • thickness range

public float getDefaultThicknessRange (Context context, int annotType)

Gets thickness range

Parameters
context context
annotType annotation tool mode
Returns
  • thickness range

public int getDefaultVerticalAlignment (Context context, int annotType)

Gets the vertical text alignment

Parameters
context the context
annotType annotation tool mode
Returns
  • the vertical text alignment

public int getDefaultVerticalAlignment (Context context, int defAttrRes, int defStyleRes)

Gets the vertical text alignment

Parameters
context the context
Returns
  • the vertical text alignment

public String getEraserTypeKey (int annotType, String extraTag)

public String getFillColorKey (int annotType, String extraTag)

public String getFontKey (int annotType, String extraTag)

public Set<String> getFreeTextFonts ()

Gets the list of free text fonts to have as options in the properties popup (Gets whiteList fonts among the PDFNet system fonts)

public Set<String> getFreeTextFontsFromAssets ()

Gets custom font list from Assets for free text tool

public Set<String> getFreeTextFontsFromStorage ()

Gets custom font list from Storage for free text tool

public String getHorizontalAlignmentKey (int annotType, String extraTag)

public String getIconKey (int annotType, String extraTag)

public ArrayList<String> getIconsList (Context context, int defAttrRes, int defArrayRes)

Gets icon list based on given attribute resource and default array resource

Parameters
context The context
defAttrRes attribute resource
defArrayRes array resource
Returns
  • list of icon names

public ArrayList<String> getIconsList (Context context)

Gets default icon list

Parameters
context The context
Returns
  • list of icon names

public String getInkEraserModeKey (int annotType, String extraTag)

public static ToolStyleConfig getInstance ()

Returns
  • instance of ToolStyleConfig

public int getLastSelectedPresetIndex (Context context, int toolbarItemType, String toolbarStyleId)

public String getLineEndStyleKey (int annotType, String extraTag)

public String getLineStartStyleKey (int annotType, String extraTag)

public String getLineStyleKey (int annotType, String extraTag)

public String getOpacityKey (int annotType, String extraTag)

public int getPresetColor (Context context, int index, int attrRes, int arrayRes, int defaultStyleRes)

Gets preset color

Parameters
context the context
index index of presets
attrRes preset attribute resource, get default attr:getPresetsAttr(int)
arrayRes array resource, get default array resource: getDefaultPresetsArrayRes(int)
defaultStyleRes default style resource, get default style resource: getDefaultStyle(int)
Returns
  • preset color

public int getPresetsAttr (int annotType)

Gets presets attr

Parameters
annotType annotation tool mode
Returns
  • attribute resource

public String getPressureSensitiveKey (int annotType, String extraTag)

public String getRulerBaseUnitKey (int annotType, String extraTag)

public String getRulerBaseValueKey (int annotType, String extraTag)

public String getRulerPrecisionKey (int annotType, String extraTag)

public String getRulerTranslateUnitKey (int annotType, String extraTag)

public String getRulerTranslateValueKey (int annotType, String extraTag)

public String getTextColorKey (int annotType, String extraTag)

public String getTextMarkupTypeKey (int annotType, String extraTag)

public String getTextSizeKey (int annotType, String extraTag)

public String getThicknessKey (int annotType, String extraTag)

public String getVerticalAlignmentKey (int annotType, String extraTag)

public int numberOfAnnotPresetStyles (Context context, int annotType)

Returns the number of presets defined in styles for given annot type

Parameters
context the context to obtain preset from style attributes
annotType the annot type of preset
Returns
  • Returns the number of presets for given annot type

public void saveAnnotStyle (Context context, AnnotStyle annotStyle, String extraTag)

Save annotation style to settings. The saved annotation style can be retrieved by getCustomAnnotStyle(Context, int, String)

Parameters
context The context
annotStyle annotation style
extraTag extra tag for settings

public void setDefaultEraserType (Eraser.EraserType type)

public void setFreeTextFonts (Set<String> freeTextFonts)

Sets list of free text fonts to have as options in the properties popup. (Sets whiteList fonts among the PDFNet system fonts)

public void setFreeTextFontsFromAssets (Set<String> fontNameList)

Sets custom font list from Assets for free text tool if sets font list from Assets, then it is not possible to set font list from storage The system fonts list won't load anymore

Parameters
fontNameList array of custom font's absolute path from Assets

public void setFreeTextFontsFromStorage (Set<String> fontPathList)

Sets custom font list from device storage for free text tool if font list from Assets is not set, then it's possible to set font list from storage The system fonts list won't load anymore

Parameters
fontPathList array of custom font's absolute path from device storage

public void setLastSelectedPresetIndex (Context context, int toolbarItemType, String toolbarStyleId, int index)