cgl.narada.topology.viewer
Class PositionCalculation

java.lang.Object
  extended by cgl.narada.topology.viewer.PositionCalculation

public class PositionCalculation
extends Object

This class consists of all the methods that are relevant to the calculation related to the node-positions on the screen.


Field Summary
static double MAX_VALUE
           
 
Constructor Summary
PositionCalculation()
           
 
Method Summary
static Node getNearestNode(List nodeList, int clickedX, int clickedY)
          Returns component nearest to the specified coordinates.
static List getNewPositions(Position reference, int numberOfNodes, int level)
          Returns List of new positions to be assigned to all nodes one level below inside the component
static Color getNodeColor(int level)
          Returns node color depending upon its level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_VALUE

public static double MAX_VALUE
Constructor Detail

PositionCalculation

public PositionCalculation()
Method Detail

getNewPositions

public static List getNewPositions(Position reference,
                                   int numberOfNodes,
                                   int level)
Returns List of new positions to be assigned to all nodes one level below inside the component

Parameters:
reference - Position of a reference center about which other centers are being placed.
numberOfNodes - number of components at particular level.
level - level of a component in the four level hierarchy.
Returns:
List of Position objects

getNodeColor

public static Color getNodeColor(int level)
Returns node color depending upon its level.

Parameters:
level - level of a component in a four level hierarchy.
Returns:
Color of a node at specified level.

getNearestNode

public static Node getNearestNode(List nodeList,
                                  int clickedX,
                                  int clickedY)
Returns component nearest to the specified coordinates.

Parameters:
nodeList - List of components.
clickedX - X-coordinate
clickedY - Y-coordinate
Returns:
nearest Node. null if no such node is found.


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