Class LatitudeLongitudeTranslator
- java.lang.Object
-
- org.optaplanner.examples.common.swingui.latitudelongitude.LatitudeLongitudeTranslator
-
public class LatitudeLongitudeTranslator extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static double
MARGIN_RATIO
-
Constructor Summary
Constructors Constructor Description LatitudeLongitudeTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCoordinates(double latitude, double longitude)
void
drawRoute(Graphics2D g, double lon1, double lat1, double lon2, double lat2, boolean straight, boolean dashed)
void
drawSquare(Graphics2D g, double lon, double lat, int diameter)
void
drawSquare(Graphics2D g, double lon, double lat, int diameter, String label)
int
getImageHeight()
int
getImageWidth()
void
prepareFor(double width, double height)
int
translateLatitudeToY(double latitude)
int
translateLongitudeToX(double longitude)
double
translateXToLongitude(int x)
double
translateYToLatitude(double y)
-
-
-
Field Detail
-
MARGIN_RATIO
public static final double MARGIN_RATIO
- See Also:
- Constant Field Values
-
-
Method Detail
-
addCoordinates
public void addCoordinates(double latitude, double longitude)
-
prepareFor
public void prepareFor(double width, double height)
-
translateLongitudeToX
public int translateLongitudeToX(double longitude)
-
translateLatitudeToY
public int translateLatitudeToY(double latitude)
-
translateXToLongitude
public double translateXToLongitude(int x)
-
translateYToLatitude
public double translateYToLatitude(double y)
-
getImageWidth
public int getImageWidth()
-
getImageHeight
public int getImageHeight()
-
drawSquare
public void drawSquare(Graphics2D g, double lon, double lat, int diameter)
-
drawSquare
public void drawSquare(Graphics2D g, double lon, double lat, int diameter, String label)
-
drawRoute
public void drawRoute(Graphics2D g, double lon1, double lat1, double lon2, double lat2, boolean straight, boolean dashed)
-
-