"WEBNMS_5 API Docs"

com.adventnet.nms.mapui
Interface MapSymbolRendererInterface


public interface MapSymbolRendererInterface

This MapSymbolRendererInterface defines how a MapSymbolComponent is to be represented in the Map . The style , shape and color of an Mapsymbol are specified by this interface .It also specifies the mouse down response for an MapSymbolComponent and its tool tip .The following is the sequence in which the methods of this interface will be invoked,
        1.paintShapeAndSeverity
        2.paintLabelString
        3.paintIcon While the user renders the MapSymbolComponent he/she should take care that the boundary of the MapSymbolComponent painted not to exceed the bounds specified by the Layout.The Map drawing engine calculates the clip area based on the bounds calculated by the Layout. So, if the user exceeds the bounds, then certain portion of the MapSymbolComponent will not be drawn which may lead to some undesirable painting.

See Also:
MapSymbolComponent, MapSymbolRendererImpl, MapSymbolRendererImpl_2, MapLinkRendererInterface, BasicMap.paintComponent(java.awt.Graphics)

Method Summary
 boolean downInObject(int x, int y, MapSymbolComponent symb)
          To determine if a mouse down is inside the Map Symbol.
 java.lang.String getToolTipText(MapSymbolComponent symb, int x, int y)
          This method is used to change the tool tip text of an Map Symbol.
 void paintIcon(java.awt.Graphics g, MapSymbolComponent mapSymbol, java.awt.Point location, java.awt.Dimension size, java.awt.image.ImageObserver io, java.awt.Image imageIcon, boolean selected)
          To paint Icon on the Map Symbol.
 void paintLabelString(java.awt.Graphics g, MapSymbolComponent mapSymbol, java.lang.String label, java.awt.Point location, java.awt.Font font)
          To draw a label string at the bottom of Map Symbol.
 void paintShapeAndSeverity(java.awt.Graphics g, MapSymbolComponent mapSymbol, java.awt.Point location, java.awt.Dimension size, java.awt.Color status, int objType)
          To paint Map Symbol Shape and Severity .
 

Method Detail

paintShapeAndSeverity

void paintShapeAndSeverity(java.awt.Graphics g,
                           MapSymbolComponent mapSymbol,
                           java.awt.Point location,
                           java.awt.Dimension size,
                           java.awt.Color status,
                           int objType)
To paint Map Symbol Shape and Severity .

Parameters:
g - - Graphics of MapSymbolComponent
mapSymbol - - Reference of MapSymbolComponent object
location - - Top Left Corner point of MapSymbolComponent
size - - Size of the map symbol
status - - color of map symbol with respect to the status
objType - - Type of map symbol object

paintIcon

void paintIcon(java.awt.Graphics g,
               MapSymbolComponent mapSymbol,
               java.awt.Point location,
               java.awt.Dimension size,
               java.awt.image.ImageObserver io,
               java.awt.Image imageIcon,
               boolean selected)
To paint Icon on the Map Symbol.

Parameters:
g - - Graphics of MapSymbolComponent
mapSymbol - - Reference of MapSymbolComponent object
location - - Top Left Corner point of MapIcon
size - - Size of the Map Icon
io - - ImageObserver
imageIcon - - Image to be displayed on the Map Symbol
selected - - Whether the symbol is selected or not

paintLabelString

void paintLabelString(java.awt.Graphics g,
                      MapSymbolComponent mapSymbol,
                      java.lang.String label,
                      java.awt.Point location,
                      java.awt.Font font)
To draw a label string at the bottom of Map Symbol.

Parameters:
g - - Graphics of MapSymbolComponent
mapSymbol - - Reference of MapSymbolComponent object
label - - String to be displayed
location - - Starting location of string
font - - Font type which is used to draw the label

getToolTipText

java.lang.String getToolTipText(MapSymbolComponent symb,
                                int x,
                                int y)
This method is used to change the tool tip text of an Map Symbol. The x and y are the real co-ordinate of the mouse. This has to be compared with MapSymbolComponent bounds. Use getP0 and getD0 to get bound of the MapSymbolComponent. This can be used to achieve multiple tool tip text for a MapSymbolComponent.

Parameters:
symb - -Reference of Map Symbol Object
x - The x co-ordiate of mouse with respect to the virtual space.
y - The y co-ordinate of mouse with respect to the virtual space.
Returns:
a String that is to be the tool tip for this MapSymbolComponent.
See Also:
MapSymbolComponent.getP0(), MapSymbolComponent.getD0()

downInObject

boolean downInObject(int x,
                     int y,
                     MapSymbolComponent symb)
To determine if a mouse down is inside the Map Symbol. The x and y are the real co-ordinate of the mouse. This has to be compared with MapSymbolComponent bounds. Use getP0 and getD0 to get bound of the MapSymbolComponent.

Parameters:
x - x co-ordinate of mouse event relative to the map
y - y co-ordinate of mouse event relative to the map
symb - Reference of Map Symbol Object
Returns:
a boolean true , if the mouse is down on the MapLinkComponent
See Also:
MapSymbolComponent.getP0(), MapSymbolComponent.getD0()

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.