|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.adventnet.nms.mapui.MapSymbolComponent
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 |
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. |
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 |
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. |
com.adventnet.nms.mapui.PropForm |
getPropForm()
Returns the properties form of this MapSymbolComponent. |
com.adventnet.nms.mapui.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 . |
| Field Detail |
public static java.util.Properties objTypes
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.
objTypeprotected java.lang.String name
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.protected java.lang.String objName
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.protected java.lang.String mapName
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.protected double virtX
protected double virtY
protected double virtWidth
protected double virtHeight
protected java.awt.Point p
public int mapHeight
public int mapWidth
protected java.awt.Dimension dim
protected java.lang.String label
protected java.lang.String iconName
protected java.lang.String menuName
protected int objType
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.
objTypesprotected int status
objName,
com.adventnet.nms.mapui.MapSymbolComponent#setObjName()protected java.lang.String webNMS
protected java.lang.String groupName
MapGroupComponentprotected java.util.Properties userProperties
protected transient boolean selected
protected boolean anchored
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.
AutoLayout,
com.adventnet.nms.mapui.GridLayout,
com.adventnet.nms.mapui.StarLayout| Constructor Detail |
public MapSymbolComponent()
| Method Detail |
public static void addObjTypes(java.util.Properties p)
p - the Properties object for adding new objTypesobjTypepublic java.lang.String getName()
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.setName(java.lang.String)public void setName(java.lang.String s)
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.s - a String specifying the name to be set for the symbol.getName()public java.lang.String getObjName()
setObjName(java.lang.String)public void setObjName(java.lang.String s)
getKey()
method of ManagedObject.s - a String specifying the key string of the managed object which this symbol should represent.getObjName()public java.lang.String getMapName()
setMapName(java.lang.String)public void setMapName(java.lang.String s)
MapDB.getKey() method of MapDB.s - a String specifying the map name which is to be set.getMapName()public int getX()
setX(int)public int getY()
setY(int)public void setX(int i)
i - an int specifying the x coordinate of the location to be set.getX()public void setY(int i)
i - an int specifying the x coordinate of the location to be set.getY()public int getWidth()
setWidth(int)public int getHeight()
setHeight(int)public void setWidth(int i)
i - an int specifying the width valuegetWidth()public void setHeight(int i)
i - an int specifying the height valuegetHeight()public int getMapHeight()
public int getMapWidth()
public void setMapWidth(int width)
public void setMapHeight(int height)
public MapContainerComponent getParent()
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.
setParent(com.adventnet.nms.mapui.MapContainerComponent)public void setParent(MapContainerComponent p)
p - the parent MapContainerComponent Object.getParent()public java.lang.String getParentName()
setParentName(java.lang.String)public void setParentName(java.lang.String pName)
pName - a String specifying the parent name valuegetParentName()public java.lang.String getLabel()
setLabel(java.lang.String)public void setLabel(java.lang.String s)
s - a String specifying the label valuegetLabel()public java.lang.String getIconName()
setIconName(java.lang.String)public void setIconName(java.lang.String s)
s - a String specifying the icon name valuegetIconName()public java.lang.String getMenuName()
setMenuName(java.lang.String)public void setMenuName(java.lang.String s)
s - a String specifying the menu name valuegetMenuName()public int getObjType()
objType,
setObjType(int)public void setObjType(int s)
s - an int specifying the obj type valueobjType,
objTypes,
getObjType()public int getStatus()
status,
setStatus(int)public java.lang.String getWebNMS()
setWebNMS(java.lang.String)public void setWebNMS(java.lang.String s)
s - a String specifying the webNMS property valuegetWebNMS()public java.lang.String getGroupName()
MapGroupComponent,
setGroupName(java.lang.String)public void setGroupName(java.lang.String s)
s - a String specifying the group name valueMapGroupComponent,
getGroupName()public java.util.Properties getUserProperties()
userPropertiespublic void setConnectedLink(MapLinkComponent ml)
ml - MapLinkComponent which is connected to this MapSymbolComponent.public void removeConnectedLink(MapLinkComponent ml)
ml - MapLinkComponent which was connected to this MapSymbolComponent.public java.util.Vector getConnectedLinks()
public boolean getAnchored()
anchored,
setAnchored(boolean)public void setAnchored(boolean boo)
boo - boolean value which sets the anchored propertyanchored,
getAnchored()
public void setUserProperty(java.lang.String nam,
java.lang.String val)
nam - Name of the user property . It should be unique .val - Value of the user property .userProperties,
getUserProperty(java.lang.String)public java.lang.String getUserProperty(java.lang.String nam)
nam - name of the userProperty.userProperties,
setUserProperty(java.lang.String, java.lang.String)public java.lang.String removeUserProperty(java.lang.String nam)
nam - name of the userProperty to be removed.
public void setParameter(java.lang.String nam,
java.lang.String val)
nam - Name of the parameter.val - Value of the parameter.public void setValues()
public void setStatus(int val)
val - Integer value of the status.status,
getStatus()public static java.lang.String getStatusColor(int sev)
sev - Integer value of the severity .public static int getStatusInt(java.lang.String color)
color - a String representing the color.public java.awt.Dimension getD0()
Dimension of the MapSymbolComponent.public java.awt.Point getP0()
Position of the MapSymbolComponent.public void setSelected(boolean selected)
selected - true to make this object selectedgetSelected()public boolean getSelected()
setSelected(boolean)public java.util.Properties getProperties()
"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.
setProperties(java.util.Properties)public java.lang.String getProperty(java.lang.String str)
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.
String representing the value associated with the key
specified .It returns null when there is no such property.public void setProperties(java.util.Properties p)
getProperties(),
getProperties()public static int getIntObjType(java.lang.String type)
type - a String representing the type value.objType,
objTypespublic static java.lang.String getStrObjType(int objtype)
objtype - an integer assigned to the object typeString corresponding to the specified integer value
of the object type. If the given object type does not exist, this method returns nullobjType,
objTypespublic java.lang.String getKey()
name,
mapNamepublic java.lang.String getKeyName()
public java.lang.Object clone()
public com.adventnet.nms.mapui.PropForm getPropForm()
Object corresponding to this MapSymbolComponentpublic com.adventnet.nms.mapui.PropForm getPropForm(boolean addObjCall)
Object corresponding to this MapSymbolComponent
public boolean PropAction(java.awt.Event evt,
java.lang.Object arg)
public java.lang.String toString()
getKey()public void setLabelSize(java.awt.Rectangle obj)
obj - a Rectangle object corresponding to the required size of the labelgetLabelSize()public java.awt.Rectangle getLabelSize()
Rectangle object corresponding to the label size of this MapSymbol.setLabelSize(java.awt.Rectangle)protected java.lang.String[] getSeverityNames()
array of String objects representing the all configured severities.
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||