"WEBNMS_5 API Docs"

com.adventnet.nms.mapdb
Class MapContainer

java.lang.Object
  extended by com.adventnet.nms.mapdb.MapSymbol
      extended by com.adventnet.nms.mapdb.MapContainer
All Implemented Interfaces:
DBExtendedInterface, DBInterface, java.io.Serializable, java.lang.Cloneable

public class MapContainer
extends MapSymbol

MapContainer is one of the core objects of map server. It extends MapSymbol. Its client side equivalent is MapContainerComponent. This object is capable of encapsulating child map symbols into itself. MapContainer, as the name suggests, is a light weight component very similar in functionality to a java.awt.Container component. Each container object can have its own layout associated with its children.

For example, a map can be constructed with four or five container objects in it, each with different layouts. Map links across MapContainers are also possible. A MapContainer can also contain a MapContainer within itself.

The MapContainer can also be a representation of a ManagedObject. Though it sounds logical to make MapContainer represent ManagedObjects which are containers, and ContainerInterface objects only, it can be associated with any ManagedObject present in the database.

The MapContainer object provides persistence through the relational database storage. Being a MapSymbol, it can hold user properties too. The standard properties of this object are stored in the MapContainer table, whereas all the user properties are stored in MAPUSERPROPS table.

See Also:
Serialized Form

Field Summary
protected  boolean containment
          Holds the containment boolean.
protected  java.lang.String currentTopology
          Holds the value of the current topology that will be applied for the map.
protected  java.lang.String topology
          Holds a comma separated list of all the layouts applicable to this objects.
 
Fields inherited from class com.adventnet.nms.mapdb.MapSymbol
anchored, groupName, iconName, id, label, locationX, locationY, mapHeight, mapName, mapWidth, menuName, name, objName, objType, objTypes, ownerName, parentName, status, symbolHeight, symbolWidth, type, webNMS
 
Constructor Summary
MapContainer()
          A Default constructor which initializes all properties to their default values.
MapContainer(java.lang.String name)
          Constructor which takes the name of this container.
 
Method Summary
 java.lang.Object clone()
          Returns a MapContainer which is a clone of this MapContainer.
 boolean getContainment()
          Returns the value of the containment property that has been set for this container object.
 java.lang.String getCurrentTopology()
          Returns the value of the currentTopology property.
 java.util.Properties getProperties()
          Returns the properties of the MapContainer 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.
 java.lang.String getTopology()
          Returns the value of the topology property of this container.
 void setContainment(boolean value)
          Sets the value of the containment property to the specified boolean.
 void setCurrentTopology(java.lang.String s)
          Sets the value of the currentTopology property.
 void setParameter(java.lang.String nam, java.lang.String val)
          Sets the symbol parameters based on specified name and value.
 void setProperties(java.util.Properties p)
          Applies the given set of properties over the MapContainer.
 void setTopology(java.lang.String s)
          Sets the value of the topology property of this container.
 
Methods inherited from class com.adventnet.nms.mapdb.MapSymbol
addObjTypes, getAnchored, getDynamicUserProperty, getGroupName, getHeight, getIconName, getId, getIntObjType, getKey, getKeyName, getLabel, getMapHeight, getMapKey, getMapName, getMappedProperties, getMapWidth, getMenuName, getName, getObjKey, getObjName, getObjType, getOwnerName, getParentName, getSeverityNames, getStatus, getStrObjType, getType, getUserProperties, getUserProperty, getWebNMS, getWidth, getX, getY, removeUserProperty, setAnchored, setDynamicUserProperty, setGroupName, setHeight, setIconName, setId, setLabel, setMapHeight, setMapKey, setMapName, setMappedProperties, setMapWidth, setMenuName, setName, setObjName, setObjType, setOwnerName, setParentName, setStatus, setType, setUserProperty, setWebNMS, setWidth, setX, setY, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentTopology

protected java.lang.String currentTopology
Holds the value of the current topology that will be applied for the map. This property is the default layout that should be taken from the list of applicable ones given as part of the topology property. If not specified or if the specified value is not present in the layout list as specified in topology property, then the first among the topologies in the list is taken to be this property.


topology

protected java.lang.String topology
Holds a comma separated list of all the layouts applicable to this objects. This property signifies the possible layouts that could be applicable to the container.

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 this map. 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".

See Also:
AutoLayout.getName()

containment

protected boolean containment
Holds the containment boolean. 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.

Constructor Detail

MapContainer

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


MapContainer

public MapContainer(java.lang.String name)
Constructor which takes the name of this container.

Parameters:
name - the name that will identify the container
Method Detail

setContainment

public void setContainment(boolean value)
Sets the value of the containment property to the specified boolean. Note that the default value for this property is true.

Parameters:
value - the boolean value that should be set for containment property
See Also:
containment, getContainment()

getContainment

public boolean getContainment()
Returns the value of the containment property that has been set for this container object.

Returns:
the boolean value set for the containment property of the object
See Also:
containment, setContainment(boolean)

getTopology

public java.lang.String getTopology()
Returns the value of the topology property of this container.

Returns:
a String representing the topology.
See Also:
topology, setTopology(java.lang.String)

getCurrentTopology

public java.lang.String getCurrentTopology()
Returns the value of the currentTopology property. This value is selected from the list of applicable ones given as part of the topology property. This is the layout specified for the current MapContainer.

Returns:
a String representing the name of the layout which has been currently set for the container.
See Also:
currentTopology, setCurrentTopology(java.lang.String)

setTopology

public void setTopology(java.lang.String s)
Sets the value of the topology property of this container.

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

setCurrentTopology

public void setCurrentTopology(java.lang.String s)
Sets the value of the currentTopology property. This is the layout which will be applied on the map and it should be one of the layouts specified as part of the topology property. If this property is not specified or, if the value specified here is not in the topology property list, then the first among the list of layouts will be applied to the map.

Parameters:
s - the name of the layout from the topology property list which is to be set as the current value.
See Also:
currentTopology, getCurrentTopology()

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 also be retrieved using this method.

Overrides:
getProperty in class MapSymbol
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", "ownerName", "status", "type", "managed", "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 MapContainer 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 DBInterface
Overrides:
getProperties in class MapSymbol
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 p)
Applies the given set of properties over the MapContainer. The given set of property keys could consist of the standard properties described in the getProperties() method or even some user properties.

Specified by:
setProperties in interface DBInterface
Overrides:
setProperties in class MapSymbol
Parameters:
p - a Properties object which contains the properties to be set for this MapContainer.
See Also:
MapSymbol.getProperties(), getProperties()

setParameter

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

Overrides:
setParameter in class MapSymbol
Parameters:
nam - Name of the parameter.
val - Value of the parameter.

clone

public java.lang.Object clone()
Returns a MapContainer which is a clone of this MapContainer. The resulting cloned object has the same values for all the properties and user properties as this MapContainer.

Specified by:
clone in interface DBInterface
Overrides:
clone in class MapSymbol
Returns:
a MapContainer object, which is a clone of this map.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.