public class

MeasureUtils

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.utils.MeasureUtils

Summary

Constants
String DISPLAY_DECIMAL
String DISPLAY_DEFAULT
String DISPLAY_FRACTION
String FEET_SYMBOL
String INCH_SYMBOL
String K_IT
String K_LineDimension
String K_Measure
String K_PolyLineDimension
String K_PolygonDimension
String K_RECT_AREA
String K_area
String K_axis
String K_distance
String K_scale
int PRECISION_DEFAULT
String PRECISION_FOUR
int PRECISION_FRACTION_DEFAULT
String PRECISION_FRACTION_FIVE
String PRECISION_FRACTION_FOUR
String PRECISION_FRACTION_ONE
String PRECISION_FRACTION_THREE
String PRECISION_FRACTION_TWO
int PRECISION_FRACTION_VALUE_FIVE
int PRECISION_FRACTION_VALUE_FOUR
int PRECISION_FRACTION_VALUE_ONE
int PRECISION_FRACTION_VALUE_THREE
int PRECISION_FRACTION_VALUE_TWO
int PRECISION_FRACTION_VALUE_ZERO
String PRECISION_FRACTION_ZERO
String PRECISION_ONE
String PRECISION_THREE
String PRECISION_TWO
int PRECISION_VALUE_FOUR
int PRECISION_VALUE_ONE
int PRECISION_VALUE_THREE
int PRECISION_VALUE_TWO
int PRECISION_VALUE_ZERO
String PRECISION_ZERO
String U_CM
String U_FT
String U_FT_IN_FRACTION
String U_IN
String U_KM
String U_M
String U_MI
String U_MM
String U_PT
String U_YD
Fields
public static final String TAG
Public Constructors
MeasureUtils()
Public Methods
static String addThousandsSymbol(String integerPart, String thousandsSymbol)
static RulerItem calibrate(Annot annot, RulerItem rulerItem, float userInput)
static double convertToUnit(double value, String originalUnit, String targetUnit)
static String getAnnotMeasureInfo(Annot annot)
static String getAreaKey()
static MeasureInfo getAxisInfo(JSONObject jsonObject)
static String getAxisKey()
static Map<String, Map<String, Double>> getConversionDictionary()
static String getDecimalSymbolKey()
static MeasureInfo getDefaultArea()
static MeasureInfo getDefaultAxisInfo()
static MeasureInfo getDefaultDistance()
static String getDefaultMeasureInfo()
static MeasureInfo getDefaultMeasureInfo(int annotType)
static String getDisplayKey()
static String getDistanceKey()
static String getFactorKey()
static Integer getFractionPrecision(int position)
static int getFractionPrecisionPosition(int precision)
static HashMap<String, Integer> getFractionPrecisions()
static MeasureInfo getFromJSON(String json)
static String getIT(Annot annot)
static double getLineLength(double pt1x, double pt1y, double pt2x, double pt2y)
static MeasureInfo getMeasureInfo(int annotType, JSONObject jsonObject)
static List<MeasureInfo> getMeasureInfoList(JSONArray measureArray)
static List<MeasureInfo> getMeasureInfoList(String measureArrayStr)
static List<MeasureInfo> getMeasureInfoList(int annotType, JSONObject jsonObject)
static JSONObject getMeasureJSON(int annotType, JSONObject jsonObject)
static String getMeasureKey(int annotType)
static String getMeasurementText(double value, List<MeasureInfo> numberFormats)
static String getMeasurementText(double value, MeasureInfo numberFormat)
static Integer getPrecision(int position)
static String getPrecisionKey()
static int getPrecisionPosition(int precision)
static HashMap<String, Integer> getPrecisions()
static RulerItem getRulerItemFromAnnot(Annot annot)
static RulerItem getScale(JSONObject jsonObject)
Converts FDF to RulerItem
static String getScaleKey()
static String getThousandSymbolKey()
static String getTypeKey()
static double getUnitConversion(String unit)
static Map<String, Double> getUnitConversion()
static String getUnitKey()
static String getUnitPositionKey()
static String getUnitPrefixKey()
static String getUnitSuffixKey()
static boolean isAreaMeasure(int annotType)
static boolean isDistanceMeasure(int annotType)
static String modifyLastUnitValue(double value, MeasureInfo numberFormat)
static void putMeasurementInfo(Annot annot, String json)
static String setScaleAndPrecision(int annotType, JSONObject inputMeasureObject, RulerItem rulerItem)
This method sets the scale and precision for an existing annotation The measurement information is from annotation's dict
static String toMeasureInfoJSON(MeasureInfo info)
static void updateMeasureInfo(JSONObject jsonObject, String key, MeasureInfo info)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DISPLAY_DECIMAL

Constant Value: "D"

public static final String DISPLAY_DEFAULT

Constant Value: "D"

public static final String DISPLAY_FRACTION

Constant Value: "F"

public static final String FEET_SYMBOL

Constant Value: "ft"

public static final String INCH_SYMBOL

Constant Value: "in"

public static final String K_IT

Constant Value: "IT"

public static final String K_LineDimension

Constant Value: "LineDimension"

public static final String K_Measure

Constant Value: "Measure"

public static final String K_PolyLineDimension

Constant Value: "PolyLineDimension"

public static final String K_PolygonDimension

Constant Value: "PolygonDimension"

public static final String K_RECT_AREA

Constant Value: "pdftron_rect_area"

public static final String K_area

Constant Value: "area"

public static final String K_axis

Constant Value: "axis"

public static final String K_distance

Constant Value: "distance"

public static final String K_scale

Constant Value: "scale"

public static final int PRECISION_DEFAULT

Constant Value: 100 (0x00000064)

public static final String PRECISION_FOUR

Constant Value: "0.0001"

public static final int PRECISION_FRACTION_DEFAULT

Constant Value: 32 (0x00000020)

public static final String PRECISION_FRACTION_FIVE

Constant Value: "1/64"

public static final String PRECISION_FRACTION_FOUR

Constant Value: "1/32"

public static final String PRECISION_FRACTION_ONE

Constant Value: "1/4"

public static final String PRECISION_FRACTION_THREE

Constant Value: "1/16"

public static final String PRECISION_FRACTION_TWO

Constant Value: "1/8"

public static final int PRECISION_FRACTION_VALUE_FIVE

Constant Value: 64 (0x00000040)

public static final int PRECISION_FRACTION_VALUE_FOUR

Constant Value: 32 (0x00000020)

public static final int PRECISION_FRACTION_VALUE_ONE

Constant Value: 4 (0x00000004)

public static final int PRECISION_FRACTION_VALUE_THREE

Constant Value: 16 (0x00000010)

public static final int PRECISION_FRACTION_VALUE_TWO

Constant Value: 8 (0x00000008)

public static final int PRECISION_FRACTION_VALUE_ZERO

Constant Value: 2 (0x00000002)

public static final String PRECISION_FRACTION_ZERO

Constant Value: "1/2"

public static final String PRECISION_ONE

Constant Value: "0.1"

public static final String PRECISION_THREE

Constant Value: "0.001"

public static final String PRECISION_TWO

Constant Value: "0.01"

public static final int PRECISION_VALUE_FOUR

Constant Value: 10000 (0x00002710)

public static final int PRECISION_VALUE_ONE

Constant Value: 10 (0x0000000a)

public static final int PRECISION_VALUE_THREE

Constant Value: 1000 (0x000003e8)

public static final int PRECISION_VALUE_TWO

Constant Value: 100 (0x00000064)

public static final int PRECISION_VALUE_ZERO

Constant Value: 1 (0x00000001)

public static final String PRECISION_ZERO

Constant Value: "1"

public static final String U_CM

Constant Value: "cm"

public static final String U_FT

Constant Value: "ft"

public static final String U_FT_IN_FRACTION

Constant Value: "ft-in"

public static final String U_IN

Constant Value: "in"

public static final String U_KM

Constant Value: "km"

public static final String U_M

Constant Value: "m"

public static final String U_MI

Constant Value: "mi"

public static final String U_MM

Constant Value: "mm"

public static final String U_PT

Constant Value: "pt"

public static final String U_YD

Constant Value: "yd"

Fields

public static final String TAG

Public Constructors

public MeasureUtils ()

Public Methods

public static String addThousandsSymbol (String integerPart, String thousandsSymbol)

public static RulerItem calibrate (Annot annot, RulerItem rulerItem, float userInput)

Throws
Exception

public static double convertToUnit (double value, String originalUnit, String targetUnit)

public static String getAnnotMeasureInfo (Annot annot)

Throws
Exception

public static String getAreaKey ()

public static MeasureInfo getAxisInfo (JSONObject jsonObject)

public static String getAxisKey ()

public static Map<String, Map<String, Double>> getConversionDictionary ()

public static String getDecimalSymbolKey ()

public static MeasureInfo getDefaultArea ()

public static MeasureInfo getDefaultAxisInfo ()

public static MeasureInfo getDefaultDistance ()

public static String getDefaultMeasureInfo ()

public static MeasureInfo getDefaultMeasureInfo (int annotType)

public static String getDisplayKey ()

public static String getDistanceKey ()

public static String getFactorKey ()

public static Integer getFractionPrecision (int position)

public static int getFractionPrecisionPosition (int precision)

public static HashMap<String, Integer> getFractionPrecisions ()

public static MeasureInfo getFromJSON (String json)

public static String getIT (Annot annot)

public static double getLineLength (double pt1x, double pt1y, double pt2x, double pt2y)

public static MeasureInfo getMeasureInfo (int annotType, JSONObject jsonObject)

public static List<MeasureInfo> getMeasureInfoList (JSONArray measureArray)

public static List<MeasureInfo> getMeasureInfoList (String measureArrayStr)

public static List<MeasureInfo> getMeasureInfoList (int annotType, JSONObject jsonObject)

public static JSONObject getMeasureJSON (int annotType, JSONObject jsonObject)

public static String getMeasureKey (int annotType)

public static String getMeasurementText (double value, List<MeasureInfo> numberFormats)

public static String getMeasurementText (double value, MeasureInfo numberFormat)

public static Integer getPrecision (int position)

public static String getPrecisionKey ()

public static int getPrecisionPosition (int precision)

public static HashMap<String, Integer> getPrecisions ()

public static RulerItem getRulerItemFromAnnot (Annot annot)

public static RulerItem getScale (JSONObject jsonObject)

Converts FDF to RulerItem

public static String getScaleKey ()

public static String getThousandSymbolKey ()

public static String getTypeKey ()

public static double getUnitConversion (String unit)

public static Map<String, Double> getUnitConversion ()

public static String getUnitKey ()

public static String getUnitPositionKey ()

public static String getUnitPrefixKey ()

public static String getUnitSuffixKey ()

public static boolean isAreaMeasure (int annotType)

public static boolean isDistanceMeasure (int annotType)

public static String modifyLastUnitValue (double value, MeasureInfo numberFormat)

public static void putMeasurementInfo (Annot annot, String json)

Throws
Exception

public static String setScaleAndPrecision (int annotType, JSONObject inputMeasureObject, RulerItem rulerItem)

This method sets the scale and precision for an existing annotation The measurement information is from annotation's dict

public static String toMeasureInfoJSON (MeasureInfo info)

public static void updateMeasureInfo (JSONObject jsonObject, String key, MeasureInfo info)

Throws
Exception