public class IlvTiledLayer extends IlvManagerLayer
IlvManagerLayer
object
for loading large sets of data, for example, large maps. It is divided
into a number of identical rectangular areas called tiles, and provides a
notification mechanism to load only the graphic objects that are required
by the application, because a tile is visible
in one of the views of the manager or because it has been
explicitly required by the application.
The tiles are managed by an IlvTileController
.
IlvTiledLayer
in debug mode.
An IlvTiledLayer
is associated with three important objects:
IlvTileController
, which manages the tile events.
IlvTileLoader
, which loads the tiles from a
data source.
IlvTileCache
, which manages the cache and deletes the
unused tiles.
When an IlvTiledLayer
is saved into an .ivl
file, it does not
save the graphic objects it contains. It saves its tiling parameters (loader,
cache, tile controller).
IlvTile
,
IlvTileLoader
,
IlvTileController
,
Serialized FormConstructor and Description |
---|
IlvTiledLayer(IlvInputStream stream)
Reads the layer from an
IlvInputStream . |
IlvTiledLayer(IlvRect tileOrigin)
Creates an instance of tiled layer.
|
IlvTiledLayer(IlvRect tileOrigin,
IlvTileCache cache)
Creates an instance of
IlvTiledLayer and specifies its cache. |
IlvTiledLayer(IlvRect tileOrigin,
IlvTileCache cache,
int mode)
Creates an instance of tiled layer.
|
Modifier and Type | Method and Description |
---|---|
IlvRect |
computeBBox(IlvTransformer t)
Returns the bounding box of the layer for the specified transformer.
|
protected void |
disconnect(IlvManager manager)
This method is called when the layer is removed from a manager.
|
protected void |
draw(Graphics dst,
IlvManagerView view)
Draws the content of the layer.
|
void |
fitTransformerToTile(IlvManagerView view,
IlvFreeTile tile)
Sets the transformer of
view so that
the specified tile is fully visible. |
void |
fitTransformerToTile(IlvManagerView view,
int row,
int column)
Sets the transformer of
view so that
the specified tile is fully visible. |
IlvManagerView |
getDebugView()
Returns the debug view of the layer if it has been specified.
|
IlvRect |
getSize()
Returns the size of the layer if it has been specified.
|
IlvTileController |
getTileController()
Returns the tile controller of the layer.
|
IlvTileLoader |
getTileLoader()
Returns the tile loader of the layer.
|
void |
ignoreView(IlvManagerView view,
boolean ignore)
Specifies to the tile loader to never load a tile if it is
visible in the specified view.
|
protected void |
initTileOrigin(IlvRect tileOrigin)
Initializes the origin tile if it could not be computed
in the constructor of the layer.
|
boolean |
isIgnoringView(IlvManagerView view)
Returns
true if the view can control the load-on-demand
This method is a shortcut for
getTileController.isIgnoringView() |
boolean |
isVisible(IlvManagerView view)
Returns
true if the layer is visible in the specified view. |
void |
setDebugView(IlvManagerView view)
Sets a debug view in which the layer will draw its
tiles.
|
void |
setDebugView(IlvManagerView view,
Color borderColor,
Color lockedTilesColor,
Color cachedTilesColor,
Color unloadedTilesColor)
Sets a debug view for the layer and specifies the debug colors.
|
protected void |
setManager(IlvManager manager)
Sets the manager of the layer.
|
void |
setSize(IlvRect rect)
Specifies the area in which the tiles are contained.
|
void |
setTileLoader(IlvTileLoader tileLoader)
Sets the tile loader of the layer.
|
void |
write(IlvOutputStream stream)
Writes the layer to an
IlvOutputStream . |
addVisibilityFilter, drawImpl, getAlpha, getIndex, getManager, getName, getNamedProperty, getProperty, getVisibilityFilters, isSelectable, isTemporarilyHidden, isVisible, print, removeNamedProperty, removeVisibilityFilter, setAlpha, setName, setNamedProperty, setProperty, writeIt
addObject, afterUpdate, beforeUpdate, collectObjects, collectSelectableObjects, deleteAll, getCardinal, getElements, getIndex, getManagers, getManagersCount, getObject, getObject, getSelectableObject, getSubsequentRemoveThreshold, isQuadtreeEnabled, isZOrdering, map, mapInside, mapInside, mapIntersects, mapIntersects, removeObject, setIndex, SetInitialNumberOfNonZoomablesCapacity, SetInitialNumberOfObjectsCapacity, setQuadtreeEnabled, setSubsequentRemoveThreshold, setZOrdering
public IlvTiledLayer(IlvRect tileOrigin)
tileOrigin
- The position of the tile of row 0 and column 0.public IlvTiledLayer(IlvRect tileOrigin, IlvTileCache cache, int mode)
tileOrigin
- The position of the tile of row 0 and column 0.mode
- To specify whether to use an indexed tile grid (IlvTileController.INDEXED,
the behavior of previous versions) or a list of user-specified IlvFreeTile
instances (IlvTileController.INDEXED.FREE_MODE).public IlvTiledLayer(IlvRect tileOrigin, IlvTileCache cache)
IlvTiledLayer
and specifies its cache.
The tiling is in indexed mode.tileOrigin
- The position of the tile of row 0 and column 0public IlvTiledLayer(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input streamIlvReadFileException
- if the format is not correct.public void setDebugView(IlvManagerView view)
view
- The debug view (it must be attached to the
manager of the layer). If this argument is null
,
then no debug view is used by the layer.protected void initTileOrigin(IlvRect tileOrigin)
protected void disconnect(IlvManager manager)
IlvTiledLayer
that need to override this
method must call super.disconnect(manager)
before
performing any other operation.manager
- The managerpublic void setDebugView(IlvManagerView view, Color borderColor, Color lockedTilesColor, Color cachedTilesColor, Color unloadedTilesColor)
view
- The debug view (it must be attached to the
manager of the layer). If this argument is null,
no debug view is used by the layer.borderColor
- The color used to draw the tile borders. If the
color is set to null, the tile borders will
not be drawn.lockedTilesColor
- The color used to draw the locked tiles. If the
color is set to null, the locked tiles will
not be drawn.cachedTilesColor
- The color used to draw the cached tiles. If the
color is set to null, the cached tiles will
not be drawn.unloadedTilesColor
- The color used to draw the unloaded tiles. If
the color is set to null, the unloaded tiles
will not be drawn.public final IlvManagerView getDebugView()
public IlvRect computeBBox(IlvTransformer t)
computeBBox
in class IlvManagerLayer
t
- The transformerprotected void draw(Graphics dst, IlvManagerView view)
draw
in class IlvManagerLayer
dst
- The graphicsview
- The viewIlvManagerView.setLayerCached(int, boolean)
public boolean isVisible(IlvManagerView view)
true
if the layer is visible in the specified view.isVisible
in class IlvManagerLayer
view
- The view of the manager.public void ignoreView(IlvManagerView view, boolean ignore)
getTileController.ignoreView()
view
- The view to ignoreignore
- If set to true
, the view is ignored. Otherwise
the events in the view are processed normally.public boolean isIgnoringView(IlvManagerView view)
true
if the view can control the load-on-demand
This method is a shortcut for
getTileController.isIgnoringView()
public void setSize(IlvRect rect)
rect
parameter is set to null
,
there is no limit to the tiling grid.
This method is a shortcut for getTileController.setSize()
.rect
- The area in which the tiles are contained.public IlvRect getSize()
getTileController.getSize()
setSize(ilog.views.IlvRect)
public final IlvTileController getTileController()
public final IlvTileLoader getTileLoader()
getTileController.getTileLoader()
public void setTileLoader(IlvTileLoader tileLoader)
getTileController.setTileLoader()
protected void setManager(IlvManager manager)
setManager
in class IlvManagerLayer
manager
- The manager to which this layer will belong.public void fitTransformerToTile(IlvManagerView view, int row, int column)
view
so that
the specified tile is fully visible.view
- The viewrow
- The row of the tilecolumn
- The column of the tilepublic void fitTransformerToTile(IlvManagerView view, IlvFreeTile tile)
view
so that
the specified tile is fully visible.view
- The viewtile
- The tilepublic void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvManagerLayer
stream
- the output streamIOException
- if an error occurs while saving.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.