"WEBNMS_5 API Docs"

com.adventnet.nms.mapui
Class MapContainerComponent

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

public class MapContainerComponent
extends MapSymbolComponent
implements java.lang.Cloneable

A MapContainerComponent is one of the core objects of Map APIs. 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. This object inherits all the basic functionalities of MapSymbolComponent. In addition to this, the map container object is capable of encapsulating child map symbols into it (i.e) the map container object as the name suggests is a light weight component very similar to a java.awt.Container component in functionality. Each container object can have its own layout associated for its children. For example, a map can be constructed with four or five container objects in it each with different layouts. MapLinkComponent's across map containers is also possible. And a map container component can contain another map container component in turn.

Web NMS uses the MapContainerComponent 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 container gets associated with a managed object, the MapServer provides the MapContainerComponent with its inherent capability of automatically reflecting the current status of the associated managed object. MapModel is a subclass of the MapContainerComponent class.

See Also:
MapModel, MapSymbolComponent

Field Summary
 
Fields inherited from class com.adventnet.nms.mapui.MapSymbolComponent
anchored, dim, flash, groupName, iconName, label, mapHeight, mapName, mapWidth, menuName, name, objName, objType, objTypes, p, selected, status, userProperties, virtHeight, virtWidth, virtX, virtY, webNMS
 
Constructor Summary
MapContainerComponent()
          A Default constructor which initializes all properties to their default values.
 
Method Summary
 boolean addLink(MapLinkComponent childLink)
          Adds the given Maplink into the container .
 boolean addSymbol(MapSymbolComponent childSymbol)
          Adds the given MapSymbolComponent into the container.
 java.lang.Object clone()
          Returns a new MapSymbolComponent object which is a clone of this MapSymbolComponent.
 boolean deleteLink(MapLinkComponent childSymbol)
          Deletes the given Maplink from the container .
 boolean deleteLink(java.lang.String childLinkName)
          Deletes the Maplink identified by the given name from the container.
 boolean deleteSymbol(MapSymbolComponent childSymbol)
          Deletes the child MapSymbolComponent present in this container.
 boolean deleteSymbol(java.lang.String childSymbolName)
          Deletes the child MapSymbolComponent present in this container given its name.
 boolean getContainment()
          Returns the value of the containment property of the container.
 java.lang.String getCurrentTopology()
          Returns the value of the currentTopology property.
 java.util.Properties getCurrentTopologyProperties()
          Returns the current topology properties value.
 java.lang.String getLayout()
          Deprecated. Alternate method to use is getCurrentTopology()
 MapLinkComponent getLink(int position)
          Returns the MapLinkComponent Object present in this container at specified index .
 MapLinkComponent getLinkByName(java.lang.String childLinkName)
          Returns the child Map Link Object present in this container given its name.
 int getLinkCount()
          Returns the number of Map links present in this container.
 java.util.Vector getLinks()
          Returns a Vector of MapLinks present in this Map container.
 java.util.Properties getProperties()
          Returns the properties of the MapContainerComponent in the form of key-value pairs.
 java.lang.String getProperty(java.lang.String str)
          Returns the value of given property identified by the argument.
 MapSymbolComponent getSymbol(int position)
          Returns the child MapSymbolComponent Object present in this container at specified index .
 MapSymbolComponent getSymbolByName(java.lang.String childSymbolName)
          Gets the child MapSymbolComponent present in this container given its name.
 int getSymbolCount()
          Returns the number of Map Symbols present in this container.
 java.util.Vector getSymbols()
          Returns a Vector of MapSymbols present in this Map container.
 java.lang.String getTopology()
          Returns the value of the topology property of this container.
 boolean moveLinkTo(MapLinkComponent link, int index)
          Moves the given child link to the specified index.
 boolean moveSymbolTo(MapSymbolComponent symb, int index)
          Moves the given child symbol to the specified index.
 void setContainment(boolean value)
          Sets the value of the containment property.
 void setCurrentTopology(java.lang.String s)
          Sets the value of the currentTopology property.
 void setLayout(java.lang.String s)
          Deprecated. Alternate method to use is setCurrentTopology(String)
 void setProperties(java.util.Properties prop)
          Sets the given set of properties over the map container.
 void setTopology(java.lang.String s)
          Sets the value of the topology property of this container.
 
Methods inherited from class com.adventnet.nms.mapui.MapSymbolComponent
addObjTypes, downInStatusImage, getAnchored, getConnectedLinks, getD0, getGroupName, getHeight, getIconName, getIntObjType, getKey, getKeyName, getLabel, getLabelSize, getMapHeight, getMapName, getMapWidth, getMenuName, getName, getObjName, getObjType, getP0, getParent, getParentName, getPropForm, getPropForm, getSelected, getSeverityNames, getStatus, getStatusColor, getStatusInt, getStrObjType, getUserProperties, getUserProperty, getWebNMS, getWidth, getX, getY, PropAction, removeConnectedLink, removeUserProperty, setAnchored, setConnectedLink, setGroupName, setHeight, setIconName, setLabel, setLabelSize, setMapHeight, setMapName, setMapWidth, setMenuName, setName, setObjName, setObjType, setParameter, setParent, setParentName, setSelected, setStatus, setUserProperty, setValues, setWebNMS, setWidth, setX, setY, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapContainerComponent

public MapContainerComponent()
A Default constructor which initializes all properties to their default values.

Method Detail

setContainment

public void setContainment(boolean value)
Sets the value of the containment property. This property indicates whether the child map symbols will be enclosed within the bounds of the container or not. If this property is set to true, then the child symbols cannot be dragged out of the bounds of the parent container. Default value of this property is true.

Parameters:
value - the boolean value which is set to the containment property.
See Also:
getContainment()

getContainment

public boolean getContainment()
Returns the value of the containment property of the container. This property indicates whether the child map symbols will be enclosed within the bounds of the container or not. If this property is set to true, then the child symbols cannot be dragged out of the bounds of the parent container. Default value of this property is true.

Returns:
true if this object's containment property is true.
See Also:
setContainment(boolean)

getTopology

public java.lang.String getTopology()
Returns the value of the topology property of this container. This property signifies the possible layouts that could be applicable for this container. It should be seperated by commas. Some of the known layouts part of Web NMS are grid,star,ring,flow,etc. In addition to this, users can have their own implementation of layout. The values given should be equal to the string returned in the getName() method of the layout implementation. For example, a value of "grid,star,ring" would mean that only these three layouts can be applied. A value of "$grid" would mean that grid is the only possible layout for the container. A value of "grid" alone would result in all layouts being taken as applicable and grid being taken as the default one.

Default value of this property is grid.

Returns:
a String representing the Topology.
See Also:
AutoLayout.getName(), GridLayout, RingLayout, setTopology(java.lang.String)

getCurrentTopology

public java.lang.String getCurrentTopology()
Returns the value of the currentTopology property. This property is the default layout that should be taken from the list of applicable ones given part of the topology property.

Returns:
a String representing the current topology value for this MapContainerComponent
See Also:
setCurrentTopology(java.lang.String)

setTopology

public void setTopology(java.lang.String s)
Sets the value of the topology property of this container. This property signifies the possible layouts that could be applicable for the container. It should be seperated by commas. Some of the known layouts part of Web NMS are grid,star,ring,flow,etc. In addition to this, users can have their own implementation of layout. The values given should be equal to the string returned in the getName() method of the layout implementation. For example, a value of "grid,star,ring" would mean that only these three layouts can be applied. A value of "$grid" would mean that grid is the only possible layout for the map. A value of "grid" alone would result in all layouts being taken as applicable and grid being taken as the default one.

Parameters:
s - a String that is to be the topology for this container.
See Also:
AutoLayout.getName(), GridLayout, getTopology()

setCurrentTopology

public void setCurrentTopology(java.lang.String s)
Sets the value of the currentTopology property. This property is the default layout that should be taken from the list of applicable ones given part of the topology property.

Parameters:
s - a String specifying the current topology value to be set.
See Also:
getCurrentTopology()

setLayout

public void setLayout(java.lang.String s)
Deprecated. Alternate method to use is setCurrentTopology(String)

Sets the value of the currentTopology property.

Parameters:
s - a String specifying the layout value
See Also:
setCurrentTopology(String), getLayout()

getLayout

public java.lang.String getLayout()
Deprecated. Alternate method to use is getCurrentTopology()

Gets the value of the currentTopology property.

Returns:
a String representing the layout value
See Also:
getCurrentTopology(), setLayout(java.lang.String)

moveSymbolTo

public boolean moveSymbolTo(MapSymbolComponent symb,
                            int index)
Moves the given child symbol to the specified index. Index starts from zero.

Parameters:
symb - the MapSymbolComponent object that is to be moved.
index - an int specifying the position to which the symbol is to be moved.
Returns:
true if the symbol is moved to the specified index successfully.

moveLinkTo

public boolean moveLinkTo(MapLinkComponent link,
                          int index)
Moves the given child link to the specified index. Index starts from zero.

Parameters:
link - the MapLinkComponent object that is to be moved.
index - an int specifying the position to which the link is to be moved.
Returns:
true if the link is moved to the specified index successfully.

clone

public java.lang.Object clone()
Description copied from class: MapSymbolComponent
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 MapSymbolComponent

getLinks

public java.util.Vector getLinks()
Returns a Vector of MapLinks present in this Map container.

Returns:
a Vector of MapLinks present in this Map container.

addLink

public boolean addLink(MapLinkComponent childLink)
Adds the given Maplink into the container .

Parameters:
childLink - the MapLinkComponent object that is to be added to this Map container.
Returns:
true if the link is added successfully.

deleteLink

public boolean deleteLink(MapLinkComponent childSymbol)
Deletes the given Maplink from the container .

Parameters:
childSymbol - the MapLinkComponent object that is to be deleted.
Returns:
true if the link is successfully deleted.

deleteLink

public boolean deleteLink(java.lang.String childLinkName)
Deletes the Maplink identified by the given name from the container.

Parameters:
childLinkName - the name of the MapLinkComponent object that is to be deleted.
Returns:
true if the link is successfully deleted.

getLinkByName

public MapLinkComponent getLinkByName(java.lang.String childLinkName)
Returns the child Map Link Object present in this container given its name.

Parameters:
childLinkName - the name of the link that is to be fetched.
Returns:
the MapLinkComponent object for the specified name.

getLinkCount

public int getLinkCount()
Returns the number of Map links present in this container.

Returns:
an int representing the number of Map links present in this container.

getLink

public MapLinkComponent getLink(int position)
Returns the MapLinkComponent Object present in this container at specified index .

Parameters:
position - an int specifying the position from which the MapLinkComponent is to be fetched.
Returns:
the MapLinkComponent object at the specified position

getSymbols

public java.util.Vector getSymbols()
Returns a Vector of MapSymbols present in this Map container.

Returns:
a Vector of MapSymbols present in this Map container.

addSymbol

public boolean addSymbol(MapSymbolComponent childSymbol)
Adds the given MapSymbolComponent into the container.

Parameters:
childSymbol - the MapSymbolComponent that is to be added.
Returns:
true if the specified symbol is added successfully

deleteSymbol

public boolean deleteSymbol(java.lang.String childSymbolName)
Deletes the child MapSymbolComponent present in this container given its name.

Parameters:
childSymbolName - the name of the MapSymbolComponent that is to be deleted.
Returns:
true if the specified symbol is deleted successfully

deleteSymbol

public boolean deleteSymbol(MapSymbolComponent childSymbol)
Deletes the child MapSymbolComponent present in this container.

Parameters:
childSymbol - the MapSymbolComponent that is to be deleted.
Returns:
true if the specified symbol is deleted successfully

getSymbolByName

public MapSymbolComponent getSymbolByName(java.lang.String childSymbolName)
Gets the child MapSymbolComponent present in this container given its name.

Parameters:
childSymbolName - the name of the MapSymbolComponent that is to be fetched.
Returns:
the MapSymbolComponent object with the specified name.

getSymbolCount

public int getSymbolCount()
Returns the number of Map Symbols present in this container.

Returns:
an int representing the number of Map Symbols present in this container.

getSymbol

public MapSymbolComponent getSymbol(int position)
Returns the child MapSymbolComponent Object present in this container at specified index .

Parameters:
position - an int specifying the position from which the MapSymbolComponent is to be fetched.
Returns:
the MapSymbolComponent object at the specified index.

getProperty

public java.lang.String getProperty(java.lang.String str)
Returns the value of given property identified by the argument. The standard properties in addition to the map symbol properties will be the following.

"currentTopology", "containment", "topology" Other than these, user properties, if any, can be retrieved.

Overrides:
getProperty in class MapSymbolComponent
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.

getProperties

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

"currentTopology", "containment", "topology" Other than these, user properties, if any, will also be part of it.

Specified by:
getProperties in interface PropComponent
Overrides:
getProperties in class MapSymbolComponent
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)

setProperties

public void setProperties(java.util.Properties prop)
Sets the given set of properties over the map container. 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
Overrides:
setProperties in class MapSymbolComponent
See Also:
getProperties(), MapSymbolComponent.getProperties(), getProperties()

getCurrentTopologyProperties

public java.util.Properties getCurrentTopologyProperties()
Returns the current topology properties value.

Returns:
the Properties object representing the current topology properties for this container.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.