core
Class VisualNode

java.lang.Object
  extended bycore.VisualNode

public class VisualNode
extends java.lang.Object

VisualNode stores details such as IP Address, Color etc of a node.

Author:
Avi TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
VisualNode(java.lang.Integer x, java.lang.Integer y, java.lang.String IP, java.awt.Color c)
          Create new Visual Node representation.
 
Method Summary
 java.awt.Color getColor()
          Return the Color of this node.
 java.lang.String getIP()
          Get the IP Address of this VisualNode.
 int getX()
          Get the current x position.
 int getY()
          Get the current y position.
 void setIP(java.lang.String s)
          Set the IP Address of this VisualNode
 void setToX(int x)
          Set the x co-ordinate to which this node is heading.
 void setToY(int y)
          Set the y co-ordinate to which this node is heading.
 void setX(int x)
          Set the current X co-ordinate of this node.
 void setY(int y)
          Set the current Y co-ordinate of this node.
 void step()
          Increment the x and y positions according to position to which they are heading.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualNode

public VisualNode(java.lang.Integer x,
                  java.lang.Integer y,
                  java.lang.String IP,
                  java.awt.Color c)
Create new Visual Node representation.

Parameters:
x - Initial x co-ordinate of the node.
y - Initial y co-ordinate of the node.
IP - IP Address of the node.
c - The Color of the node.
Method Detail

step

public void step()
Increment the x and y positions according to position to which they are heading.


getColor

public java.awt.Color getColor()
Return the Color of this node.

Returns:
Color Object.

setToX

public void setToX(int x)
Set the x co-ordinate to which this node is heading.

Parameters:
x - co-ordinate to which this node is heading.

setToY

public void setToY(int y)
Set the y co-ordinate to which this node is heading.

Parameters:
y - The y co-ordinate to which this node is heading.

getX

public int getX()
Get the current x position.

Returns:
The current x co-ordinate.

getY

public int getY()
Get the current y position.

Returns:
The current y co-ordinate

getIP

public java.lang.String getIP()
Get the IP Address of this VisualNode.

Returns:
IP Address

setIP

public void setIP(java.lang.String s)
Set the IP Address of this VisualNode

Parameters:
s - The IP Address to be set.

setX

public void setX(int x)
Set the current X co-ordinate of this node.

Parameters:
x - X co-ordinate.

setY

public void setY(int y)
Set the current Y co-ordinate of this node.

Parameters:
y - Y co-ordinate.