ilog.views.tiling
Class IlvTile

java.lang.Object
  extended by ilog.views.tiling.IlvTile
Direct Known Subclasses:
IlvFreeTile

public class IlvTile
extends Object

A tile represents an elementary rectangular area that is loaded or released when needed by the application. Tiles are managed by an IlvTileController.

In most cases, the tile controller will be associated with an IlvTiledLayer. This means that the tiles represent areas that must be filled with graphic objects when they become visible due to the user of the application scrolling or zooming on a view.

More sophisticated applications can use a tile controller without attaching it to a layer, for example, to load data that is needed to process an area that becomes visible.

Since:
ILOG JViews 3.0
See Also:
IlvTileController, IlvTiledLayer

Field Summary
static int CACHED
          The status of a cached tile.
static int EMPTY
          The status of an empty tile (neither loaded nor cached).
static int LOCKED
          The status of a locked tile.
 
Constructor Summary
IlvTile(int column, int row, IlvTileController controller)
          Constructs a tile whose column and row are specified.
 
Method Summary
 void addObject(IlvGraphic g, Object id)
          Adds a graphic object to an IlvTiledLayer.
 void boundingBox(IlvRect rect)
          Returns the bounding box of the tile in the manager coordinate system.
 void deleteAll()
          Empties the tile except for the objects that are shared by another non empty tile.
 boolean equals(Object o)
          Returns true if the tile is equal to the object.
 int getColumn()
          Returns the column of the tile.
 IlvTileController getController()
          Returns the controller of the tile.
 Enumeration getLocks()
          Returns the enumeration of objects that have locked the tile.
 IlvGraphic getObject(Object id)
          Returns the object of the specified id if it is already loaded in the layer.
 int getRow()
          Returns the row of the tile.
 int getStatus()
          Returns the status of the tile.
 int hashCode()
          Returns the hash code of the tile.
 boolean isLoadComplete()
          Returns true if the tile is fully loaded.
 boolean isObjectShared(IlvGraphic object)
          Returns true if the object is shared by other tiles.
 void loadComplete()
          Notifies the tile that it has been fully loaded, thus, the method must be called by the tile loaders.
 void notifyError(Throwable errorReason)
          Notifies the tile that an error occurred.
 void reDraw()
          Redraws a tile.
 void removeObject(IlvGraphic g)
          Removes the specified object from the tile.
 String toString()
          Returns the tile description
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final int EMPTY
The status of an empty tile (neither loaded nor cached).

See Also:
Constant Field Values

LOCKED

public static final int LOCKED
The status of a locked tile.

See Also:
Constant Field Values

CACHED

public static final int CACHED
The status of a cached tile.

See Also:
Constant Field Values
Constructor Detail

IlvTile

public IlvTile(int column,
               int row,
               IlvTileController controller)
Constructs a tile whose column and row are specified. The tile is created to be used with the specified tile controller.

Since:
JViews 5.5
Method Detail

getColumn

public final int getColumn()
Returns the column of the tile.


getRow

public final int getRow()
Returns the row of the tile.


getStatus

public final int getStatus()
Returns the status of the tile.

See Also:
EMPTY, CACHED, LOCKED

boundingBox

public void boundingBox(IlvRect rect)
Returns the bounding box of the tile in the manager coordinate system.


equals

public boolean equals(Object o)
Returns true if the tile is equal to the object.

Overrides:
equals in class Object
Parameters:
o - The object to compare with the tile

hashCode

public int hashCode()
Returns the hash code of the tile.

Overrides:
hashCode in class Object

getController

public IlvTileController getController()
Returns the controller of the tile.


addObject

public void addObject(IlvGraphic g,
                      Object id)
Adds a graphic object to an IlvTiledLayer. When implementing an IlvTileLoader, objects should not be added to a manager using IlvManager.addObject. This method must be called only if the tile controller is attached to a layer.

Parameters:
g - The graphic object to add
id - The id of the object. This parameter can take the null value.
See Also:
getObject(java.lang.Object), IlvTileLoader

deleteAll

public void deleteAll()
Empties the tile except for the objects that are shared by another non empty tile. This method must be called only if the tile controller is attached to a layer.


removeObject

public void removeObject(IlvGraphic g)
Removes the specified object from the tile. Note that the object should be contained by this tile, or an exception might be thrown.

Since:
JViews 7.5

reDraw

public void reDraw()
Redraws a tile. Should be called only if the tile is attached to a layer.


getObject

public IlvGraphic getObject(Object id)
Returns the object of the specified id if it is already loaded in the layer. This method must be called only if the tile is attached to a layer.

Parameters:
id - The id of the object
See Also:
addObject(ilog.views.IlvGraphic, java.lang.Object)

isObjectShared

public boolean isObjectShared(IlvGraphic object)
Returns true if the object is shared by other tiles. This method must be called only if the tile controller is attached to a layer.

Parameters:
object - The graphic object

getLocks

public Enumeration getLocks()
Returns the enumeration of objects that have locked the tile.

See Also:
IlvTileController.lockTile(int, int, java.lang.Object)

isLoadComplete

public boolean isLoadComplete()
Returns true if the tile is fully loaded.

See Also:
loadComplete()

loadComplete

public void loadComplete()
Notifies the tile that it has been fully loaded, thus, the method must be called by the tile loaders.

See Also:
IlvTileLoader

notifyError

public void notifyError(Throwable errorReason)
Notifies the tile that an error occurred. This method fires a tile event for all listeners installed on the tile controller that the tile belongs to.

Parameters:
errorReason - The reason of the error

toString

public String toString()
Returns the tile description

Overrides:
toString in class Object


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