cgl.narada.topology.viewer
Class SSCluster

java.lang.Object
  extended by cgl.narada.topology.viewer.Node
      extended by cgl.narada.topology.viewer.SSCluster

public class SSCluster
extends Node

This class represents all the super super clusters consisting of super clusters. The super super cluster is fourth level in the node address. If node's address is 1.2.3.4 then the super super cluster id is 1


Field Summary
 List superClusters
           
 
Fields inherited from class cgl.narada.topology.viewer.Node
clients, INVALID_VALUE, nodeId, nodeLocation, parentClusterId, parentSClusterId, parentSSClusterId
 
Constructor Summary
SSCluster()
          Empty Constructor
SSCluster(int pSSClusterId)
          Constructor initializing the id of this super super cluster.
 
Method Summary
 void deleteAllSuperClusters(List nodesToBeDeleted)
          Deletes all the super clusters present in this super super cluster.
 void deleteSuperCluster(int superClusterId, int clusterId, int nodeId, List nodesToBeDeleted)
          Deletes an existing super cluster inside the super super cluster.
 void drawSuperSuperCluster(Graphics g, int limitX1, int limitY1, int limitX2, int limitY2)
          Draws the super super cluster only if its part is visible on the screen.
 Node getNodeAtParticularCoordinates(int x, int y)
          Finds out super cluster nearest to the specified coordinates.
 Node getParticularNode(int superClusterId, int clusterId, int nodeId)
          Returns a node in this super super cluster with specified super cluster, cluster and node id.
 void insertSuperCluster(int superClusterId, int clusterId, int nodeId)
          Adds a new super cluster to the list.
 void repositionSuperClusters()
          Gets the new Position objects and assign then to all the super clusters inside this super super cluster.
 
Methods inherited from class cgl.narada.topology.viewer.Node
addClient, addTopic, canFitOnPanel, deleteAllClients, deleteAllTopics, deleteClient, deleteTopic, drawNode, getAllClients, getClient, getNodeAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

superClusters

public List superClusters
Constructor Detail

SSCluster

public SSCluster()
Empty Constructor


SSCluster

public SSCluster(int pSSClusterId)
Constructor initializing the id of this super super cluster.

Method Detail

insertSuperCluster

public void insertSuperCluster(int superClusterId,
                               int clusterId,
                               int nodeId)
                        throws TopologyException
Adds a new super cluster to the list. Depending upon the total number of super clusters in the list, decide the new positions for each of the super cluster.

Parameters:
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
Throws:
TopologyException - if due to some problem. super cluster is found null during insertion of a node

deleteSuperCluster

public void deleteSuperCluster(int superClusterId,
                               int clusterId,
                               int nodeId,
                               List nodesToBeDeleted)
                        throws TopologyException
Deletes an existing super cluster inside the super super cluster. Repositions all other nodes reculrsively.

Parameters:
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
nodesToBeDeleted - a List which will contain node addresses of the nodes being deleted.
Throws:
TopologyException - if no such super cluster id found while node deletion.

deleteAllSuperClusters

public void deleteAllSuperClusters(List nodesToBeDeleted)
Deletes all the super clusters present in this super super cluster.

Parameters:
nodesToBeDeleted - a List which will contain node addresses of the nodes being deleted.

getNodeAtParticularCoordinates

public Node getNodeAtParticularCoordinates(int x,
                                           int y)
Finds out super cluster nearest to the specified coordinates. Then passes control to the super cluster for finding a nearest cluster.

Parameters:
x - X-coordinate
y - Y-coordinate
Returns:
Node nearest to specified coordinates.

drawSuperSuperCluster

public void drawSuperSuperCluster(Graphics g,
                                  int limitX1,
                                  int limitY1,
                                  int limitX2,
                                  int limitY2)
Draws the super super cluster only if its part is visible on the screen. Draws all the super clusters inside it.

Parameters:
g - Graphics object for image drawing.
limitX1 - lower limit for X-coordinate
limitY1 - lower limit for Y-coordinate
limitX2 - upper limit for X-coordinate
limitY2 - upper limit for Y-coordinate

getParticularNode

public Node getParticularNode(int superClusterId,
                              int clusterId,
                              int nodeId)
Returns a node in this super super cluster with specified super cluster, cluster and node id.

Parameters:
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
Returns:
Node

repositionSuperClusters

public void repositionSuperClusters()
Gets the new Position objects and assign then to all the super clusters inside this super super cluster. Recurdively calls repositionNodes() for each of the super cluster.



For comments and suggestions please send e-mail to The NaradaBrokering Project