ptolemy.vergil.actor
Class LinkManhattanConnector

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.connector.AbstractConnector
          extended by diva.canvas.connector.ManhattanConnector
              extended by ptolemy.vergil.actor.LinkManhattanConnector
All Implemented Interfaces:
CanvasComponent, Connector, Figure, VisibleComponent, UserObjectContainer

public class LinkManhattanConnector
extends ManhattanConnector

An extension to BasicManhattanRouter supporting links to multiports.

Since:
Ptolemy II 5.2
Version:
$Id: LinkManhattanConnector.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
Accepted Rating:
Red (eal)
Proposed Rating:
Yellow (eal)

Field Summary
private  IOPort _headPort
          The port at the head, if there is one and it's an IOPort.
private  java.util.ArrayList _headSites
          Head sites, in case this is a multiport.
private  Link _link
          The link.
private static BasicManhattanRouter _router
          Specialized router.
private  IOPort _tailPort
          The port at the tail, if there is one and it's an IOPort.
private  java.util.ArrayList _tailSites
          Tail sites, in case this is a multiport.
 
Constructor Summary
LinkManhattanConnector(Site tail, Site head, Link link)
          Construct a new connector with the given tail and head for the specified link.
 
Method Summary
 Site getHeadSite()
          Override the base class to return a different site for each connection to a multiport.
 Link getLink()
          Return the associated link.
 Site getTailSite()
          Override the base class to return a different site for each connection to a multiport.
 
Methods inherited from class diva.canvas.connector.ManhattanConnector
getBendRadius, getRouter, repositionLabel, route, setBendRadius, setRouter, translate
 
Methods inherited from class diva.canvas.connector.AbstractConnector
getBounds, getDashArray, getHeadEnd, getLabelFigure, getLineWidth, getShape, getStroke, getStrokePaint, getTailEnd, headMoved, hit, intersects, paint, reroute, setDashArray, setHeadEnd, setHeadSite, setLabelFigure, setLineWidth, setShape, setStroke, setStrokePaint, setTailEnd, setTailSite, tailMoved, transform
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface diva.canvas.Figure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, setInteractor, setParent, setToolTipText
 
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, setVisible
 
Methods inherited from interface diva.canvas.CanvasComponent
getTransformContext, repaint, repaint
 
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
 

Field Detail

_headPort

private IOPort _headPort
The port at the head, if there is one and it's an IOPort.


_headSites

private java.util.ArrayList _headSites
Head sites, in case this is a multiport.


_link

private Link _link
The link.


_router

private static BasicManhattanRouter _router
Specialized router.


_tailPort

private IOPort _tailPort
The port at the tail, if there is one and it's an IOPort.


_tailSites

private java.util.ArrayList _tailSites
Tail sites, in case this is a multiport.

Constructor Detail

LinkManhattanConnector

public LinkManhattanConnector(Site tail,
                              Site head,
                              Link link)
Construct a new connector with the given tail and head for the specified link. The head and tail sites may be representative sites for multiport, in which case they are not necessarily the ones returned by getHeadSite() or getTailSite(). Those methods will return new sites as needed to ensure that each each connection is to its own site.

Parameters:
tail - The tail site.
head - The head site.
link - The link.
Method Detail

getHeadSite

public Site getHeadSite()
Override the base class to return a different site for each connection to a multiport.

Specified by:
getHeadSite in interface Connector
Overrides:
getHeadSite in class AbstractConnector
Returns:
The connection site.

getLink

public Link getLink()
Return the associated link.

Returns:
The associated link.

getTailSite

public Site getTailSite()
Override the base class to return a different site for each connection to a multiport.

Specified by:
getTailSite in interface Connector
Overrides:
getTailSite in class AbstractConnector
Returns:
The connection site.