ilog.views.tiling
Class IlvTiledLayer

java.lang.Object
  extended by ilog.views.IlvIndexedSet
      extended by ilog.views.IlvManagerLayer
          extended by ilog.views.tiling.IlvTiledLayer
All Implemented Interfaces:
IlvPersistentObject, Serializable
Direct Known Subclasses:
IlvCADRGLayer, IlvDTEDLayer, IlvSDOLayer

public class IlvTiledLayer
extends IlvManagerLayer

A tiled layer is an 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.

This image shows an IlvTiledLayer in debug mode.

An IlvTiledLayer is associated with three important objects:

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).

Since:
ILOG JViews 3.0
See Also:
IlvTile, IlvTileLoader, IlvTileController, Serialized Form

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class ilog.views.IlvManagerLayer
addVisibilityFilter, drawImpl, getAlpha, getIndex, getManager, getName, getNamedProperty, getProperty, getVisibilityFilters, isSelectable, isTemporarilyHidden, isVisible, print, removeNamedProperty, removeVisibilityFilter, setAlpha, setName, setNamedProperty, setProperty, writeIt
 
Methods inherited from class ilog.views.IlvIndexedSet
addObject, afterUpdate, beforeUpdate, collectObjects, deleteAll, getCardinal, getElements, getIndex, getManagers, getManagersCount, getObject, getObject, getSubsequentRemoveThreshold, isQuadtreeEnabled, map, mapInside, mapInside, mapIntersects, mapIntersects, removeObject, setIndex, setQuadtreeEnabled, setSubsequentRemoveThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvTiledLayer

public IlvTiledLayer(IlvRect tileOrigin)
Creates an instance of tiled layer. The tiling is in indexed mode.

Parameters:
tileOrigin - The position of the tile of row 0 and column 0.

IlvTiledLayer

public IlvTiledLayer(IlvRect tileOrigin,
                     IlvTileCache cache,
                     int mode)
Creates an instance of tiled layer.

Parameters:
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).
Since:
JViews 7.5

IlvTiledLayer

public IlvTiledLayer(IlvRect tileOrigin,
                     IlvTileCache cache)
Creates an instance of IlvTiledLayer and specifies its cache. The tiling is in indexed mode.

Parameters:
tileOrigin - The position of the tile of row 0 and column 0

IlvTiledLayer

public IlvTiledLayer(IlvInputStream stream)
              throws IlvReadFileException
Reads the layer from an IlvInputStream.

Parameters:
stream - The input stream
Throws:
IlvReadFileException - if the format is not correct.
Method Detail

setDebugView

public void setDebugView(IlvManagerView view)
Sets a debug view in which the layer will draw its tiles.

Parameters:
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.

initTileOrigin

protected void initTileOrigin(IlvRect tileOrigin)
Initializes the origin tile if it could not be computed in the constructor of the layer.


disconnect

protected void disconnect(IlvManager manager)
This method is called when the layer is removed from a manager. Subclasses of IlvTiledLayer that need to override this method must call super.disconnect(manager) before performing any other operation.

Parameters:
manager - The manager

setDebugView

public void setDebugView(IlvManagerView view,
                         Color borderColor,
                         Color lockedTilesColor,
                         Color cachedTilesColor,
                         Color unloadedTilesColor)
Sets a debug view for the layer and specifies the debug colors.

Parameters:
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.

getDebugView

public final IlvManagerView getDebugView()
Returns the debug view of the layer if it has been specified.


computeBBox

public IlvRect computeBBox(IlvTransformer t)
Returns the bounding box of the layer for the specified transformer. If a size has been specified for the layer, the method returns the transformed rectangle. Otherwise, the bounding box of the layer depends on the tiles that are currently loaded.

Overrides:
computeBBox in class IlvManagerLayer
Parameters:
t - The transformer

draw

protected void draw(Graphics dst,
                    IlvManagerView view)
Draws the content of the layer.

Overrides:
draw in class IlvManagerLayer
Parameters:
dst - The graphics
view - The view
See Also:
IlvManagerView.setLayerCached(int, boolean)

isVisible

public boolean isVisible(IlvManagerView view)
Returns true if the layer is visible in the specified view.

Overrides:
isVisible in class IlvManagerLayer
Parameters:
view - The view of the manager.

ignoreView

public void ignoreView(IlvManagerView view,
                       boolean ignore)
Specifies to the tile loader to never load a tile if it is visible in the specified view. This can be used for example to avoid loading tiles that become visible in an overview. This method is a shortcut for getTileController.ignoreView()

Parameters:
view - The view to ignore
ignore - If set to true, the view is ignored. Otherwise the events in the view are processed normally.

isIgnoringView

public boolean isIgnoringView(IlvManagerView view)
Returns true if the view can control the load-on-demand This method is a shortcut for getTileController.isIgnoringView()


setSize

public void setSize(IlvRect rect)
Specifies the area in which the tiles are contained. If the rect parameter is set to null, there is no limit to the tiling grid. This method is a shortcut for getTileController.setSize().

Parameters:
rect - The area in which the tiles are contained.

getSize

public IlvRect getSize()
Returns the size of the layer if it has been specified. This method is a shortcut for getTileController.getSize()

See Also:
setSize(ilog.views.IlvRect)

getTileController

public final IlvTileController getTileController()
Returns the tile controller of the layer.


getTileLoader

public final IlvTileLoader getTileLoader()
Returns the tile loader of the layer. This method is a shortcut for getTileController.getTileLoader()


setTileLoader

public void setTileLoader(IlvTileLoader tileLoader)
Sets the tile loader of the layer. This method is a shortcut for getTileController.setTileLoader()


setManager

protected void setManager(IlvManager manager)
Sets the manager of the layer.

Overrides:
setManager in class IlvManagerLayer
Parameters:
manager - The manager to which this layer will belong.

fitTransformerToTile

public void fitTransformerToTile(IlvManagerView view,
                                 int row,
                                 int column)
Sets the transformer of view so that the specified tile is fully visible.

Parameters:
view - The view
row - The row of the tile
column - The column of the tile

fitTransformerToTile

public void fitTransformerToTile(IlvManagerView view,
                                 IlvFreeTile tile)
Sets the transformer of view so that the specified tile is fully visible.

Parameters:
view - The view
tile - The tile
Since:
JViews 7.5

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the layer to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvManagerLayer
Parameters:
stream - the output stream
Throws:
IOException - if an error occurs while saving.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.