|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.layer.rpf.RpfCacheHandler
public class RpfCacheHandler
The RpfCacheHandler handles everything to do with the decompressed subframes, which is what gets put up on the screen. It interfaces with the RpfFrameProvider to get the information about the data. It also is usually handled by the RpfCacheManager.
Nested Class Summary | |
---|---|
static class |
RpfCacheHandler.SubframeCache
The entire subframe cache |
Field Summary | |
---|---|
protected RpfCacheHandler.SubframeCache |
cache
The subframe cache. |
protected java.util.List<RpfCoverageBox> |
coverageBoxes
The current description of the TOC entry that currently applies. |
protected boolean |
DEBUG_RPF
Used in setCache to see if new coverage is needed with a projection change. |
protected boolean |
DEBUG_RPFDETAIL
|
static int |
DEFAULT_SUBFRAMEBUFFER
|
protected java.awt.Point |
end
The lower right subframe index on screen. |
protected RpfFrameProvider |
frameProvider
The place to look for for image data. |
protected boolean |
goodData
A flag to let the cache manager know that the subframes needed for the map make sense. |
static int |
MAX_DESC_LEN
|
static int |
MAX_NUM_DESC
|
static int |
NOT_CACHED
subframe status constant. |
static int |
NOT_PRESENT
subframe status constant. |
protected int |
scalingHeight
Subframe scaling for map scales that don't match chart scale. |
protected int |
scalingWidth
Subframe scaling for map scales that don't match chart scale. |
protected java.awt.Point |
start
The upper left subframe index on screen. |
static int |
SUBFRAME_CACHE_SIZE
|
protected int |
subframeBuffer
The subframe cache is mapped by a 2D matrix based on the number of subframes that will fit in the RpfCoverageBox area. |
protected int |
subframeCacheSize
The size of the subframe cache. |
protected byte[][] |
subframeIndex
The array of indexes for subframes contained in the RpfTocEntry. |
protected byte[][] |
subframeVersion
The array of version markers for subframes contained in the RpfTocEntry. |
protected RpfViewAttributes |
viewAttributes
Description of how the frames should be constructed and displayed. |
Constructor Summary | |
---|---|
RpfCacheHandler(RpfFrameProvider provider,
RpfViewAttributes rva)
Constructor for a main cache, with the full size cache. |
|
RpfCacheHandler(RpfFrameProvider provider,
RpfViewAttributes rva,
int subframe_cache_size)
Constructor for an auxiliary cache, with a settable cache size. |
Method Summary | |
---|---|
void |
clearCache()
Clear the subframes in the cache, marking them as NOT_CACHED. |
protected void |
freeCache(int index)
|
protected RpfSubframe |
getCached(int cbx,
int cby)
Get a subframe from the cache if possible, otherwise allocate a new cache entry and decompress it. |
protected RpfSubframe |
getCached(int cbx,
int cby,
int subframeCount)
Get a subframe from the cache if possible, otherwise allocate a new cache entry and decompress it. |
int |
getCacheSize()
Find out the size of the subframe cache. |
java.util.List<RpfCoverageBox> |
getCoverageBoxes()
Returns the Vector containing RpfCoverageBoxes that was returned from the RpfFrameProvider as a result of the last setCache call. |
RpfFrameProvider |
getFrameProvider()
Return RpfFrameProvider used by the layer. |
boolean |
getGoodData()
Return true if the cache handler knows about good data in the current situation. |
protected int |
getLRU()
Get the index of the least recently used entry from the subframe cache. |
protected RpfSubframe |
getSubframeFromOtherTOC(int x,
int y)
Get a subframe from one of the other RpfCoverageBoxes. |
protected RpfSubframe |
getSubframeFromOtherTOC(int x,
int y,
int subframeCount)
Get a subframe from one of the other RpfCoverageBoxes. |
protected OMGraphicList |
getSubframes(float ullat,
float ullon,
float lrlat,
float lrlon,
Projection proj,
OMGraphicList omGraphics)
|
RpfViewAttributes |
getViewAttributes()
Get the view attributes or the layer. |
protected void |
initCache(boolean newCache)
|
protected boolean |
loadSubframe(RpfSubframe subframe,
RpfCoverageBox coverageBox,
int x,
int y)
Contacts the frame provider to put the subframe image in the RpfSubframe. |
protected void |
referenceCache(int index)
Mark a cache entry as being recently used. |
protected void |
resetSubframeIndex(int vertFrames,
int horizFrames)
Resets the indicators in the subframe cache, so that none of the current contents will be used - they'll have to be loaded with data first. |
void |
setCache(float ullat,
float ullon,
float lrlat,
float lrlon,
Projection proj)
Called to prepare the cache for subframes that will fit into the next request. |
void |
setFrameProvider(RpfFrameProvider fp)
Set the RpfFrameProvider for the layer. |
void |
setViewAttributes(RpfViewAttributes rva)
Set the view attributes for the layer. |
void |
updateViewAttributes()
This only needs to be called if the frame provider is not local. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUBFRAME_CACHE_SIZE
public static final int MAX_NUM_DESC
public static final int MAX_DESC_LEN
public static final int DEFAULT_SUBFRAMEBUFFER
public static final int NOT_CACHED
public static final int NOT_PRESENT
protected int scalingHeight
protected int scalingWidth
protected RpfCacheHandler.SubframeCache cache
protected java.util.List<RpfCoverageBox> coverageBoxes
protected byte[][] subframeIndex
protected byte[][] subframeVersion
protected int subframeCacheSize
protected RpfViewAttributes viewAttributes
protected RpfFrameProvider frameProvider
protected java.awt.Point start
protected java.awt.Point end
protected boolean goodData
protected int subframeBuffer
protected boolean DEBUG_RPF
protected boolean DEBUG_RPFDETAIL
Constructor Detail |
---|
public RpfCacheHandler(RpfFrameProvider provider, RpfViewAttributes rva)
public RpfCacheHandler(RpfFrameProvider provider, RpfViewAttributes rva, int subframe_cache_size)
Method Detail |
---|
public void setViewAttributes(RpfViewAttributes rva)
rva
- the RpfViewAttributes used for the layer.public RpfViewAttributes getViewAttributes()
public void setFrameProvider(RpfFrameProvider fp)
fp
- the frame provider.public RpfFrameProvider getFrameProvider()
public void updateViewAttributes()
public java.util.List<RpfCoverageBox> getCoverageBoxes()
public void setCache(float ullat, float ullon, float lrlat, float lrlon, Projection proj)
ullat
- NW latitude.ullon
- NW longitude.lrlat
- SE latitude.lrlon
- SE longitudeproj
- projection to use for zone decisions.protected OMGraphicList getSubframes(float ullat, float ullon, float lrlat, float lrlon, Projection proj, OMGraphicList omGraphics)
protected void resetSubframeIndex(int vertFrames, int horizFrames)
public void clearCache()
public boolean getGoodData()
protected void initCache(boolean newCache)
protected int getLRU()
protected void freeCache(int index)
protected void referenceCache(int index)
public int getCacheSize()
protected RpfSubframe getSubframeFromOtherTOC(int x, int y)
x
- the x index of subframe in the FIRST RpfCoverageBox space -
translation needed.y
- the y index of subframe in the FIRST RpfCoverageBox space -
translation needed.protected RpfSubframe getSubframeFromOtherTOC(int x, int y, int subframeCount)
x
- the x index of subframe in the FIRST RpfCoverageBox space -
translation needed.y
- the y index of subframe in the FIRST RpfCoverageBox space -
translation needed.subframeCount
- a running count of the number of subframes retrieved
so far for the current map. Should be used it there is concern
that the number of subframes needed for the map is greater than
the size of the subframe.protected RpfSubframe getCached(int cbx, int cby)
cbx
- the x index of subframe in the rcbIndex A.TOC space.cby
- the y index of subframe in the rcbIndex A.TOC space.protected RpfSubframe getCached(int cbx, int cby, int subframeCount)
cbx
- the x index of subframe in the rcbIndex A.TOC space.cby
- the y index of subframe in the rcbIndex A.TOC space.subframeCount
- a running count of the number of subframes retrieved
so far for the current map. Should be used if there is concern
that the number of subframes needed for the map is greater than
the size of the cache.protected boolean loadSubframe(RpfSubframe subframe, RpfCoverageBox coverageBox, int x, int y)
subframe
- the RpfSubframe to load the image data into.coverageBox
- that has toc and entry numbers to use.x
- the coveragebox x index for the subframe.y
- the coveragebox y index for the subframe.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |