public class

MeasureUtils

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

Summary

Constants
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
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_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 value, String thousandsSymbol)
static RulerItem calibrate(Annot annot, RulerItem rulerItem, float userInput)
static String getAnnotMeasureInfo(Annot annot)
static String getAreaKey()
static MeasureInfo getAxisInfo(JSONObject jsonObject)
static String getAxisKey()
static String getDecimalSymbolKey()
static String getDefaultMeasureInfo()
static String getDisplayKey()
static String getDistanceKey()
static String getFactorKey()
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 JSONObject getMeasureJSON(int annotType, JSONObject jsonObject)
static String getMeasureKey(int annotType)
static String getMeasurementText(double value, MeasureInfo numberFormat)
static int getPrecision(int annotType, JSONObject jsonObject)
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 HashMap<String, Double> getUnitConversion()
static double getUnitConversion(String unit)
static String getUnitKey()
static String getUnitPositionKey()
static String getUnitPrefixKey()
static String getUnitSuffixKey()
static String modifyLastUnitValue(double value, MeasureInfo numberFormat)
static void putMeasurementInfo(Annot annot, String json)
static int safeGetInt(JSONObject json, String key, int defaultValue)
static JSONObject safeGetJSON(JSONObject json, String key)
static String safeGetString(JSONObject json, String key)
static String setScaleAndPrecision(int annotType, JSONObject jsonObject, RulerItem rulerItem)
static void updateMeasureInfo(JSONObject jsonObject, String key, MeasureInfo info)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

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 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_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 value, String thousandsSymbol)

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

Throws
Exception

public static String getAnnotMeasureInfo (Annot annot)

Throws
Exception

public static String getAreaKey ()

public static MeasureInfo getAxisInfo (JSONObject jsonObject)

public static String getAxisKey ()

public static String getDecimalSymbolKey ()

public static String getDefaultMeasureInfo ()

public static String getDisplayKey ()

public static String getDistanceKey ()

public static String getFactorKey ()

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 JSONObject getMeasureJSON (int annotType, JSONObject jsonObject)

public static String getMeasureKey (int annotType)

public static String getMeasurementText (double value, MeasureInfo numberFormat)

public static int getPrecision (int annotType, JSONObject jsonObject)

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 HashMap<String, Double> getUnitConversion ()

public static double getUnitConversion (String unit)

public static String getUnitKey ()

public static String getUnitPositionKey ()

public static String getUnitPrefixKey ()

public static String getUnitSuffixKey ()

public static String modifyLastUnitValue (double value, MeasureInfo numberFormat)

public static void putMeasurementInfo (Annot annot, String json)

Throws
Exception

public static int safeGetInt (JSONObject json, String key, int defaultValue)

public static JSONObject safeGetJSON (JSONObject json, String key)

public static String safeGetString (JSONObject json, String key)

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

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

Throws
Exception