com.ls.widgets.map.model
Class MapLayer

java.lang.Object
  extended by com.ls.widgets.map.model.MapLayer
All Implemented Interfaces:
Layer

public class MapLayer
extends java.lang.Object
implements Layer


Constructor Summary
MapLayer(long theLayerId, MapWidget parent)
           
 
Method Summary
 void addMapObject(MapObject object)
          Adds map object to the layer.
 void clearAll()
          Removes all map objects from the layer.
 void draw(Canvas canvas, Rect drawingRect)
           
 boolean equals(java.lang.Object o)
           
 long getId()
           
 MapObject getMapObject(java.lang.Object id)
          Returns map object.
 MapObject getMapObjectByIndex(int index)
          Returns map object by index
 int getMapObjectCount()
          Returns the count of map objects on the layer
 java.util.ArrayList<java.lang.Object> getTouched(Rect touchRect)
          Returns Ids of map object that were touched.
 int hashCode()
           
 void invalidateDrawable(Drawable who)
           
 boolean isVisible()
          Shows whether the layer is visible or not.
 void removeMapObject(java.lang.Object id)
          Removes map object from the layer.
 void scheduleDrawable(Drawable who, java.lang.Runnable what, long when)
           
 void setScale(float scale)
           
 void setVisible(boolean visible)
          Sets layer visibility.
 void unscheduleDrawable(Drawable who, java.lang.Runnable what)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapLayer

public MapLayer(long theLayerId,
                MapWidget parent)
Method Detail

addMapObject

public void addMapObject(MapObject object)
Description copied from interface: Layer
Adds map object to the layer.

Specified by:
addMapObject in interface Layer
Parameters:
object - - map object.

getMapObject

public MapObject getMapObject(java.lang.Object id)
Description copied from interface: Layer
Returns map object.

Specified by:
getMapObject in interface Layer
Parameters:
id - - id of the map object.

getMapObjectByIndex

public MapObject getMapObjectByIndex(int index)
Description copied from interface: Layer
Returns map object by index

Specified by:
getMapObjectByIndex in interface Layer
Returns:
instance of MapObject

getMapObjectCount

public int getMapObjectCount()
Description copied from interface: Layer
Returns the count of map objects on the layer

Specified by:
getMapObjectCount in interface Layer
Returns:
number of map objects

removeMapObject

public void removeMapObject(java.lang.Object id)
Description copied from interface: Layer
Removes map object from the layer.

Specified by:
removeMapObject in interface Layer
Parameters:
id - - id of the map object.

getTouched

public java.util.ArrayList<java.lang.Object> getTouched(Rect touchRect)
Returns Ids of map object that were touched. Intended for internal use

Parameters:
touchRect -
Returns:

isVisible

public boolean isVisible()
Description copied from interface: Layer
Shows whether the layer is visible or not.

Specified by:
isVisible in interface Layer
Returns:
- true if layer is visible, false otherwise.

setVisible

public void setVisible(boolean visible)
Description copied from interface: Layer
Sets layer visibility.

Specified by:
setVisible in interface Layer
Parameters:
visible - - true if layer should be visible, false otherwise.

setScale

public void setScale(float scale)

draw

public void draw(Canvas canvas,
                 Rect drawingRect)

clearAll

public void clearAll()
Description copied from interface: Layer
Removes all map objects from the layer.

Specified by:
clearAll in interface Layer

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

scheduleDrawable

public void scheduleDrawable(Drawable who,
                             java.lang.Runnable what,
                             long when)

unscheduleDrawable

public void unscheduleDrawable(Drawable who,
                               java.lang.Runnable what)

invalidateDrawable

public void invalidateDrawable(Drawable who)

getId

public long getId()