Class Router

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

public class Router
extends EndSystem
Class definition for a displayable representation of a router in an IP/ATM network.

Version:
$Revision: 1.3 $, $Date: 2000/10/12 14:07:58 $
Author:
John Cavanaugh

Variable Index

 o ROUTER_ICON_SIZE
The display size of the icon representing the router.

Constructor Index

 o Router(String, Network, String, long)
Constructs a router.

Method Index

 o draw(Graphics, ViewSettings)
Draws the router in the display window.
 o drawArrow(Graphics, int, int)
Draws an arrow on the router.
 o isSwitchControl()
Determines whether the router is a control processor for an ATM switch; always return false.
 o merge(ATMNode)
Merges the router with another.
 o toString()
Gets a string describing the router.

Variables

 o ROUTER_ICON_SIZE
 public static final int ROUTER_ICON_SIZE
The display size of the icon representing the router.

Constructors

 o Router
 public Router(String name,
               Network net,
               String description,
               long flags)
Constructs a router.

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

Methods

 o draw
 public void draw(Graphics g,
                  ViewSettings view)
Draws the router in the display window.

Parameters:
g - the graphics context for the display window.
view - the view settings.
Overrides:
draw in class Node
 o drawArrow
 private void drawArrow(Graphics g,
                        int horiz,
                        int vert)
Draws an arrow on the router.

Parameters:
g - the graphics context for the display window.
horiz - a direction indicator for left vs. right; 1 or -1
vert - a direction indicator for up vs. down; 1 or -1
 o isSwitchControl
 public boolean isSwitchControl()
Determines whether the router is a control processor for an ATM switch; always return false. Overrides isSwitchControl() in EndSystem.

Returns:
always returns false.
Overrides:
isSwitchControl in class EndSystem
 o merge
 public void merge(ATMNode node)
Merges the router with another.

Parameters:
node - the node to merge with this node.
Overrides:
merge in class EndSystem
 o toString
 public String toString()
Gets a string describing the router.

Returns:
a string describing the router object.
Overrides:
toString in class EndSystem