|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kaboum.util.KaboumPrecisionModel
public class KaboumPrecisionModel
This class manage the map units and the precision Model Some parts of this code are rewritten from JTS PrecisionModel class (cf. http://www.vividsolutions.com)
Field Summary | |
---|---|
int |
DPI
Dots per inch = 72 |
double |
magicalNumber
This is used to computed scale |
static int |
MS_ARE
|
static int |
MS_DD
|
static int |
MS_HECTARE
|
static int |
MS_KILOMETERS
|
static int |
MS_METERS
Constants definition |
static int |
MS_SQUARE_METERS
Surface definition |
double |
scale
Precision scale |
java.lang.String |
sUnit
|
java.lang.String |
xStrUnit
Used to create the formated text output |
java.lang.String |
yStrUnit
|
Constructor Summary | |
---|---|
KaboumPrecisionModel()
Constructor |
|
KaboumPrecisionModel(int unitType,
float precision)
Constructor |
|
KaboumPrecisionModel(int unitType,
float precision,
int surfaceType,
float surfacePrecision)
Constructor |
Method Summary | |
---|---|
java.lang.String |
getArea(double area)
Return a string representation of an area expressed in internals coordinates |
double |
getDistance(KaboumCoordinate coordA,
KaboumCoordinate coordB)
Return the distance between two point in meters. |
double |
getMagicalNumber()
Get the magicalNumber |
java.lang.String |
getNumberFormated(double number)
Return a formated output from an input number |
java.lang.String |
getPerimeter(double perimeter)
Return a string representation of a perimeter expressed in internals coordinates |
static double |
makePrecise(double val)
Return an integered value of val |
static int |
sToSurface(java.lang.String str)
Convert an input string to the corresponding int value |
static int |
sToUnit(java.lang.String str)
Convert an input string to the corresponding int value |
KaboumCoordinate |
toExternal(double xInternal,
double yInternal)
Sets external to the external representation of internal |
KaboumCoordinate |
toExternal(KaboumCoordinate internal)
Sets external to the external representation of internal |
KaboumCoordinate |
toInternal(double xExternal,
double yExternal)
Sets internal to the precise representation of external |
KaboumCoordinate |
toInternal(KaboumCoordinate external)
Sets internal to the precise representation of external |
java.lang.String |
writeMapCoords(KaboumCoordinate internal)
Return the formated output of the pointer in map coordinate assuming the current unit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MS_METERS
public static final int MS_KILOMETERS
public static final int MS_DD
public static final int MS_SQUARE_METERS
public static final int MS_ARE
public static final int MS_HECTARE
public double scale
public final int DPI
public double magicalNumber
public java.lang.String xStrUnit
public java.lang.String yStrUnit
public java.lang.String sUnit
Constructor Detail |
---|
public KaboumPrecisionModel()
public KaboumPrecisionModel(int unitType, float precision)
public KaboumPrecisionModel(int unitType, float precision, int surfaceType, float surfacePrecision)
Method Detail |
---|
public java.lang.String writeMapCoords(KaboumCoordinate internal)
external
- Coordinate (in internal representation)public static double makePrecise(double val)
public KaboumCoordinate toInternal(double xExternal, double yExternal)
internal
to the precise representation of external
x
- External representation of x coordinatey
- External representation of x coordinatepublic KaboumCoordinate toExternal(double xInternal, double yInternal)
external
to the external representation of internal
x
- Internal representation of x coordinatey
- Internal representation of x coordinatepublic KaboumCoordinate toInternal(KaboumCoordinate external)
internal
to the precise representation of external
external
- the original coordinatepublic KaboumCoordinate toExternal(KaboumCoordinate internal)
external
to the external representation of internal
internal
- the original coordinatepublic static int sToUnit(java.lang.String str)
public static int sToSurface(java.lang.String str)
public double getDistance(KaboumCoordinate coordA, KaboumCoordinate coordB)
coordA
- Coordinate A (internal representation)coordB
- Coordinate B (internal representation)public double getMagicalNumber()
public java.lang.String getNumberFormated(double number)
public java.lang.String getArea(double area)
public java.lang.String getPerimeter(double perimeter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |