jme3tools.navigation
クラス MapModel2D

java.lang.Object
  上位を拡張 jme3tools.navigation.MapModel2D

public class MapModel2D
extends java.lang.Object

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.

導入されたバージョン:
1.0

フィールドの概要
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
 

フィールドの詳細

DEFAULT_MAP_WIDTH_LONGITUDE

public static final int DEFAULT_MAP_WIDTH_LONGITUDE
関連項目:
定数フィールド値
コンストラクタの詳細

MapModel2D

public MapModel2D(int viewportWidth)
Constructor

パラメータ:
viewportWidth - the pixel width of the viewport (component) in which the map is displayed
導入されたバージョン:
1.0
メソッドの詳細

getViewportPixelHeight

public int getViewportPixelHeight()
Returns the height of the viewport in pixels

戻り値:
the height of the viewport in pixels
導入されたバージョン:
0.1

calculateMinutesPerPixel

public void calculateMinutesPerPixel(double mapWidthInLongitude)
Calculates the number of minutes per pixels using a given map width in longitude

パラメータ:
mapWidthInLongitude -
導入されたバージョン:
1.0

getViewportPixelWidth

public int getViewportPixelWidth()
Returns the width of the viewport in pixels

戻り値:
the width of the viewport in pixels
導入されたバージョン:
0.1

setViewportWidth

public void setViewportWidth(int viewportWidth)

setViewportHeight

public void setViewportHeight(int viewportHeight)

setCentre

public void setCentre(Position centre)

getMinutesPerPixel

public double getMinutesPerPixel()
Returns the number of minutes there are per pixel

戻り値:
the number of minutes per pixel
導入されたバージョン:
1.0

getMetersPerPixel

public double getMetersPerPixel()

setMinutesPerPixel

public void setMinutesPerPixel(double minutesPerPixel)

toPixel

public java.awt.Point toPixel(Position position)
Converts a latitude/longitude position into a pixel co-ordinate

パラメータ:
position - the position to convert
戻り値:
Point a pixel co-ordinate
導入されたバージョン:
1.0

toPosition

public Position toPosition(java.awt.Point p)
Converts a pixel position into a mercator position

パラメータ:
p - object that you wish to convert into longitude / latiude
戻り値:
the converted Position object
導入されたバージョン:
1.0

setCentre

public void setCentre(java.awt.Point p)
Defines the centre of the map in pixels

パラメータ:
p - Point object denoting the map's new centre
導入されたバージョン:
1.0

setXCentre

public void setXCentre(int xCentre)
Sets the map's xCentre

パラメータ:
xCentre -
導入されたバージョン:
1.0

setYCentre

public void setYCentre(int yCentre)
Sets the map's yCentre

パラメータ:
yCentre -
導入されたバージョン:
1.0

getPixelCentre

public java.awt.Point getPixelCentre()
Returns the pixel (x,y) centre of the map

戻り値:
{@code Point) object marking the map's (x,y) centre
導入されたバージョン:
1.0

getCentre

public Position getCentre()
Returns the Position centre of the map

戻り値:
Position object marking the map's (lat, long) centre
導入されたバージョン:
1.0