com.nutiteq.ui
Class DefaultCursor

java.lang.Object
  extended by com.nutiteq.ui.DefaultCursor
All Implemented Interfaces:
Cursor

public class DefaultCursor
extends java.lang.Object
implements Cursor

Default cursor implementation used in MapComponent. Paints a cross with width and height of 10 pixels. Default color used in library is red.


Constructor Summary
DefaultCursor(int cursorColor)
          Constructor for default cursor.
 
Method Summary
 Point getPointOnDisplay(int displayWidth, int displayHeight)
          Get the "e;select"e; point on screen for cursor.
 void paint(Graphics g, int screenX, int screenY, int displayWidth, int displayHeight)
          Paint cursor on the screen.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCursor

public DefaultCursor(int cursorColor)
Constructor for default cursor.

Parameters:
cursorColor - color for the cursor (in format 0xAARRGGBB)
Method Detail

paint

public void paint(Graphics g,
                  int screenX,
                  int screenY,
                  int displayWidth,
                  int displayHeight)
Description copied from interface: Cursor
Paint cursor on the screen. At the moment the "selection point" will be always in displayed objects (MapComponent or MapItem) center.

Specified by:
paint in interface Cursor
Parameters:
g - graphics object to paint on
screenX - cursor selection point x on screen
screenY - cursor selection point y on screen
displayWidth - displayed area (screen) width
displayHeight - displayed area (screen) height

getPointOnDisplay

public Point getPointOnDisplay(int displayWidth,
                               int displayHeight)
Description copied from interface: Cursor
Get the "e;select"e; point on screen for cursor. This point will be used for place/map clicks, etc.

Specified by:
getPointOnDisplay in interface Cursor
Parameters:
displayWidth - map view width
displayHeight - map view height
Returns:
point in pixels