public class

MeasureUtils

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

Summary

Constants
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 String K_IT
public static String K_LineDimension
public static String K_Measure
public static String K_PolyLineDimension
public static String K_PolygonDimension
public static String K_area
public static String K_axis
public static String K_distance
public static String K_scale
public static int PRECISION_DEFAULT
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(String which)
static int getPrecision(int annotType, JSONObject jsonObject)
static String getPrecisionKey()
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 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 String K_IT

public static String K_LineDimension

public static String K_Measure

public static String K_PolyLineDimension

public static String K_PolygonDimension

public static String K_area

public static String K_axis

public static String K_distance

public static String K_scale

public static int PRECISION_DEFAULT

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 (String which)

public static int getPrecision (int annotType, JSONObject jsonObject)

public static String getPrecisionKey ()

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