"WEBNMS_5 API Docs"

com.adventnet.nms.mapui
Class MapSymbolComponent

java.lang.Object
  extended by com.adventnet.nms.mapui.MapSymbolComponent
All Implemented Interfaces:
PropComponent, java.lang.Cloneable
Direct Known Subclasses:
MapContainerComponent, MapGroupComponent, MapLinkComponent

public class MapSymbolComponent
extends java.lang.Object
implements PropComponent, java.lang.Cloneable

A MapSymbolComponent is one of the core objects of Map Client. It is an object having a graphical representation that can be displayed on the client map canvas and is capable of interacting with the user. MapSymbolComponent object is the base for all other objects that are displayed in the Map. Some examples are MapLinkComponents, MapContainerComponents, and MapGroupComponents.

Web NMS uses the MapSymbolComponent object as a graphical representation of the ManagedObject. A typical managed object could be the nodes, switches, routers, etc., in the network. Or even the cards and slots of the router could be the managed objects. Whatever be the case, once a map symbol gets associated with a managed object, the MapServer provides the MapSymbolComponent with its inherent capability of automatically reflecting the current status of the associated managed object.

It is a client-side counter part of the com.adventnet.nms.mapdb.MapSymbol.

 
Client-side Component Eqivalent server-side counter part
com.adventnet.nms.mapui.MapSymbolComponent com.adventnet.nms.mapdb.MapSymbol
com.adventnet.nms.mapui.MapLinkComponent com.adventnet.nms.mapdb.MapLink
com.adventnet.nms.mapui.MapContainerComponent com.adventnet.nms.mapdb.MapContainer
com.adventnet.nms.mapui.MapGroupComponent com.adventnet.nms.mapdb.MapGroup


Since:
Web NMS 2.3
See Also:
MapLinkComponent, MapContainerComponent, MapGroupComponent, MapSymbol

Field Summary
protected  boolean anchored
          This property indicates whether the symbol is anchored or not.
protected  java.awt.Dimension dim
          The dimension of the map symbol.
 int flash
           
protected  java.lang.String groupName
          This property holds the name of the MapGroupComponent to which this map symbol belongs to.
protected  java.lang.String iconName
          Path of the image file, with respect to the images directory, to be used as the icon for the map symbol.
protected  java.lang.String label
          The label of the map symbol.
 int mapHeight
           
protected  java.lang.String mapName
          The mapName property of MapSymbolComponent is the key string of the map it belongs to.
 int mapWidth
           
protected  java.lang.String menuName
          Path of the menu file, with respect to the mapdata/menus directory, to be used as the menu for the map symbol.
protected  java.lang.String name
          The name property of MapSymbolComponent is the key which uniquely identifies a symbol in a map.
protected  java.lang.String objName
          The objName property of MapSymbolComponent is the key string of the ManagedObject which this symbol represents.
protected  int objType
          The object type of this symbol.
static java.util.Properties objTypes
          This properties object holds the String to integer mapping between the defined object types of MapSymbolComponent.
protected  java.awt.Point p
          The location of the map symbol in the map canvas with respect to the virtual space.
protected  boolean selected
          This property indicates whether the map symbol is currently selected or deselected.
protected  int status
          This property is a reflection of the status of the managed object represented by this map symbol.
protected  java.util.Properties userProperties
          This property can be used by the API user to store his own custom properties into the map symbol object.
protected  double virtHeight
           
protected  double virtWidth
           
protected  double virtX
           
protected  double virtY
           
protected  java.lang.String webNMS
          This property is of no use now and is intended for some future implementations.
 
Constructor Summary
MapSymbolComponent()
          Default constructor.
 
Method Summary
static void addObjTypes(java.util.Properties p)
          Adds new object types.
 java.lang.Object clone()
          Returns a new MapSymbolComponent object which is a clone of this MapSymbolComponent.
 boolean downInStatusImage(int x, int y, MapModel model, java.awt.Image image)
          To determine if a mouse down is inside the Status Image of the symbol
 boolean getAnchored()
          Returns true when the symbol is anchored.
 java.util.Vector getConnectedLinks()
          Returns a vector containg all MapLinkComponents connected to this MapSymbolComponent.
 java.awt.Dimension getD0()
          Gets the dimension of the MapSymbolComponent with respect to window size.
 java.lang.String getGroupName()
          Returns the name of the map group to which this object belongs to.
 int getHeight()
          Gets the height of the symbol.
 java.lang.String getIconName()
          Returns the path of the image file used as the icon for the map symbol.
static int getIntObjType(java.lang.String type)
          Returns the integer value of the corresponding object type of the given name.
 java.lang.String getKey()
          Returns the key of this Map Symbol Object.
 java.lang.String getKeyName()
          Returns the description of what the key comprises of.
 java.lang.String getLabel()
          Returns the label of the map symbol.
 java.awt.Rectangle getLabelSize()
          Gets the enclosing size of the map symbol's label.
 int getMapHeight()
           
 java.lang.String getMapName()
          Returns the key string of the map to which the symbol belongs to.
 int getMapWidth()
           
 java.lang.String getMenuName()
          Returns the path of the menu file used as the menu for the map symbol.
 java.lang.String getName()
          Returns the name of the map symbol.
 java.lang.String getObjName()
          Returns the key string of the managed object which this symbol represents.
 int getObjType()
          Returns the object type of this symbol.
 java.awt.Point getP0()
          Gets the position of the MapSymbolComponent with respect to window size.
 MapContainerComponent getParent()
          Returns the parent map symbol object of this map symbol.
 java.lang.String getParentName()
          Returns the name of the parent map container object.
 java.util.Properties getProperties()
          Returns the properties of the MapSymbolComponent in the form of key-value pairs.
 java.lang.String getProperty(java.lang.String str)
          Returns the value associated with the given property key.
 PropForm getPropForm()
          Returns the properties form of this MapSymbolComponent.
 PropForm getPropForm(boolean addObjCall)
          Returns the properties form of this MapSymbolComponent .
 boolean getSelected()
          Returns whether the symbol is selected or not .
protected  java.lang.String[] getSeverityNames()
          Uses Severity API and returns the names of all the configured severities except severities of type 'info'.
 int getStatus()
          Returns the status of the underlying managed object.
static java.lang.String getStatusColor(int sev)
          Returns the name of the severity given its integer equivalent.
static int getStatusInt(java.lang.String color)
          Deprecated. As of version Web NMS 2.2
static java.lang.String getStrObjType(int objtype)
          Returns the string equivalent of the given object type.
 java.util.Properties getUserProperties()
          Returns the user properties associated with this map symbol.
 java.lang.String getUserProperty(java.lang.String nam)
          Returns the user property value corresponding to the key given as argument.
 java.lang.String getWebNMS()
          This method is of no use now and is intended for some future implementations.
 int getWidth()
          Gets the width of the symbol .
 int getX()
          Returns the x coordinate of the location.
 int getY()
          Returns the y coordinate of the location.
 boolean PropAction(java.awt.Event evt, java.lang.Object arg)
          This Function is called from the properties form when the user clicks OK button.
 void removeConnectedLink(MapLinkComponent ml)
          Removes the specified MapLinkComponent objects from the linksConnected vector.
 java.lang.String removeUserProperty(java.lang.String nam)
          Removes the user property of the given name.
 void setAnchored(boolean boo)
          Sets the given value as the value of the anchored property.
 void setConnectedLink(MapLinkComponent ml)
          Adds the specified MapLinkComponent objects to the linksConnected vector.
 void setGroupName(java.lang.String s)
          Sets the given string as the name of the map group to which this object should belong to.
 void setHeight(int i)
          Sets the height of the symbol .
 void setIconName(java.lang.String s)
          Sets the given string as the path of the image file to be used as the icon for the map symbol.
 void setLabel(java.lang.String s)
          Sets the label of the map symbol to the given string.
 void setLabelSize(java.awt.Rectangle obj)
          Sets the enclosing size of the map symbol's label.
 void setMapHeight(int height)
           
 void setMapName(java.lang.String s)
          Sets the symbol's map name to the given key string.
 void setMapWidth(int width)
           
 void setMenuName(java.lang.String s)
          Sets the given string as the path of the menu file to be used as the menu for the map symbol.
 void setName(java.lang.String s)
          Sets the map symbol's name to the given name.
 void setObjName(java.lang.String s)
          Sets the key string of the managed object which this symbol should represent.
 void setObjType(int s)
          Sets the object type to the given value.
 void setParameter(java.lang.String nam, java.lang.String val)
          This method sets the symbol parameters based on specified name and value.
 void setParent(MapContainerComponent p)
          Sets the parent of this symbol to the given map container.
 void setParentName(java.lang.String pName)
          Sets the given name as the parent name of this map symbol.
 void setProperties(java.util.Properties p)
          Sets the given set of properties over the map symbol.
 void setSelected(boolean selected)
          Sets the selected property to the given value.
 void setStatus(int val)
          Sets the status of the MapSymbolComponent.
 void setUserProperty(java.lang.String nam, java.lang.String val)
          Adds or updates any user property.
 void setValues()
          This method does not have much significance.
 void setWebNMS(java.lang.String s)
          This method is of no use now and is intended for some future implementations.
 void setWidth(int i)
          Sets the width of the symbol .
 void setX(int i)
          Sets the x coordinate of the location.
 void setY(int i)
          Sets the y coordinate of the location.
 java.lang.String toString()
          Returns the key of this MapSymbolComponent .
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

flash

public int flash

objTypes

public static java.util.Properties objTypes
This properties object holds the String to integer mapping between the defined object types of MapSymbolComponent. By default there are six object types defined in MapIcon.data, viz., "symbol", "node", "network", "gateway", "sub-symbol", "site". Their integer equivalents are "0", "1", "2", "3", "4", "5" respectively. The keys of this properties object will be the name assigned to the object type and the corresponding values will be their integer equivalents in the form of strings. Note that the key and the value should be unique. That is, no two objTypes can exist of the same name or of the same integer value.

This object will be of use to the API users in cases where the String to integer mapping of the object types needs to be known programmatically. Even this object could be used to add new objTypes at run time. But those newly added types will not be persistent. So, adding new objTypes at runtime can be of momentary use in dynamically created non persistent maps on the client side.

See Also:
objType

name

protected java.lang.String name
The name property of MapSymbolComponent is the key which uniquely identifies a symbol in a map. That is, in a map no two map symbols, map links, map groups, or map containers can have the same name. This constraint needs to be taken care of while adding symbols into a map.


objName

protected java.lang.String objName
The objName property of MapSymbolComponent is the key string of the ManagedObject which this symbol represents. The ManagedObject key string could be obtained using the ManagedObject.getKey() method of ManagedObject.


mapName

protected java.lang.String mapName
The mapName property of MapSymbolComponent is the key string of the map it belongs to. The key string of map is the name of the map. It can be obtained using the getKey() method of MapDB.


virtX

protected double virtX

virtY

protected double virtY

virtWidth

protected double virtWidth

virtHeight

protected double virtHeight

p

protected java.awt.Point p
The location of the map symbol in the map canvas with respect to the virtual space.


mapHeight

public int mapHeight

mapWidth

public int mapWidth

dim

protected java.awt.Dimension dim
The dimension of the map symbol. The default value is initialized to 75 x 75.


label

protected java.lang.String label
The label of the map symbol. Initialized to "Symbol" by default.


iconName

protected java.lang.String iconName
Path of the image file, with respect to the images directory, to be used as the icon for the map symbol.


menuName

protected java.lang.String menuName
Path of the menu file, with respect to the mapdata/menus directory, to be used as the menu for the map symbol. Note that the path should not have the extension .menu or .xml in it. For example, when snmpmenu.xml is to be set, then set this property to "snmpmenu".


objType

protected int objType
The object type of this symbol. This integer is a means of knowing what type of device the symbol represents. Depending on the value of this property, the map symbol renderer could paint the symbol accordingly. Default value is 1, meaning "node".

Web NMS by default uses six object types, viz., "symbol", "node", "network", "gateway", "sub-symbol", "site" . Their integer equivalents are 0, 1, 2, 3, 4, 5 respectively. Apart from these set of values, users could add their own object types by configuring mapIcon.data. So, the valid values for this property could be any of the standard object types or one of the configured ones.

See Also:
objTypes

status

protected int status
This property is a reflection of the status of the managed object represented by this map symbol. API users needn't set this property while adding or updating a map symbol. Once the symbol is associated with some managed object, Web NMS takes care of setting this property to the current status of the managed object.

See Also:
objName, com.adventnet.nms.mapui.MapSymbolComponent#setObjName()

webNMS

protected java.lang.String webNMS
This property is of no use now and is intended for some future implementations.


groupName

protected java.lang.String groupName
This property holds the name of the MapGroupComponent to which this map symbol belongs to.

See Also:
MapGroupComponent

userProperties

protected java.util.Properties userProperties
This property can be used by the API user to store his own custom properties into the map symbol object. This object will be null when there is no user property.


selected

protected transient boolean selected
This property indicates whether the map symbol is currently selected or deselected.


anchored

protected boolean anchored
This property indicates whether the symbol is anchored or not. This property gets set when the user tries to move the symbol on the map canvas. So, once this is set, the layout implementation should take care that whether it can override the user intervention or not. By default, all layouts (GridLayout, StarLayout, RingLayout, EthernetLayout,etc ) provided part of this product takes care of not intervening with the user preferred placement of the symbol on the canvas. That is, the layouts check whether the symbol has been repositioned by the user and if so, it does not touch the coordinates and dimension of those symbols. It is left to the layout implementation to decide what to do.

An important thing to note is that when the user saves the map using the client, the anchored property of all the symbols in the map are set to true, meaning they get anchored to the positions where they have been placed.

See Also:
AutoLayout, GridLayout, StarLayout
Constructor Detail

MapSymbolComponent

public MapSymbolComponent()
Default constructor. Initializes all properties to their default values.

Method Detail

addObjTypes

public static void addObjTypes(java.util.Properties p)
Adds new object types. The Properties object argument should contain the string to integer mapping. Adding new objTypes at run time will not be persistent. So, it cannot be used on the server side. But it can be of momentary use in dynamically created non persistent maps on the client side. Users could also statically add custom objType definitions using the mapIcon.data configuration file. Object types added statically through this way of configuration are persistent across runs of the server and client.

Parameters:
p - the Properties object for adding new objTypes
See Also:
objType

getName

public java.lang.String getName()
Returns the name of the map symbol. The name property of MapSymbolComponent is the key which uniquely identifies a symbol in a map. That is, in a map, no two map symbols, map links, map groups, or map containers can have the same name. This constraint needs to be taken care while adding symbols into a map.

Returns:
a String representing the name of the map symbol.
See Also:
setName(java.lang.String)

setName

public void setName(java.lang.String s)
Sets the map symbol's name to the given name. The name property of MapSymbolComponent is the key which uniquely identifies a symbol in a map. That is, in a map, no two map symbols, map links, map groups, or map containers can have the same name. This constraint needs to be taken care while adding symbols into a map.

Parameters:
s - a String specifying the name to be set for the symbol.
See Also:
getName()

getObjName

public java.lang.String getObjName()
Returns the key string of the managed object which this symbol represents. Returns null when no managed object is associated with it.

Returns:
a String representing the key string of the managed object which this symbol represents.
See Also:
setObjName(java.lang.String)

setObjName

public void setObjName(java.lang.String s)
Sets the key string of the managed object which this symbol should represent. The ManagedObject key string could be obtained using the getKey() method of ManagedObject.

Parameters:
s - a String specifying the key string of the managed object which this symbol should represent.
See Also:
getObjName()

getMapName

public java.lang.String getMapName()
Returns the key string of the map to which the symbol belongs to.

Returns:
a String representing the key string of the map to which the symbol belongs to.
See Also:
setMapName(java.lang.String)

setMapName

public void setMapName(java.lang.String s)
Sets the symbol's map name to the given key string. The key string of map is the name of the map. It can be obtained using the MapDB.getKey() method of MapDB.

Parameters:
s - a String specifying the map name which is to be set.
See Also:
getMapName()

getX

public int getX()
Returns the x coordinate of the location.

Returns:
an int representing the x coordinate of the location.
See Also:
setX(int)

getY

public int getY()
Returns the y coordinate of the location.

Returns:
an int representing the x coordinate of the location.
See Also:
setY(int)

setX

public void setX(int i)
Sets the x coordinate of the location.

Parameters:
i - an int specifying the x coordinate of the location to be set.
See Also:
getX()

setY

public void setY(int i)
Sets the y coordinate of the location.

Parameters:
i - an int specifying the x coordinate of the location to be set.
See Also:
getY()

getWidth

public int getWidth()
Gets the width of the symbol .

Returns:
an int representing the width value
See Also:
setWidth(int)

getHeight

public int getHeight()
Gets the height of the symbol.

Returns:
an int representing the height value
See Also:
setHeight(int)

setWidth

public void setWidth(int i)
Sets the width of the symbol .

Parameters:
i - an int specifying the width value
See Also:
getWidth()

setHeight

public void setHeight(int i)
Sets the height of the symbol .

Parameters:
i - an int specifying the height value
See Also:
getHeight()

getMapHeight

public int getMapHeight()

getMapWidth

public int getMapWidth()

setMapWidth

public void setMapWidth(int width)

setMapHeight

public void setMapHeight(int height)

getParent

public MapContainerComponent getParent()
Returns the parent map symbol object of this map symbol. This method will return a non-null map container object only for those symbols that are added into some container in the map. And it will return null for those map symbols which are added directly into the map and not into any container (i.e) those symbols that are added at the base level will return null.

Note that this method will always return null on the server side. This is because when the map symbol object is retrieved from the database using the MapAPI, the parentName property alone gets set. And the parent mapcontainer object is not retrieved. So, usage of this method is valid only on the client side.

Returns:
the MapContainerComponent Object which is the parent of this symbol.
See Also:
setParent(com.adventnet.nms.mapui.MapContainerComponent)

setParent

public void setParent(MapContainerComponent p)
Sets the parent of this symbol to the given map container. This method should not be used over symbols that are added into the base level of map. Before setting this, the API user has to ensure that the given parent map container is already added into the map. Where can it be used ?? Server // client

Parameters:
p - the parent MapContainerComponent Object.
See Also:
getParent()

getParentName

public java.lang.String getParentName()
Returns the name of the parent map container object. This method returns null for those map symbols added to the base level of the map.

Returns:
the name of the parent map container if the symbol has any parent, else returns null.
See Also:
setParentName(java.lang.String)

setParentName

public void setParentName(java.lang.String pName)
Sets the given name as the parent name of this map symbol. Before setting this, the API user has to ensure that the parent map container of the given name is already added into the map.

Parameters:
pName - a String specifying the parent name value
See Also:
getParentName()

getLabel

public java.lang.String getLabel()
Returns the label of the map symbol.

Returns:
a String representing the label value
See Also:
setLabel(java.lang.String)

setLabel

public void setLabel(java.lang.String s)
Sets the label of the map symbol to the given string.

Parameters:
s - a String specifying the label value
See Also:
getLabel()

getIconName

public java.lang.String getIconName()
Returns the path of the image file used as the icon for the map symbol. The default value is pc.png

Returns:
a String representing the path of the image file used as the icon for the map symbol.
See Also:
setIconName(java.lang.String)

setIconName

public void setIconName(java.lang.String s)
Sets the given string as the path of the image file to be used as the icon for the map symbol. The default value is pc.png

Parameters:
s - a String specifying the icon name value
See Also:
getIconName()

getMenuName

public java.lang.String getMenuName()
Returns the path of the menu file used as the menu for the map symbol.

Returns:
a String representing the menu name value
See Also:
setMenuName(java.lang.String)

setMenuName

public void setMenuName(java.lang.String s)
Sets the given string as the path of the menu file to be used as the menu for the map symbol. Note that the path should be relative to the mapdata/menus directory. And it should not have the extension .menu or .xml in it. For example, when snmpmenu.xml is to be set, then set this property to just "snmpmenu".

Parameters:
s - a String specifying the menu name value
See Also:
getMenuName()

getObjType

public int getObjType()
Returns the object type of this symbol. Object type is a means of knowing what type of device the symbol represents. Depending on the value of this property, the map symbol renderer could paint the symbol accordingly.

Returns:
an int representing the obj type value
See Also:
objType, setObjType(int)

setObjType

public void setObjType(int s)
Sets the object type to the given value. Please look into the See Also link for more details on the valid values.

Parameters:
s - an int specifying the obj type value
See Also:
objType, objTypes, getObjType()

getStatus

public int getStatus()
Returns the status of the underlying managed object.

Returns:
an int representing the status value
See Also:
status, setStatus(int)

getWebNMS

public java.lang.String getWebNMS()
This method is of no use now and is intended for some future implementations.

Returns:
a String representing the webNMS property value
See Also:
setWebNMS(java.lang.String)

setWebNMS

public void setWebNMS(java.lang.String s)
This method is of no use now and is intended for some future implementations.

Parameters:
s - a String specifying the webNMS property value
See Also:
getWebNMS()

getGroupName

public java.lang.String getGroupName()
Returns the name of the map group to which this object belongs to.

Returns:
a String representing the group name value
See Also:
MapGroupComponent, setGroupName(java.lang.String)

setGroupName

public void setGroupName(java.lang.String s)
Sets the given string as the name of the map group to which this object should belong to. Before setting this, the API user has to make sure that such a map group exists in the map.

Parameters:
s - a String specifying the group name value
See Also:
MapGroupComponent, getGroupName()

getUserProperties

public java.util.Properties getUserProperties()
Returns the user properties associated with this map symbol.

Returns:
the set of user properties. Returns null when there is no user property.
See Also:
userProperties

setConnectedLink

public void setConnectedLink(MapLinkComponent ml)
Adds the specified MapLinkComponent objects to the linksConnected vector. This is used internally by the Web NMS.

Parameters:
ml - MapLinkComponent which is connected to this MapSymbolComponent.

removeConnectedLink

public void removeConnectedLink(MapLinkComponent ml)
Removes the specified MapLinkComponent objects from the linksConnected vector. This is used internally by the Web NMS.

Parameters:
ml - MapLinkComponent which was connected to this MapSymbolComponent.

getConnectedLinks

public java.util.Vector getConnectedLinks()
Returns a vector containg all MapLinkComponents connected to this MapSymbolComponent. This is used internally by the Web NMS.

Returns:
a vector containing all connected MapLinkComponents

getAnchored

public boolean getAnchored()
Returns true when the symbol is anchored. Please check out the See Also link for more details.

Returns:
true if this object is anchored
See Also:
anchored, setAnchored(boolean)

setAnchored

public void setAnchored(boolean boo)
Sets the given value as the value of the anchored property. Please check out the See Also link for more details.

Parameters:
boo - boolean value which sets the anchored property
See Also:
anchored, getAnchored()

setUserProperty

public void setUserProperty(java.lang.String nam,
                            java.lang.String val)
Adds or updates any user property.

Parameters:
nam - Name of the user property . It should be unique .
val - Value of the user property .
See Also:
userProperties, getUserProperty(java.lang.String)

getUserProperty

public java.lang.String getUserProperty(java.lang.String nam)
Returns the user property value corresponding to the key given as argument.

Parameters:
nam - name of the userProperty.
Returns:
the user property value if one exists, else returns null
See Also:
userProperties, setUserProperty(java.lang.String, java.lang.String)

removeUserProperty

public java.lang.String removeUserProperty(java.lang.String nam)
Removes the user property of the given name.

Parameters:
nam - name of the userProperty to be removed.
Returns:
the user property value if it is removed successfully, else returns null

setParameter

public void setParameter(java.lang.String nam,
                         java.lang.String val)
This method sets the symbol parameters based on specified name and value. The following are the recognized parameter names: "label","name","mapName","status", "iconName","objName","menuName","objType", "groupName","x","y","width","height", " WebNMS","parentName","anchored" Other parameters given will be considered as user properties.

Parameters:
nam - Name of the parameter.
val - Value of the parameter.

setValues

public void setValues()
This method does not have much significance. Not for external use.

Specified by:
setValues in interface PropComponent

setStatus

public void setStatus(int val)
Sets the status of the MapSymbolComponent. Please check out the See Also link for more details.

Parameters:
val - Integer value of the status.
See Also:
status, getStatus()

getStatusColor

public static java.lang.String getStatusColor(int sev)
Returns the name of the severity given its integer equivalent. This depends on the configuration in the SeverityInfo.conf. For example, it will return "critical" for 1 (by default).

Parameters:
sev - Integer value of the severity .
Returns:
a String representing the name of the severity for the specified integer equivalent.

getStatusInt

public static int getStatusInt(java.lang.String color)
Deprecated. As of version Web NMS 2.2

Returns the integer associated with the severity of given name. This method is deprecated. So, it is better to use the SeverityAPI classes directly.

Parameters:
color - a String representing the color.
Returns:
an int associated with the severity of specified name.

getD0

public java.awt.Dimension getD0()
Gets the dimension of the MapSymbolComponent with respect to window size.

Returns:
Dimension of the MapSymbolComponent.

getP0

public java.awt.Point getP0()
Gets the position of the MapSymbolComponent with respect to window size.

Returns:
A Position of the MapSymbolComponent.

downInStatusImage

public boolean downInStatusImage(int x,
                                 int y,
                                 MapModel model,
                                 java.awt.Image image)
To determine if a mouse down is inside the Status Image of the symbol


setSelected

public void setSelected(boolean selected)
Sets the selected property to the given value. Invoking this method will not select the symbol. It just changes the property value. Yet to be implemented.

Parameters:
selected - true to make this object selected
See Also:
getSelected()

getSelected

public boolean getSelected()
Returns whether the symbol is selected or not .

Returns:
true if this object is selected
See Also:
setSelected(boolean)

getProperties

public java.util.Properties getProperties()
Returns the properties of the MapSymbolComponent in the form of key-value pairs. The standard properties returned will be the following.

"label", "name", "mapName", "status", "iconName", "objName", "menuName", "objType", "groupName", "x", "y", "width", "height", "webNMS", "parentName", "anchored". Other than these, user properties, if any, will also be part of it.

Specified by:
getProperties in interface PropComponent
Returns:
a Properties object containing the keys as the property names as mentioned above and the values as corresponding property values.
See Also:
setProperties(java.util.Properties)

getProperty

public java.lang.String getProperty(java.lang.String str)
Returns the value associated with the given property key.

Parameters:
str - a String representing the key of the Map Symbol Property. Valid values for this argument could be any of the following.

"label", "name", "mapName", "status", "iconName", "objName", "menuName", "objType", "groupName", "x", "y", "width", "height", "webNMS", "parentName", "anchored". Other than these, user property keys, if any, can also be given.

Returns:
a String representing the value associated with the key specified .It returns null when there is no such property.

setProperties

public void setProperties(java.util.Properties p)
Sets the given set of properties over the map symbol. The given set of property keys could be one of the standard properties described in the getProperties() method or it could even be some user property key.

Specified by:
setProperties in interface PropComponent
See Also:
getProperties(), getProperties()

getIntObjType

public static int getIntObjType(java.lang.String type)
Returns the integer value of the corresponding object type of the given name. Please have a look into the below See Also link for more details.

Parameters:
type - a String representing the type value.
Returns:
the integer value of the corresponding object type of the given name
See Also:
objType, objTypes

getStrObjType

public static java.lang.String getStrObjType(int objtype)
Returns the string equivalent of the given object type. Please have a look into the below See Also link for more details.

Parameters:
objtype - an integer assigned to the object type
Returns:
aString corresponding to the specified integer value of the object type. If the given object type does not exist, this method returns null
See Also:
objType, objTypes

getKey

public java.lang.String getKey()
Returns the key of this Map Symbol Object. This is the one which uniquely identifies the symbol across all maps. The key is actually a combination of the map symbol's name and its map name with a separator(tab) in between them.

Returns:
the key of the Map Symbol. The key will be of the format name + "\t" + mapName. For example, it will be a string like "reddy"+"\t"+"US-Map.netmap"
See Also:
name, mapName

getKeyName

public java.lang.String getKeyName()
Returns the description of what the key comprises of.

Returns:
the key Name. The key name will be "name"+"\t"+"mapName"

clone

public java.lang.Object clone()
Returns a new MapSymbolComponent object which is a clone of this MapSymbolComponent. The resulting cloned object has all the properties same as of this MapSymbolComponent.

Overrides:
clone in class java.lang.Object

getPropForm

public PropForm getPropForm()
Returns the properties form of this MapSymbolComponent. This is used internally by the Web NMS.

Specified by:
getPropForm in interface PropComponent
Returns:
a PropForm Object corresponding to this MapSymbolComponent

getPropForm

public PropForm getPropForm(boolean addObjCall)
Returns the properties form of this MapSymbolComponent . This is used internally by the Web NMS. Not for external use.

Returns:
a PropForm Object corresponding to this MapSymbolComponent

PropAction

public boolean PropAction(java.awt.Event evt,
                          java.lang.Object arg)
This Function is called from the properties form when the user clicks OK button. This is used internally by the Web NMS. Not for external use

Specified by:
PropAction in interface PropComponent

toString

public java.lang.String toString()
Returns the key of this MapSymbolComponent .

Overrides:
toString in class java.lang.Object
See Also:
getKey()

setLabelSize

public void setLabelSize(java.awt.Rectangle obj)
Sets the enclosing size of the map symbol's label.

Parameters:
obj - a Rectangle object corresponding to the required size of the label
See Also:
getLabelSize()

getLabelSize

public java.awt.Rectangle getLabelSize()
Gets the enclosing size of the map symbol's label.

Returns:
a Rectangle object corresponding to the label size of this MapSymbol.
See Also:
setLabelSize(java.awt.Rectangle)

getSeverityNames

protected java.lang.String[] getSeverityNames()
Uses Severity API and returns the names of all the configured severities except severities of type 'info'. This is just a convenience method for internal purposes.

Returns:
an array of String objects representing the all configured severities.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.