Class Switch
java.lang.Object
|
+----VisiModel.ATMNode
|
+----Node
|
+----Switch
- public class Switch
- extends Node
Class definition for a displayable representation of an ATM switch
in an IP/ATM network.
- Version:
- $Revision: 1.11 $, $Date: 2000/10/30 17:02:54 $
- Author:
- John Cavanaugh
-
control
- The control processor for the switch.
-
ORPHAN
- A description identifying the switch as a virtual home
for orphan hosts.
-
SWITCH_ICON_SIZE
- The display size of the square representing the switch.
-
Switch(String, Network, String, EndSystem, long)
- Constructs a switch.
-
draw(Graphics, ViewSettings)
- Draws the switch in the display window.
-
drawLabel(Graphics, ViewSettings)
- Draws the switch's label.
-
findMaxBandwidth()
- Finds the maximum bandwidth, in cells per second, of any
port on the switch.
-
getControl()
- Gets the control processor for the switch.
-
labelIntersects(Rectangle)
- Checks whether the given rectangle intersects any of the physical
connection lines for the switch.
-
merge(ATMNode)
- Merges the switch with another.
-
setScreenLocation(Point)
- Sets the switch's display location; overrides
setScreenLocation() in Node.
-
toString()
- Gets a string describing the switch.
SWITCH_ICON_SIZE
public static final int SWITCH_ICON_SIZE
- The display size of the square representing the switch.
ORPHAN
public static final String ORPHAN
- A description identifying the switch as a virtual home
for orphan hosts.
control
private EndSystem control
- The control processor for the switch.
Switch
public Switch(String name,
Network net,
String description,
EndSystem control,
long flags)
- Constructs a switch.
- Parameters:
- name - a name for the switch.
- net - the network the switch is part of.
- description - a description of the switch.
- control - the control processor for the switch.
- flags - attribute flags for the switch.
draw
public void draw(Graphics g,
ViewSettings view)
- Draws the switch in the display window.
- Parameters:
- g - the graphics context for the display window.
- view - the view settings.
- Overrides:
- draw in class Node
drawLabel
protected void drawLabel(Graphics g,
ViewSettings view)
- Draws the switch's label. This code attempts to place the
label so that it does not intersect any of the lines for
physical connections to the switch.
- Parameters:
- g - the grahics context for the display window.
- view - the view settings.
- Overrides:
- drawLabel in class Node
labelIntersects
private boolean labelIntersects(Rectangle rect)
- Checks whether the given rectangle intersects any of the physical
connection lines for the switch.
- Parameters:
- rect - the rectangle to be checked for intersections.
- Returns:
- true if the proposed location is OK;
false if the proposed location intersects
a line.
setScreenLocation
public void setScreenLocation(Point loc)
- Sets the switch's display location; overrides
setScreenLocation() in Node.
- Parameters:
- loc - the switch's location in the display window.
- Overrides:
- setScreenLocation in class Node
findMaxBandwidth
public long findMaxBandwidth()
- Finds the maximum bandwidth, in cells per second, of any
port on the switch.
- Returns:
- the switch's maximum bandwidth.
getControl
public EndSystem getControl()
- Gets the control processor for the switch.
- Returns:
- the switch's control processor.
merge
public void merge(ATMNode node)
- Merges the switch with another.
- Parameters:
- node - the node to merge with this switch.
- Overrides:
- merge in class Node
toString
public String toString()
- Gets a string describing the switch.
- Returns:
- a string describing the switch object.
- Overrides:
- toString in class Node