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

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
String getAnnotationPropertySettingsKey(int annotType, String extraTag, String mode)
Gets color key to put in settings
String getColorKey(int annotType, String extraTag)
AnnotStyle getCustomAnnotStyle(Context context, int annotType, String extraTag)
Gets custom annotation style from 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
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
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
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
int getDefaultColor(Context context, int defStyleAttr, int defStyleRes)
Gets default tool color
int getDefaultColor(Context context, int annotType, String extraTag)
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
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 annotType)
Gets default font
String getDefaultFont(Context context, int defAttrRes, int defStyleRes)
Gets default font
String getDefaultIcon(Context context, int defAttrRes, int defStyleRes)
Gets default icon
String getDefaultIcon(Context context, int annotType)
Gets default icon
float getDefaultMaxTextSize(Context context)
Gets default maximum text size
float getDefaultMaxTextSize(Context context, int defAttrRes, int defStyleRes)
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 defAttrRes, int defStyleRes)
Gets default minimum thickness
float getDefaultMinThickness(Context context, int annotType)
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 annotType)
Gets default ruler scale base unit
String getDefaultRulerBaseUnit(Context context, int defAttrRes, int defStyleRes)
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 annotType)
Gets default ruler precision
int getDefaultRulerPrecision(Context context, int defAttrRes, int defStyleRes)
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 defAttrRes, int defStyleRes)
Gets default ruler scale translate value
float getDefaultRulerTranslateValue(Context context, int annotType)
Gets default ruler scale translate value
int getDefaultStyle(int annotType)
Gets default tool style
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.
int getDefaultTextColor(Context context, int attrRes, int defStyleRes)
Gets default text color
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 defAttrRes, int defStyleRes)
Gets default thickness
float getDefaultThickness(Context context, int annotType)
Gets default thickness
float getDefaultThicknessRange(Context context, int defAttrRes, int defStyleRes)
Gets thickness range
float getDefaultThicknessRange(Context context, int annotType)
Gets thickness range
String getEraserTypeKey(int annotType, String extraTag)
String getFillColorKey(int annotType, String extraTag)
String getFontKey(int annotType, String extraTag)
String getIconKey(int annotType, String extraTag)
ArrayList<String> getIconsList(Context context)
Gets default icon list
ArrayList<String> getIconsList(Context context, int defAttrRes, int defArrayRes)
Gets icon list based on given attribute resource and default array resource
String getInkEraserModeKey(int annotType, String extraTag)
static ToolStyleConfig getInstance()
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 getTextSizeKey(int annotType, String extraTag)
String getThicknessKey(int annotType, String extraTag)
void saveAnnotStyle(Context context, AnnotStyle annotStyle, String extraTag)
Save annotation style to settings.
[Expand]
Inherited Methods
From class java.lang.Object

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 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 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 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 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 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 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 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, 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 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 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 annotType)

Gets default font

Parameters
context context
annotType annotation tool mode
Returns
  • default font

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

Gets default font

Parameters
context context
Returns
  • default font

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

Gets default icon

Parameters
context context
Returns
  • default icon

public String getDefaultIcon (Context context, int annotType)

Gets default icon

Parameters
context context
annotType annotation tool mode
Returns
  • default icon

public float getDefaultMaxTextSize (Context context)

Gets default maximum text size

Parameters
context context
Returns
  • maximum text size

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

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 defAttrRes, int defStyleRes)

Gets default minimum thickness

Parameters
context context
Returns
  • minimum thickness

public float getDefaultMinThickness (Context context, int annotType)

Gets default minimum thickness

Parameters
context context
annotType annotation tool mode
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 annotType)

Gets default ruler scale base unit

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

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

Gets default ruler scale base unit

Parameters
context The context
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 annotType)

Gets default ruler precision

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 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 defAttrRes, int defStyleRes)

Gets default ruler scale translate value

Parameters
context The context
Returns
  • default value

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 int getDefaultStyle (int annotType)

Gets default tool style

Parameters
annotType annotation tool mode
Returns
  • style resource

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 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 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 defAttrRes, int defStyleRes)

Gets default thickness

Parameters
context The context
Returns
  • default thickness

public float getDefaultThickness (Context context, int annotType)

Gets default thickness

Parameters
context The context
annotType annotation tool mode
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 String getEraserTypeKey (int annotType, String extraTag)

public String getFillColorKey (int annotType, String extraTag)

public String getFontKey (int annotType, String extraTag)

public String getIconKey (int annotType, String extraTag)

public ArrayList<String> getIconsList (Context context)

Gets default icon list

Parameters
context The context
Returns
  • list of icon names

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 String getInkEraserModeKey (int annotType, String extraTag)

public static ToolStyleConfig getInstance ()

Returns
  • instance of ToolStyleConfig

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 getTextSizeKey (int annotType, String extraTag)

public String getThicknessKey (int annotType, String extraTag)

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