|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.Mapper
public class Mapper
Classe de gestion d'une carte numerique par les outils de zoom, orientation et positionement.
On passe par un appel a la methode getImage
pour afficher une carte. Elle renvoie le plan sous forme d'une image de taille size
*size
aux bonnes coordonnees de zoom, translation et rotation. Il n'y a qu'a l'afficher dans l'interface utilisateur.
Field Summary | |
---|---|
static double |
ROTATE_DEFAULT
Default rotation value = ROTATE_MIN = 0.0 |
static double |
ROTATE_MAX
maximal rotation value = 1.0 |
static double |
ROTATE_MIN
minimal rotation value = 0.0 |
static double |
TRANSLATEX_DEFAULT
Default translation on X value = ( TRANSLATEX_MAX + TRANSLATEX_MIN )/2 = 0.5 |
static double |
TRANSLATEX_MAX
maximal translation on X value = 1.0 |
static double |
TRANSLATEX_MIN
minimal translation on X value = 0.0 |
static double |
TRANSLATEY_DEFAULT
Default translation on Y value = ( TRANSLATEY_MAX + TRANSLATEY_MIN )/2 = 0.5 |
static double |
TRANSLATEY_MAX
maximal translation on Y value = 1.0 |
static double |
TRANSLATEY_MIN
minimal translation on Y value = 0.0 |
static double |
ZOOM_DEFAULT
Default zoom level value = ZOOM_MIN = 0.0 |
static double |
ZOOM_MAX
maximal zoom level value = 1.0 |
static double |
ZOOM_MIN
minimal zoom level value = 0.0 |
Constructor Summary | |
---|---|
Mapper(int size)
Creates a squared size*size map |
Method Summary | |
---|---|
double |
getDefaultRotate()
Return the default rotation value. |
double |
getDefaultTranslateX()
Return the default translation along X. |
double |
getDefaultTranslateY()
Return the default translation along Y. |
double |
getDefaultZoom()
Return the default zoom level. |
java.awt.Dimension |
getDimension()
Return the map display dimensions. |
java.awt.image.BufferedImage |
getImage()
Return the map image. |
double |
getRotate()
Return the current rotation angle. |
double |
getTranslateX()
Return the current translation on X. |
double |
getTranslateY()
Return the current translation on Y. |
double |
getZoom()
Return the current zoom level. |
void |
resetMap()
Reset the map display to the default values of zoom ( ZOOM_DEFAULT ) , rotation (ROTATE_DEFAULT ) and position (TRANSLATEX_DEFAULT , TRANSLATEY_DEFAULT ) |
void |
resetRotate()
Reset the map display to the initial value of rotation ( ROTATE_DEFAULT ). |
void |
resetTranslateX()
Reset the translation along X to the default value ( TRANSLATEX_DEFAULT ). |
void |
resetTranslateY()
Reset the the translation along Y to the default value ( TRANSLATEY_DEFAULT ). |
void |
resetZoom()
Reset the map display to the default value of zoom ( ZOOM_DEFAULT ). |
void |
setRotate(double rotate)
Rotate the map. |
void |
setTranslateX(double translateX)
Translate the map on X axis. |
void |
setTranslateY(double translateY)
Translate the map on Y axis. |
void |
setZoom(double zoom)
Zoom into the map. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double ZOOM_MAX
public static final double ZOOM_MIN
public static final double TRANSLATEX_MAX
public static final double TRANSLATEX_MIN
public static final double TRANSLATEY_MAX
public static final double TRANSLATEY_MIN
public static final double ROTATE_MAX
public static final double ROTATE_MIN
public static final double ZOOM_DEFAULT
ZOOM_MIN
= 0.0
public static final double ROTATE_DEFAULT
ROTATE_MIN
= 0.0
public static final double TRANSLATEX_DEFAULT
TRANSLATEX_MAX
+ TRANSLATEX_MIN
)/2 = 0.5
public static final double TRANSLATEY_DEFAULT
TRANSLATEY_MAX
+ TRANSLATEY_MIN
)/2 = 0.5
Constructor Detail |
---|
public Mapper(int size)
size
- The display size of the mapMethod Detail |
---|
public void setRotate(double rotate)
ROTATE_MIN
to ROTATE_MAX
.
ROTATE_MIN
relates to a 0 degree rotation, and ROTATE_MAX
relates to a 360 degree rotation
rotate
- A value between ROTATE_MIN
and ROTATE_MAX
public void setTranslateX(double translateX)
TRANSLATEX_MIN
to TRANSLATEX_MAX
translateX
- A value between TRANSLATEX_MIN
and TRANSLATEX_MAX
public void setTranslateY(double translateY)
TRANSLATEY_MIN
to TRANSLATEY_MAX
.
translateY
- A value between TRANSLATEY_MIN
and TRANSLATEY_MAX
public void setZoom(double zoom)
ZOOM_MIN
to ZOOM_MAX
. ZOOM_MIN
means no zoom, and ZOOM_MAX
means a maximum zoom level. This maximum level depends on the resolution of the image map.
zoom
- A value between ZOOM_MIN
and ZOOM_MAX
public double getRotate()
ROTATE_MIN
and ROTATE_MAX
public double getTranslateX()
TRANSLATEX_MIN
and TRANSLATEX_MAX
public double getTranslateY()
TRANSLATEY_MIN
and TRANSLATEY_MAX
public double getZoom()
ZOOM_MIN
and ZOOM_MAX
public double getDefaultZoom()
ZOOM_DEFAULT
public double getDefaultTranslateY()
TRANSLATEY_DEFAULT
public double getDefaultTranslateX()
TRANSLATEX_DEFAULT
public double getDefaultRotate()
ROTATE_DEFAULT
public java.awt.Dimension getDimension()
dimensions
of the mappublic void resetMap()
ZOOM_DEFAULT
) , rotation (ROTATE_DEFAULT
) and position (TRANSLATEX_DEFAULT
, TRANSLATEY_DEFAULT
)
public void resetTranslateX()
TRANSLATEX_DEFAULT
).
public void resetTranslateY()
TRANSLATEY_DEFAULT
).
public void resetZoom()
ZOOM_DEFAULT
).
public void resetRotate()
ROTATE_DEFAULT
).
public java.awt.image.BufferedImage getImage()
BufferedImage
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |