ptolemy.vergil.toolbox
Class PortSite

java.lang.Object
  extended bydiva.canvas.AbstractSite
      extended byptolemy.vergil.toolbox.PortSite
All Implemented Interfaces:
Site

public class PortSite
extends AbstractSite

A site that locates itself on the bounds of a figure's shape, designed for placing ports.

Since:
Ptolemy II 2.0
Version:
$Id: PortSite.java,v 1.17 2004/04/13 05:12:45 cxh Exp $
Author:
Edward A. Lee
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Constructor Summary
PortSite(Figure figure, IOPort port, int number, int count)
          Create a new site on the given figure with the given ID port type, and port number.
 
Method Summary
 Figure getFigure()
          Get the figure to which this site is attached.
 int getID()
          Return the ID for this site, which is the number of the port.
 double getNormal()
          Get the normal of the site.
 double getX()
          Get the x-coordinate of the site.
 double getY()
          Get the y-coordinate of the site.
 java.lang.String toString()
           
 
Methods inherited from class diva.canvas.AbstractSite
getPoint, getPoint, getPoint, getPoint, getTransformContext, hasNormal, isNormal, setNormal, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortSite

public PortSite(Figure figure,
                IOPort port,
                int number,
                int count)
Create a new site on the given figure with the given ID port type, and port number.

Parameters:
figure - The figure for the entity icon.
port - The port.
number - The number of the port within its kind, starting with 0.
count - The number of ports of its kind.
Method Detail

getFigure

public Figure getFigure()
Get the figure to which this site is attached.

Specified by:
getFigure in interface Site
Specified by:
getFigure in class AbstractSite

getID

public int getID()
Return the ID for this site, which is the number of the port.

Specified by:
getID in interface Site
Specified by:
getID in class AbstractSite
Returns:
The number of the port.

getNormal

public double getNormal()
Get the normal of the site.

Specified by:
getNormal in interface Site
Overrides:
getNormal in class AbstractSite

getX

public double getX()
Get the x-coordinate of the site.

Specified by:
getX in interface Site
Specified by:
getX in class AbstractSite

getY

public double getY()
Get the y-coordinate of the site.

Specified by:
getY in interface Site
Specified by:
getY in class AbstractSite

toString

public java.lang.String toString()