com.nutiteq.components
Class PlaceLabel

java.lang.Object
  extended by com.nutiteq.components.PlaceLabel
All Implemented Interfaces:
Label

public class PlaceLabel
extends java.lang.Object
implements Label

Place label to be displayed on map if a place is highlighted.


Field Summary
static int DISPLAY_BOTTOM
          Display label on bottom of map componeny
static int DISPLAY_CENTER
          Display label on screen, right over the place.
static int DISPLAY_NONE
          Don't display label
static int DISPLAY_TOP
          Display label on top of map component
 
Constructor Summary
PlaceLabel(java.lang.String name)
          Create label with default display style (label displayed right over place on map)
PlaceLabel(java.lang.String label, int displayStyle)
          PlaceLabel constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getLabel()
          Not part of public API
 Point getViewUpdate(int screenX, int screenY, int displayWidth, int displayHeight)
          Get pixels needed for proper label display.
 int hashCode()
           
 void labelClicked(int screenX, int screenY, int displayWidth, int displayHeight, int clickX, int clickY)
          Notify label about the click and click location on screen
 void paint(com.nutiteq.wrappers.Graphics g, int screenX, int screenY, int displayWidth, int displayHeight)
          Not part of public API
 boolean pointOnLabel(int screenX, int screenY, int displayWidth, int displayHeight, int clickX, int clickY)
          Is given screen point on label
 void setZoom(int zoom)
           
 void setUsedIcon(Placemark icon)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DISPLAY_NONE

public static final int DISPLAY_NONE
Don't display label

See Also:
Constant Field Values

DISPLAY_CENTER

public static final int DISPLAY_CENTER
Display label on screen, right over the place.

See Also:
Constant Field Values

DISPLAY_BOTTOM

public static final int DISPLAY_BOTTOM
Display label on bottom of map componeny

See Also:
Constant Field Values

DISPLAY_TOP

public static final int DISPLAY_TOP
Display label on top of map component

See Also:
Constant Field Values
Constructor Detail

PlaceLabel

public PlaceLabel(java.lang.String label,
                  int displayStyle)
PlaceLabel constructor.

Parameters:
label - string label for place
displayStyle - display style for the label

PlaceLabel

public PlaceLabel(java.lang.String name)
Create label with default display style (label displayed right over place on map)

Parameters:
name - string label for place
Method Detail

getLabel

public java.lang.String getLabel()
Not part of public API

Specified by:
getLabel in interface Label
Returns:
label as string

paint

public void paint(com.nutiteq.wrappers.Graphics g,
                  int screenX,
                  int screenY,
                  int displayWidth,
                  int displayHeight)
Not part of public API

Specified by:
paint in interface Label
Parameters:
g - graphics object to be drawn on
screenX - place x location on screen
screenY - place y location on screen
displayWidth - available display width
displayHeight - available display height

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setUsedIcon

public void setUsedIcon(Placemark icon)

setZoom

public void setZoom(int zoom)

pointOnLabel

public boolean pointOnLabel(int screenX,
                            int screenY,
                            int displayWidth,
                            int displayHeight,
                            int clickX,
                            int clickY)
Description copied from interface: Label
Is given screen point on label

Specified by:
pointOnLabel in interface Label
Parameters:
screenX - place x location on screen
screenY - place y location on screen
displayWidth - available display width
displayHeight - available display height
clickX - point location x on display
clickY - point location y on display
Returns:
true if point on label

labelClicked

public void labelClicked(int screenX,
                         int screenY,
                         int displayWidth,
                         int displayHeight,
                         int clickX,
                         int clickY)
Description copied from interface: Label
Notify label about the click and click location on screen

Specified by:
labelClicked in interface Label
Parameters:
screenX - place x location on screen
screenY - place y location on screen
displayWidth - available display width
displayHeight - available display height
clickX - click location x on display
clickY - click location y on display

getViewUpdate

public Point getViewUpdate(int screenX,
                           int screenY,
                           int displayWidth,
                           int displayHeight)
Description copied from interface: Label
Get pixels needed for proper label display.

Specified by:
getViewUpdate in interface Label
Parameters:
screenX - object location x on screen
screenY - object location y on screen
displayWidth - available display width
displayHeight - available display height
Returns:
pixel (x/y) required for proper display