Class Node

java.lang.Object
   |
   +----VisiModel.ATMNode
           |
           +----Node

public class Node
extends ATMNode
Class definition for a displayable node (switch or end system) in an IP/ATM network.

Version:
$Revision: 1.11 $, $Date: 2000/10/30 17:10:27 $
Author:
John Cavanaugh

Variable Index

 o area
The area the node is a member of.
 o FONT_NAME
The name of the font to be used for node labels.
 o FONT_SIZE
The size of the font to be used for node labels.
 o FONT_STYLE
The style of the font to be used for node labels.
 o homeSwitch
The node's "main" switch connection.
 o HOST_ICON_SIZE
The display size of a square representing an ATM node.
 o HOST_LINE
The length of a line connecting a node to its home switch.
 o icon
The rectangle that represents the node in the display window.
 o phyAdj
A list of nodes the node has physical connections to.
 o screenLoc
The node's location in the display window.
 o theta
The angle in radians from the home switch to this node.
 o vccAdj
A list of VCCs to other nodes.

Constructor Index

 o Node(String, Network, String, long)
Construct a node.

Method Index

 o addPhyAdj(Node)
Add a physical adjacency to the list.
 o addVCCAdj(VCC)
Add a VCC to the list of adjacencies.
 o clearIcon()
Clear the node's display icon.
 o clearScreenLocation()
Clear the node's display location.
 o contains(Point)
Check whether the given point is within the node's display icon.
 o delete()
Delete the node from its network.
 o draw(Graphics, ViewSettings)
Draw the node in a display window.
 o drawLabel(Graphics, ViewSettings)
Draw the node's label.
 o getArea()
Get the area in which the node is displayed.
 o getHome()
Get the switch considered to be the primary connection for the node.
 o getIcon()
Get the node's display icon.
 o getPhyAdjEnumeration()
Get an enumeration over the physical adjacency list.
 o getScreenLocation()
Get the node's display location.
 o getTheta()
Get the direction from the home switch to the node.
 o getVCCAdjEnumeration()
Get an enumeration over the list of VCCs.
 o isOrphan()
Check whether the node is an orphan (a node with no physical connection to an ATM switch).
 o merge(ATMNode)
Merge this node with another.
 o rankVCCs(ViewSettings)
Set the rank of the node's VCCs.
 o removePhyAdj(Node)
Remove a physical adjacency from the list.
 o removeVCCAdj(VCC)
Remove a VCC from the list of adjacencies.
 o setArea(Area)
Set the area in which the node is displayed.
 o setHome(Switch)
Set the switch considered to be the primary connection for the node.
 o setScreenLocation(Point)
Set the node's display location.
 o setTheta(double)
Set the direction from the home switch to the node.
 o toString()
Get a string describing the node.

Variables

 o HOST_ICON_SIZE
 public static final int HOST_ICON_SIZE
The display size of a square representing an ATM node.

 o HOST_LINE
 public static final int HOST_LINE
The length of a line connecting a node to its home switch.

 o FONT_NAME
 public static final String FONT_NAME
The name of the font to be used for node labels.

 o FONT_STYLE
 public static final int FONT_STYLE
The style of the font to be used for node labels.

 o FONT_SIZE
 public static final int FONT_SIZE
The size of the font to be used for node labels.

 o phyAdj
 private Vector phyAdj
A list of nodes the node has physical connections to.

 o vccAdj
 private Vector vccAdj
A list of VCCs to other nodes.

 o homeSwitch
 private Switch homeSwitch
The node's "main" switch connection. This is the first physical connection to a switch.

 o area
 private Area area
The area the node is a member of.

 o screenLoc
 protected Point screenLoc
The node's location in the display window. This gives the location (in pixels) of the center of the icon.

 o icon
 protected Rectangle icon
The rectangle that represents the node in the display window.

 o theta
 private double theta
The angle in radians from the home switch to this node.

Constructors

 o Node
 public Node(String name,
             Network net,
             String description,
             long flags)
Construct a node.

Parameters:
name - a name for the node.
net - the network the node is part of.
description - a description of the node.
flags - attribute flags for the node.

Methods

 o delete
 public void delete()
Delete the node from its network.

Overrides:
delete in class ATMNode
 o addPhyAdj
 public void addPhyAdj(Node node)
Add a physical adjacency to the list.

Parameters:
n - the node at the other end of the physical connection.
 o removePhyAdj
 public void removePhyAdj(Node node)
Remove a physical adjacency from the list.

Parameters:
node - the node at the other end of the physical connection.
 o getPhyAdjEnumeration
 public Enumeration getPhyAdjEnumeration()
Get an enumeration over the physical adjacency list.

Returns:
an enumeration over the physical adjacency list.
 o addVCCAdj
 public void addVCCAdj(VCC vcc)
Add a VCC to the list of adjacencies.

Parameters:
vcc - the VCC to be added.
 o removeVCCAdj
 public void removeVCCAdj(VCC vcc)
Remove a VCC from the list of adjacencies.

Parameters:
vcc - the VCC to be removed.
 o getVCCAdjEnumeration
 public Enumeration getVCCAdjEnumeration()
Get an enumeration over the list of VCCs.

Returns:
an enumeration over the node's VCC list.
 o rankVCCs
 public void rankVCCs(ViewSettings view)
Set the rank of the node's VCCs.

 o isOrphan
 public boolean isOrphan()
Check whether the node is an orphan (a node with no physical connection to an ATM switch).

Returns:
true if the node is an orphan; false otherwise.
 o getHome
 public Switch getHome()
Get the switch considered to be the primary connection for the node.

Returns:
the node's primary switch.
 o setHome
 public void setHome(Switch s)
Set the switch considered to be the primary connection for the node.

Parameters:
s - the node's primary switch.
 o getArea
 public Area getArea()
Get the area in which the node is displayed.

Returns:
the node's area.
 o setArea
 public void setArea(Area area)
Set the area in which the node is displayed.

Parameters:
area - the node's area.
 o draw
 public void draw(Graphics g,
                  ViewSettings view)
Draw the node in a display window.

Parameters:
g - the graphics context for the dislay window.
view - the view settings.
 o drawLabel
 protected void drawLabel(Graphics g,
                          ViewSettings view)
Draw the node's label. The position of the label is determined by the direction from the node to the switch it is attached to.

Parameters:
g - the graphics context for the display window.
view - the view settings.
 o contains
 public boolean contains(Point loc)
Check whether the given point is within the node's display icon.

Parameters:
loc - the point to be tested.
Returns:
true if the given point is inside the node's icon; false otherwise.
 o getScreenLocation
 public Point getScreenLocation()
Get the node's display location.

Returns:
the node's location in the display window.
 o setScreenLocation
 public void setScreenLocation(Point loc)
Set the node's display location.

Parameters:
loc - the node's location in the display window.
 o clearScreenLocation
 public void clearScreenLocation()
Clear the node's display location.

 o getIcon
 public Rectangle getIcon()
Get the node's display icon.

Returns:
the node's displayable icon.
 o clearIcon
 public void clearIcon()
Clear the node's display icon.

 o getTheta
 public double getTheta()
Get the direction from the home switch to the node.

Returns:
the angle in radians.
 o setTheta
 public void setTheta(double theta)
Set the direction from the home switch to the node.

Parameters:
theta - the angle in radians.
 o merge
 public void merge(ATMNode node)
Merge this node with another.

Parameters:
node - the node to merge with this one.
Overrides:
merge in class ATMNode
 o toString
 public String toString()
Get a string describing the node.

Returns:
a String describing the node object.
Overrides:
toString in class ATMNode