|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eightmotions.map.Marker
public class Marker
Manage a location in the map...
Typically, could be displayed as a marker, but is linked to several other functions
Each element can have a name, a description, and address, and eventually an icon.
Be carefull that the icon feature could take a lot of memory...
This class contains several public elements that can be modified (no getter and setter).
But if you change the long/lat value directly, you must call "validate()" function.
Typical use is to create some Marker element, add them to the canvas in the listPlace vector
and call recenterAroundSel()
| Field Summary | |
|---|---|
java.lang.String |
address
Adress of this element. |
static MarkerStyle |
defaultStyle
|
java.lang.String |
description
Description, but not the address. |
javax.microedition.lcdui.Image |
iconImage
|
java.lang.String |
iconName
URL of an icon to be displayed. |
int |
ima_offx
|
int |
ima_offy
|
java.lang.String |
imageName
|
boolean |
isModeSat
|
int |
m_category
|
int |
m_col
|
int |
m_colForeground
|
static int |
m_defaultHeight
|
static int |
m_defaultWidth
Default width of the info window when the loc is selected This is recomputed at initialisation by the MapDisplay, but can be chaned later on. |
float |
m_lat
|
float |
m_lon
|
MarkerListener |
m_theListener
|
int |
m_type
|
java.lang.String |
name
Name of this element. |
java.lang.String |
phoneNum
Phone number of this element. |
int |
px
|
int |
py
|
MarkerStyle |
style
|
java.lang.String |
URL
|
int |
zoom
|
| Constructor Summary | |
|---|---|
Marker()
|
|
Marker(float lon,
float lat)
|
|
Marker(java.lang.String name,
float lon,
float lat,
int preferredZoom,
boolean isModeSat)
|
|
| Method Summary | |
|---|---|
Marker |
clone(float inlon,
float inlat)
|
void |
copyFrom(Marker in)
|
static Marker |
createFromString(java.lang.String in)
Factory to create a location object from a string representation. |
int |
distFrom(int inpx,
int inpy,
int inzoom)
|
static int |
distFrom(int lp1x,
int lp1y,
int inpx,
int inpy,
int inzoom)
|
boolean |
equals(java.lang.Object obj)
|
void |
fireLoaded()
|
java.util.Enumeration |
getKeys()
|
java.lang.Object |
getValue(java.lang.String name)
|
int |
getZoom()
|
void |
init(java.lang.String name,
float lon,
float lat,
int preferredZoom,
boolean isModeSat)
|
void |
paint(javax.microedition.lcdui.Graphics g,
MapDisplay m)
Paint the marker. |
void |
paintFull(javax.microedition.lcdui.Graphics g,
MapDisplay m)
Draw the infomrations when the icon has been selected.... |
void |
run()
|
java.lang.String |
saveToString()
Put the content of the location into a string. |
void |
setListener(MarkerListener inListener)
Set the listenr that will be called when an icon will be loaded. |
void |
setLonLat(float inLon,
float inLat)
|
void |
setPxPy(int inPx,
int inPy)
Set the location to a new postion in world pixel coordinates |
void |
setValue(java.lang.String name,
java.lang.Object val)
|
boolean |
validate()
Validate the changes in lat/lon. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float m_lon
public float m_lat
public int px
public int py
public static int m_defaultWidth
public static int m_defaultHeight
public java.lang.String name
public java.lang.String description
public java.lang.String phoneNum
public java.lang.String address
public java.lang.String iconName
public javax.microedition.lcdui.Image iconImage
public java.lang.String imageName
public MarkerListener m_theListener
public int zoom
public java.lang.String URL
public boolean isModeSat
public int ima_offx
public int ima_offy
public int m_category
public int m_col
public int m_colForeground
public int m_type
public MarkerStyle style
public static MarkerStyle defaultStyle
| Constructor Detail |
|---|
public Marker()
public Marker(java.lang.String name,
float lon,
float lat,
int preferredZoom,
boolean isModeSat)
public Marker(float lon,
float lat)
| Method Detail |
|---|
public void init(java.lang.String name,
float lon,
float lat,
int preferredZoom,
boolean isModeSat)
public int getZoom()
public int distFrom(int inpx,
int inpy,
int inzoom)
public static int distFrom(int lp1x,
int lp1y,
int inpx,
int inpy,
int inzoom)
public void paint(javax.microedition.lcdui.Graphics g,
MapDisplay m)
g - inpx - Current position of the screen in full size.inpy - w - Width of the screenh - Height of the screenzoom - Zoom factorpublic void setListener(MarkerListener inListener)
inListener - public void fireLoaded()
public void paintFull(javax.microedition.lcdui.Graphics g,
MapDisplay m)
g - Graphics contextm - The map to be displayed in
Note: if you want to do your own rendering, it's better to subclass
MarkerStyle and assign this style to your markerpublic boolean validate()
public void setLonLat(float inLon,
float inLat)
public void setPxPy(int inPx,
int inPy)
public static Marker createFromString(java.lang.String in)
in - The string representation
public void setValue(java.lang.String name,
java.lang.Object val)
public java.lang.Object getValue(java.lang.String name)
public java.util.Enumeration getKeys()
public java.lang.String saveToString()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public Marker clone(float inlon,
float inlat)
public void copyFrom(Marker in)
public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||