|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eightmotions.map.BufferImage
public class BufferImage
This classe manage the download of tiles
Internally a linked list is used, and first entry in the list is removed first, and when we use
a tile, we put it on top of the list. So least used tile should be at the end
of the list....
You probably don't need to deal with this classe in most of the time!
| Field Summary | |
|---|---|
java.lang.String |
debugString
|
static java.lang.String |
extraInfo
|
static java.lang.String |
fetcherUrl
|
static java.lang.String |
GOOGLE_MAP_VERSION
|
static java.lang.String |
GOOGLE_SAT_VERSION
|
javax.microedition.lcdui.Image |
ima
if not null, an image is associated to this tile |
static java.util.Vector |
listOfMaps
Compute the URL for a specific tile |
static MapOverlay |
m_customOverlay
|
static int |
m_dataDownloadCounter
|
static boolean |
m_doNotUseNetwork
|
static boolean |
m_modePacked
TRUE is several requests are packed in one request.... exploratory only |
static boolean |
m_useFileAPI
|
static boolean |
m_useProxy
True if the download process use a proxy server to convert images from jpg to png |
static boolean |
m_useRMS
|
java.lang.Object |
my_data
Object that can be initialized by the user of the classe |
protected static javax.microedition.lcdui.Image |
nullIma
|
protected int |
rmsId
|
static java.lang.String |
ROOT_DIR
|
static int |
ST_IN_RMS
This tile is not loaded in memory, but is in RMS |
static int |
ST_LOADED
This tile has been loaded |
static int |
ST_LOADING
This tile is being loaded |
static int |
ST_NONE
Undefined state |
static int |
ST_NOTFOUND
This tile has not been found on the server |
static int |
ST_TO_DELETE
This tile has to be deleted |
static int |
ST_TOLOAD
This tile has to be loaded |
int |
state
Current state of the tile... |
static java.util.Vector |
tabSats
|
| Constructor Summary | |
|---|---|
protected |
BufferImage(int px,
int py,
int zoom,
MapOverlay inMap,
int inSize)
Should be only used internally... |
| Method Summary | |
|---|---|
protected static java.lang.String |
changeCar(java.lang.String res)
Used to change the URL into an HTTP post compliant one, by changing & into %26 mostly |
static boolean |
checkBuffer()
|
protected void |
checkFile()
|
static void |
cleanBuffer()
Remove all "waiting" URL, those who are in the toLoad list but that have not yet been started to load |
static java.lang.String |
computeQuadrantString(int x,
int y,
int z,
char[] tab)
Compute the string needed to fetch tile, based on pixel position tab is the "naming index" of the correspoinding tiles, it's a 4 char array. |
void |
delete()
|
void |
delete(boolean doDelete)
|
static void |
deleteCache()
Delete completely the cache |
protected static boolean |
deleteLast()
Delete the last element of the list... |
static void |
dumpState()
debuging function who display the current content of the buffer. |
static void |
fetcher(java.util.Vector fileList)
Fetch several tiles at a time... |
java.lang.String |
getCacheName()
|
static java.lang.String |
getDump()
|
protected static BufferImage |
getFirst()
Return the first image of the list... |
protected boolean |
getFromRMS()
Load from RMS the content of a tile. |
static BufferImage |
getImage(int px,
int py,
int zoom,
MapOverlay inMap,
int size)
Get a tile according to his position/zoom factor/satelitte number if tiles is in RMS, he will be loaded, if not, it will be loaded asynchronously from the sever |
static BufferImage |
getImage(int px,
int py,
int zoom,
MapOverlay inMap,
int size,
boolean loadIt)
Get a tile according to his position/zoom factor/satelitte number if tiles is in RMS, he will be loaded, if not, it will be loaded asynchronously from the sever |
protected static int |
getNum(byte[] tab,
int offset,
int length)
|
static int |
getPending()
Return the number of files waiting to be downloaded... |
protected java.lang.String |
getSatURL(int x,
int y,
int z)
|
protected void |
ImagecreateImage(java.io.InputStream is,
int size)
Create an image for an input stream saved in RMS. |
static void |
initBuffer()
Initialize the image buffering queue..... |
protected static void |
initRms()
Initialise rms. |
protected static BufferImage |
pop()
Extract the first image of the list, and reduce the number of images in the queue by one... |
static void |
provideDisplay(javax.microedition.lcdui.Display display,
javax.microedition.lcdui.Displayable displayable)
Small dirty hack, used to get a display and a displayable in order to show a warning message in case of low memory... |
protected static void |
push(BufferImage inIma)
Push an image into the list... |
static void |
readConf()
|
protected static void |
remove(BufferImage inIma)
Remove an arbitrary element of the list.. |
protected static BufferImage |
removeLast()
Remove the last element of the list, but do not delete it... |
static void |
removeRMS()
Totally clean up RMS used for caching |
static void |
reset()
|
protected void |
saveOneFile()
|
protected void |
saveOneRms()
|
static void |
setBufferSize(int inSize)
Set the size of the list... |
static void |
setImageListener(BufferImageListener inListen)
Set the function to be called when an image is started to be loaded, loaded, or in error, depending of the state attribate of the image. |
static void |
setVisibleSize(int inSize)
|
static void |
stop()
Stop the thread |
java.lang.String |
toString()
|
protected static void |
writeInt(java.io.ByteArrayOutputStream bo,
int val,
int length)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public javax.microedition.lcdui.Image ima
public static final int ST_NONE
public static final int ST_TOLOAD
public static final int ST_LOADING
public static final int ST_LOADED
public static final int ST_NOTFOUND
public static final int ST_IN_RMS
public static final int ST_TO_DELETE
public int state
protected int rmsId
protected static javax.microedition.lcdui.Image nullIma
public java.lang.Object my_data
public static boolean m_modePacked
public static java.lang.String extraInfo
public static MapOverlay m_customOverlay
public static boolean m_useProxy
public static boolean m_useRMS
public static boolean m_doNotUseNetwork
public static boolean m_useFileAPI
public java.lang.String debugString
public static java.lang.String GOOGLE_SAT_VERSION
public static java.lang.String GOOGLE_MAP_VERSION
public static int m_dataDownloadCounter
public static java.lang.String ROOT_DIR
public static java.util.Vector tabSats
public static java.lang.String fetcherUrl
public static java.util.Vector listOfMaps
| Constructor Detail |
|---|
protected BufferImage(int px,
int py,
int zoom,
MapOverlay inMap,
int inSize)
px - py - zoom - typeSat - inSize - | Method Detail |
|---|
public static void initBuffer()
d - current display, will be used to show error (memory error).
public static void provideDisplay(javax.microedition.lcdui.Display display,
javax.microedition.lcdui.Displayable displayable)
display - displayable - public static void stop()
protected static BufferImage getFirst()
protected static BufferImage pop()
protected static void push(BufferImage inIma)
inIma - protected static boolean deleteLast()
protected static BufferImage removeLast()
protected static void remove(BufferImage inIma)
inIma - public static void setBufferSize(int inSize)
inSize - public static void setVisibleSize(int inSize)
public static void setImageListener(BufferImageListener inListen)
inListen - public static int getPending()
public java.lang.String getCacheName()
public static java.lang.String computeQuadrantString(int x,
int y,
int z,
char[] tab)
protected java.lang.String getSatURL(int x,
int y,
int z)
protected static java.lang.String changeCar(java.lang.String res)
res -
public static void cleanBuffer()
public static void deleteCache()
protected static int getNum(byte[] tab,
int offset,
int length)
tab - offset - length -
protected static void initRms()
public static void removeRMS()
protected boolean getFromRMS()
protected void checkFile()
protected void saveOneFile()
protected void saveOneRms()
protected static void writeInt(java.io.ByteArrayOutputStream bo,
int val,
int length)
protected void ImagecreateImage(java.io.InputStream is,
int size)
is - public static void reset()
public static boolean checkBuffer()
public static void fetcher(java.util.Vector fileList)
public void delete()
public void delete(boolean doDelete)
public static void dumpState()
public static java.lang.String getDump()
public static BufferImage getImage(int px,
int py,
int zoom,
MapOverlay inMap,
int size)
px - py - zoom - inNumSat - size - Size of the tile in pixel
public static BufferImage getImage(int px,
int py,
int zoom,
MapOverlay inMap,
int size,
boolean loadIt)
px - py - zoom - inNumSat - size - Size of the tile in pixelloadIt - if true, load it if not present. If false, return null if tile is not here.
public java.lang.String toString()
toString in class java.lang.Objectpublic static void readConf()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||