simulation
Class H2HLinkFigure

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byorg.eclipse.draw2d.Shape
          extended byorg.eclipse.draw2d.Polyline
              extended byorg.eclipse.draw2d.PolylineConnection
                  extended bysimulation.H2HLinkFigure
All Implemented Interfaces:
org.eclipse.draw2d.AnchorListener, org.eclipse.draw2d.Connection, org.eclipse.draw2d.IFigure

public class H2HLinkFigure
extends org.eclipse.draw2d.PolylineConnection


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
private  double bandwidth
          The bandwidth of this link.
private  int hostId1
          The IDs of the source and destination Hosts for this link.
private  int hostId2
          The IDs of the source and destination Hosts for this link.
private static int quality_levels
          The number of different thicknes levels this link can have.
private  double reliability
          The reliability of this link.
 
Fields inherited from class org.eclipse.draw2d.PolylineConnection
 
Fields inherited from class org.eclipse.draw2d.Polyline
 
Fields inherited from class org.eclipse.draw2d.Shape
lineStyle, lineWidth
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.Connection
PROPERTY_CONNECTION_ROUTER, PROPERTY_POINTS
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
H2HLinkFigure(HostFigure source, HostFigure dest, double linkReliability, double linkBandwidth)
          This constructor creates a new link between two hosts.
 
Method Summary
 double getBandwidth()
          Returns the bandwidth of this link.
 int getDestHostID()
          Returns the Host ID of this link's destination.
 boolean getImpliedLink()
          Returns whether or not this link is implied.
 double getReliability()
          Gets the reliability of this link.
 int getSourceHostID()
          Returns the Host ID of this link's source.
 void setBandwidth(double bw)
          Sets a new bandwidth for this link.
 void setImpliedLink(boolean val)
          This method sets whether this link is real or imaginary/implied.
 void setQuality(double quality)
          When given a double between 0.0 and 1.0, this method will change the thickness of the link to reflect that change in quality.
 void setReliability(double rel)
          Sets a new reliability for this link.
 
Methods inherited from class org.eclipse.draw2d.PolylineConnection
addNotify, anchorMoved, getBounds, getConnectionRouter, getRoutingConstraint, getSourceAnchor, getSourceDecoration, getTargetAnchor, getTargetDecoration, layout, removeNotify, revalidate, setConnectionRouter, setRoutingConstraint, setSourceAnchor, setSourceDecoration, setTargetAnchor, setTargetDecoration
 
Methods inherited from class org.eclipse.draw2d.Polyline
addPoint, containsPoint, fillShape, getEnd, getPoints, getStart, insertPoint, isOpaque, outlineShape, primTranslate, removeAllPoints, removePoint, setEnd, setEndpoints, setLineWidth, setPoint, setPoints, setStart, useLocalCoordinates
 
Methods inherited from class org.eclipse.draw2d.Shape
getLineStyle, getLineWidth, paintFigure, setFill, setFillXOR, setLineStyle, setOutline, setOutlineXOR, setXOR
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, paint, paintBorder, paintChildren, paintClientArea, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeKeyListener, removeListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.draw2d.Connection
getPoints, setPoints
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeFigureListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 

Field Detail

hostId1

private int hostId1
The IDs of the source and destination Hosts for this link.


hostId2

private int hostId2
The IDs of the source and destination Hosts for this link.


reliability

private double reliability
The reliability of this link.


bandwidth

private double bandwidth
The bandwidth of this link.


quality_levels

private static int quality_levels
The number of different thicknes levels this link can have. Thickness represents quality.

Constructor Detail

H2HLinkFigure

public H2HLinkFigure(HostFigure source,
                     HostFigure dest,
                     double linkReliability,
                     double linkBandwidth)
This constructor creates a new link between two hosts.

Parameters:
source - The Source Host of this link.
dest - The destination host of this link.
linkReliability - The reliability of this link.
linkBandwidth - The bandwidth of this link.
Method Detail

getReliability

public double getReliability()
Gets the reliability of this link.

Returns:
reliability

setReliability

public void setReliability(double rel)
Sets a new reliability for this link.

Parameters:
rel - The new reliability.

setImpliedLink

public void setImpliedLink(boolean val)
This method sets whether this link is real or imaginary/implied. Implied links are dashed while real links are sold.

Parameters:
val - A boolean that sets whether or not this link is Implied.

getImpliedLink

public boolean getImpliedLink()
Returns whether or not this link is implied. If the return value is false, this is a real Host to Host link.

Returns:
A boolean that says whether or not the link is implied.

getBandwidth

public double getBandwidth()
Returns the bandwidth of this link.

Returns:
bandwidth

setBandwidth

public void setBandwidth(double bw)
Sets a new bandwidth for this link.

Parameters:
bw - The new Bandwidth.

getSourceHostID

public int getSourceHostID()
Returns the Host ID of this link's source.

Returns:
hostId1

getDestHostID

public int getDestHostID()
Returns the Host ID of this link's destination.

Returns:
hostId2

setQuality

public void setQuality(double quality)
When given a double between 0.0 and 1.0, this method will change the thickness of the link to reflect that change in quality. If the link is implied however, or if quality is given outside of 0.0 to 1.0, nothing will happen.

Parameters:
quality - A double between 0.0 and 1.0, that reflects the quality of this link.