|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjme3tools.navigation.MapModel2D
public class MapModel2D
A representation of the actual map in terms of lat/long and x,y co-ordinates. The Map class contains various helper methods such as methods for determining the pixel positions for lat/long co-ordinates and vice versa.
フィールドの概要 | |
---|---|
static int |
DEFAULT_MAP_WIDTH_LONGITUDE
|
コンストラクタの概要 | |
---|---|
MapModel2D(int viewportWidth)
Constructor |
メソッドの概要 | |
---|---|
void |
calculateMinutesPerPixel(double mapWidthInLongitude)
Calculates the number of minutes per pixels using a given map width in longitude |
Position |
getCentre()
Returns the Position centre of the map |
double |
getMetersPerPixel()
|
double |
getMinutesPerPixel()
Returns the number of minutes there are per pixel |
java.awt.Point |
getPixelCentre()
Returns the pixel (x,y) centre of the map |
int |
getViewportPixelHeight()
Returns the height of the viewport in pixels |
int |
getViewportPixelWidth()
Returns the width of the viewport in pixels |
void |
setCentre(java.awt.Point p)
Defines the centre of the map in pixels |
void |
setCentre(Position centre)
|
void |
setMinutesPerPixel(double minutesPerPixel)
|
void |
setViewportHeight(int viewportHeight)
|
void |
setViewportWidth(int viewportWidth)
|
void |
setXCentre(int xCentre)
Sets the map's xCentre |
void |
setYCentre(int yCentre)
Sets the map's yCentre |
java.awt.Point |
toPixel(Position position)
Converts a latitude/longitude position into a pixel co-ordinate |
Position |
toPosition(java.awt.Point p)
Converts a pixel position into a mercator position |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final int DEFAULT_MAP_WIDTH_LONGITUDE
コンストラクタの詳細 |
---|
public MapModel2D(int viewportWidth)
viewportWidth
- the pixel width of the viewport (component) in which
the map is displayedメソッドの詳細 |
---|
public int getViewportPixelHeight()
public void calculateMinutesPerPixel(double mapWidthInLongitude)
mapWidthInLongitude
- public int getViewportPixelWidth()
public void setViewportWidth(int viewportWidth)
public void setViewportHeight(int viewportHeight)
public void setCentre(Position centre)
public double getMinutesPerPixel()
public double getMetersPerPixel()
public void setMinutesPerPixel(double minutesPerPixel)
public java.awt.Point toPixel(Position position)
position
- the position to convert
Point
a pixel co-ordinatepublic Position toPosition(java.awt.Point p)
p
- object that you wish to convert into
longitude / latiude
Position
objectpublic void setCentre(java.awt.Point p)
p
- Point
object denoting the map's new centrepublic void setXCentre(int xCentre)
xCentre
- public void setYCentre(int yCentre)
yCentre
- public java.awt.Point getPixelCentre()
public Position getCentre()
Position
centre of the map
Position
object marking the map's (lat, long) centre
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |