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
-
area
- The area the node is a member of.
-
FONT_NAME
- The name of the font to be used for node labels.
-
FONT_SIZE
- The size of the font to be used for node labels.
-
FONT_STYLE
- The style of the font to be used for node labels.
-
homeSwitch
- The node's "main" switch connection.
-
HOST_ICON_SIZE
- The display size of a square representing an ATM node.
-
HOST_LINE
- The length of a line connecting a node to its
home switch.
-
icon
- The rectangle that represents the node in the display window.
-
phyAdj
- A list of nodes the node has physical connections to.
-
screenLoc
- The node's location in the display window.
-
theta
- The angle in radians from the home switch to this node.
-
vccAdj
- A list of VCCs to other nodes.
-
Node(String, Network, String, long)
- Construct a node.
-
addPhyAdj(Node)
- Add a physical adjacency to the list.
-
addVCCAdj(VCC)
- Add a VCC to the list of adjacencies.
-
clearIcon()
- Clear the node's display icon.
-
clearScreenLocation()
- Clear the node's display location.
-
contains(Point)
- Check whether the given point is within the node's
display icon.
-
delete()
- Delete the node from its network.
-
draw(Graphics, ViewSettings)
- Draw the node in a display window.
-
drawLabel(Graphics, ViewSettings)
- Draw the node's label.
-
getArea()
- Get the area in which the node is displayed.
-
getHome()
- Get the switch considered to be the primary connection for
the node.
-
getIcon()
- Get the node's display icon.
-
getPhyAdjEnumeration()
- Get an enumeration over the physical adjacency list.
-
getScreenLocation()
- Get the node's display location.
-
getTheta()
- Get the direction from the home switch to the node.
-
getVCCAdjEnumeration()
- Get an enumeration over the list of VCCs.
-
isOrphan()
- Check whether the node is an orphan (a node with no physical
connection to an ATM switch).
-
merge(ATMNode)
- Merge this node with another.
-
rankVCCs(ViewSettings)
- Set the rank of the node's VCCs.
-
removePhyAdj(Node)
- Remove a physical adjacency from the list.
-
removeVCCAdj(VCC)
- Remove a VCC from the list of adjacencies.
-
setArea(Area)
- Set the area in which the node is displayed.
-
setHome(Switch)
- Set the switch considered to be the primary connection for
the node.
-
setScreenLocation(Point)
- Set the node's display location.
-
setTheta(double)
- Set the direction from the home switch to the node.
-
toString()
- Get a string describing the node.
HOST_ICON_SIZE
public static final int HOST_ICON_SIZE
- The display size of a square representing an ATM node.
HOST_LINE
public static final int HOST_LINE
- The length of a line connecting a node to its
home switch.
FONT_NAME
public static final String FONT_NAME
- The name of the font to be used for node labels.
FONT_STYLE
public static final int FONT_STYLE
- The style of the font to be used for node labels.
FONT_SIZE
public static final int FONT_SIZE
- The size of the font to be used for node labels.
phyAdj
private Vector phyAdj
- A list of nodes the node has physical connections to.
vccAdj
private Vector vccAdj
- A list of VCCs to other nodes.
homeSwitch
private Switch homeSwitch
- The node's "main" switch connection. This is the first physical
connection to a switch.
area
private Area area
- The area the node is a member of.
screenLoc
protected Point screenLoc
- The node's location in the display window. This gives the
location (in pixels) of the center of the icon.
icon
protected Rectangle icon
- The rectangle that represents the node in the display window.
theta
private double theta
- The angle in radians from the home switch to this node.
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.
delete
public void delete()
- Delete the node from its network.
- Overrides:
- delete in class ATMNode
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.
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.
getPhyAdjEnumeration
public Enumeration getPhyAdjEnumeration()
- Get an enumeration over the physical adjacency list.
- Returns:
- an enumeration over the physical adjacency list.
addVCCAdj
public void addVCCAdj(VCC vcc)
- Add a VCC to the list of adjacencies.
- Parameters:
- vcc - the VCC to be added.
removeVCCAdj
public void removeVCCAdj(VCC vcc)
- Remove a VCC from the list of adjacencies.
- Parameters:
- vcc - the VCC to be removed.
getVCCAdjEnumeration
public Enumeration getVCCAdjEnumeration()
- Get an enumeration over the list of VCCs.
- Returns:
- an enumeration over the node's VCC list.
rankVCCs
public void rankVCCs(ViewSettings view)
- Set the rank of the node's VCCs.
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.
getHome
public Switch getHome()
- Get the switch considered to be the primary connection for
the node.
- Returns:
- the node's primary switch.
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.
getArea
public Area getArea()
- Get the area in which the node is displayed.
- Returns:
- the node's area.
setArea
public void setArea(Area area)
- Set the area in which the node is displayed.
- Parameters:
- area - the node's area.
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.
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.
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.
getScreenLocation
public Point getScreenLocation()
- Get the node's display location.
- Returns:
- the node's location in the display window.
setScreenLocation
public void setScreenLocation(Point loc)
- Set the node's display location.
- Parameters:
- loc - the node's location in the display window.
clearScreenLocation
public void clearScreenLocation()
- Clear the node's display location.
getIcon
public Rectangle getIcon()
- Get the node's display icon.
- Returns:
- the node's displayable icon.
clearIcon
public void clearIcon()
- Clear the node's display icon.
getTheta
public double getTheta()
- Get the direction from the home switch to the node.
- Returns:
- the angle in radians.
setTheta
public void setTheta(double theta)
- Set the direction from the home switch to the node.
- Parameters:
- theta - the angle in radians.
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
toString
public String toString()
- Get a string describing the node.
- Returns:
- a String describing the node object.
- Overrides:
- toString in class ATMNode