|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ls.widgets.map.model.MapObject
public class MapObject
Constructor Summary | |
---|---|
MapObject(java.lang.Object id)
|
|
MapObject(java.lang.Object id,
Drawable drawable,
int x,
int y)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
int x,
int y,
boolean isTouchable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
int x,
int y,
boolean isTouchable,
boolean isScalable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
int x,
int y,
int pivotX,
int pivotY)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
int x,
int y,
int pivotX,
int pivotY,
boolean isTouchable,
boolean isScalable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position,
boolean isTouchable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position,
boolean isTouchable,
boolean isScalable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position,
Point pivotPoint)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position,
Point pivotPoint,
boolean isTouchable)
Creates new MapObject. |
|
MapObject(java.lang.Object id,
Drawable drawable,
Point position,
Point pivotPoint,
boolean isTouchable,
boolean isScalable)
Creates new MapObject. |
Method Summary | |
---|---|
void |
draw(Canvas canvas)
Draws the map object on the canvas |
boolean |
equals(java.lang.Object o)
|
Rect |
getBounds()
Returns bounds of the image that represents the map object. |
Drawable |
getDrawable()
Returns image that was passed to the constructor. |
java.lang.Object |
getId()
Returns id of this object |
Point |
getPosition()
Returns position of the map object in map coordinates in pixels of the original image. |
int |
getX()
Returns X coordinate of the map object in map coordinates. |
int |
getXScaled()
Returns X coordinate of the map object in map coordinates. |
int |
getY()
Returns Y coordinate of the map object in map coordinates. |
int |
getYScaled()
Returns Y coordinate of the map object in map coordinates. |
int |
hashCode()
|
boolean |
isTouchable()
Shows whether this object is touchable. |
boolean |
isTouched(Rect touchRect)
Determines whether touch rectangle intersects the bounds of this object. |
void |
moveTo(int x,
int y)
Moves object to another position on the map that is defined in pixels. |
void |
moveTo(Location location)
Moves object to another position on the map that is defined in pixels. |
void |
setDrawable(Drawable drawable)
Sets object's image. |
void |
setPivotPoint(int x,
int y)
Set's pivot point within the drawable |
void |
setPivotPoint(Point pivotPoint)
Set's pivot point within the drawable |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapObject(java.lang.Object id)
public MapObject(java.lang.Object id, Drawable drawable, int x, int y)
id
- - id of the object.drawable
- - image.x
- - x coordinate of the object in map coordinates.y
- - y coordinate of the object in map coordinates.public MapObject(java.lang.Object id, Drawable drawable, Point position)
id
- - id of the object.drawable
- - imageposition
- - coordinate of the object in map coordinates.public MapObject(java.lang.Object id, Drawable drawable, int x, int y, int pivotX, int pivotY)
id
- - id of the object.drawable
- - image.x
- - x coordinate of the object in map coordinates.y
- - y coordinate of the object in map coordinates.pivotX
- - x coordinate of pivot point in image coordinates.pivotY
- - y coordinate of pivot point in image coordinates.public MapObject(java.lang.Object id, Drawable drawable, Point position, Point pivotPoint)
id
- - id of the object.drawable
- - image.position
- - coordinate of the object in map coordinates.pivotPoint
- - coordinate of the pivot point in image coordinates.public MapObject(java.lang.Object id, Drawable drawable, int x, int y, boolean isTouchable)
id
- - id of the object.drawable
- - image.x
- - x coordinate of the object in map coordinates.y
- - y coordinate of the object in map coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, Point position, boolean isTouchable)
id
- - id of the object.drawable
- - image.position
- - coordinate of the object in map coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, Point position, Point pivotPoint, boolean isTouchable)
id
- - id of the object.drawable
- - image.position
- - coordinate of the object in map coordinates.pivotPoint
- - coordinate of the pivot point in image coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, int x, int y, boolean isTouchable, boolean isScalable)
id
- - id of the object.drawable
- - image.x
- - x coordinate of the object in map coordinates.y
- - y coordinate of the object in map coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.isScalable
- - true, if map object should be scaled on map zoom, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, Point position, boolean isTouchable, boolean isScalable)
id
- - id of the object.drawable
- - image.position
- - coordinate of the object in map coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.isScalable
- - true, if map object should be scaled on map zoom, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, Point position, Point pivotPoint, boolean isTouchable, boolean isScalable)
id
- - id of the object.drawable
- - image.position
- - coordinate of the object in map coordinates.pivotPoint
- - coordinate of the pivot point in image coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.isScalable
- - true, if map object should be scaled on map zoom, false otherwise.public MapObject(java.lang.Object id, Drawable drawable, int x, int y, int pivotX, int pivotY, boolean isTouchable, boolean isScalable)
id
- - id of the object.drawable
- - image.x
- - x coordinate of the object in map coordinates.y
- - y coordinate of the object in map coordinates.pivotX
- - x coordinate of pivot point in image coordinates.pivotY
- - y coordinate of pivot point in image coordinates.isTouchable
- - true if the object should respond to touch events, false otherwise.isScalable
- - true, if map object should be scaled on map zoom, false otherwise.Method Detail |
---|
public Drawable getDrawable()
public void setDrawable(Drawable drawable)
drawable
- instance of Drawable.
java.lang.IllegalArgumentException
- when null is set.public void draw(Canvas canvas)
canvas
- - Canvaspublic java.lang.Object getId()
public boolean isTouched(Rect touchRect)
touchRect
- - area inside of the map.
public int getXScaled()
public int getYScaled()
public int getX()
public int getY()
public Point getPosition()
android.graphics.Point
.public boolean isTouchable()
public void setPivotPoint(int x, int y)
x
- - x coordinate in pixelsy
- - y coordinate in pixelspublic void setPivotPoint(Point pivotPoint)
pivotPoint
- position of pivot point within the drawable.
java.lang.IllegalArgumentException
- if null is passedpublic Rect getBounds()
public void moveTo(int x, int y)
x
- - horizontal coordinate of the object within the map in pixels.y
- - vertical coordinate of the object within the map in pixels.public void moveTo(Location location)
location
- - location of the object.
java.lang.IllegalStateException
- if geo area is not configured in map.xml file.android.location.Location
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |