Package org.insa.graphs.gui.drawing
Class PlateCarreProjection
- java.lang.Object
-
- org.insa.graphs.gui.drawing.PlateCarreProjection
-
- All Implemented Interfaces:
Projection
public class PlateCarreProjection extends java.lang.Object implements Projection
-
-
Constructor Summary
Constructors Constructor Description PlateCarreProjection(GraphStatistics.BoundingBox boundingBox, int maxSize)Create a new PlateCarreProjection corresponding to the given BoundingBox and maxSize.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetImageHeight()doublegetImageWidth()intlatitudeToPixelY(float latitude)Project the given latitude on the image.intlongitudeToPixelX(float longitude)Project the given longitude on the image.floatpixelXToLongitude(double px)Retrieve the longitude associated to the given projected point.floatpixelYToLatitude(double py)Retrieve the latitude associated to the given projected point.
-
-
-
Constructor Detail
-
PlateCarreProjection
public PlateCarreProjection(GraphStatistics.BoundingBox boundingBox, int maxSize)
Create a new PlateCarreProjection corresponding to the given BoundingBox and maxSize.- Parameters:
boundingBox- Box for this projection.maxSize- Maximum size of any side (width / height) of the image to which this projection should draw.
-
-
Method Detail
-
getImageWidth
public double getImageWidth()
- Specified by:
getImageWidthin interfaceProjection- Returns:
- Image width for this projection to work properly.
-
getImageHeight
public double getImageHeight()
- Specified by:
getImageHeightin interfaceProjection- Returns:
- Image weight for this projection to work properly.
-
latitudeToPixelY
public int latitudeToPixelY(float latitude)
Description copied from interface:ProjectionProject the given latitude on the image.- Specified by:
latitudeToPixelYin interfaceProjection- Parameters:
latitude- Latitude to project.- Returns:
- Projected position of the latitude on the image.
-
longitudeToPixelX
public int longitudeToPixelX(float longitude)
Description copied from interface:ProjectionProject the given longitude on the image.- Specified by:
longitudeToPixelXin interfaceProjection- Parameters:
longitude- Longitude to project.- Returns:
- Projected position of the longitude on the image.
-
pixelYToLatitude
public float pixelYToLatitude(double py)
Description copied from interface:ProjectionRetrieve the latitude associated to the given projected point.- Specified by:
pixelYToLatitudein interfaceProjection- Parameters:
py- Projected y-position for which latitude should be retrieved.- Returns:
- The original latitude of the point.
-
pixelXToLongitude
public float pixelXToLongitude(double px)
Description copied from interface:ProjectionRetrieve the longitude associated to the given projected point.- Specified by:
pixelXToLongitudein interfaceProjection- Parameters:
px- Projected x-position for which longitude should be retrieved.- Returns:
- The original longitude of the point.
-
-