com.nutiteq.components
Class PlaceIcon

java.lang.Object
  extended by com.nutiteq.components.PlaceIcon
All Implemented Interfaces:
Placemark

public class PlaceIcon
extends java.lang.Object
implements Placemark

Icon used for marking a place on map


Constructor Summary
PlaceIcon(Image icon)
          Create a icon object with default anchor point.
PlaceIcon(Image icon, int anchorX, int anchorY)
          Create a icon object with custom image placement.
 
Method Summary
 int getAnchorX(int zoom)
          Get placemarks relative position x
 int getAnchorY(int zoom)
          Get placemarks relative position y.
 int getHeight(int zoom)
          Get height of the placemark, based on current zoom level
 Image getIcon()
          Not part of public API
 int getWidth(int zoom)
          Get width of the placemark, based on current zoom level
 void paint(Graphics g, int screenX, int screenY, int zoom)
          Paint placemark to screen. screenX and screenY are 0, 0 for placemark.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaceIcon

public PlaceIcon(Image icon)
Create a icon object with default anchor point.

Parameters:
icon - image used for place marking

PlaceIcon

public PlaceIcon(Image icon,
                 int anchorX,
                 int anchorY)
Create a icon object with custom image placement. For example for balloon image, that should point to a place on map, bottom center should be defined as anchor point for correct image placement.

Parameters:
icon - place image
anchorX - x coordinate on icon anchor point
anchorY - y coordinate on icon anchor point
Method Detail

getIcon

public Image getIcon()
Not part of public API


getWidth

public int getWidth(int zoom)
Description copied from interface: Placemark
Get width of the placemark, based on current zoom level

Specified by:
getWidth in interface Placemark
Parameters:
zoom - view zoom level
Returns:
placemark width

getHeight

public int getHeight(int zoom)
Description copied from interface: Placemark
Get height of the placemark, based on current zoom level

Specified by:
getHeight in interface Placemark
Parameters:
zoom - view zoom level
Returns:
placemark height

getAnchorX

public int getAnchorX(int zoom)
Description copied from interface: Placemark
Get placemarks relative position x

Specified by:
getAnchorX in interface Placemark
Parameters:
zoom - current zoom level
Returns:
anchor x

getAnchorY

public int getAnchorY(int zoom)
Description copied from interface: Placemark
Get placemarks relative position y.

Specified by:
getAnchorY in interface Placemark
Parameters:
zoom - current zoom level
Returns:
anchor y

paint

public void paint(Graphics g,
                  int screenX,
                  int screenY,
                  int zoom)
Description copied from interface: Placemark
Paint placemark to screen. screenX and screenY are 0, 0 for placemark. How it should be placed on screen is calculated outside placemark based on placemark size and anchor point.

Specified by:
paint in interface Placemark
Parameters:
g - graphics object to paint on
screenX - x point to paint on screen
screenY - y point to paint on screen