Package ptolemy.vergil.toolbox
Class PortSite
- java.lang.Object
-
- diva.canvas.AbstractSite
-
- ptolemy.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$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Field Summary
-
Fields inherited from class diva.canvas.AbstractSite
_hasNormal
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FiguregetFigure()Get the figure to which this site is attached.intgetID()Return the ID for this site, which is the number of the port.doublegetNormal()Get the normal of the site.doublegetX()Get the x-coordinate of the site.doublegetY()Get the y-coordinate of the site.java.lang.StringtoString()-
Methods inherited from class diva.canvas.AbstractSite
getPoint, getPoint, getPoint, getPoint, getTransformContext, hasNormal, isNormal, setNormal, translate
-
-
-
-
Constructor Detail
-
PortSite
public PortSite(Figure figure, Port port, int number, int count, int direction)
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, which is ignored by this methodnumber- The number of the port within its kind, starting with 0.count- The number of ports of its kind.direction- One of SwingConstants.{WEST, NORTH, EAST, SOUTH}.
-
-
Method Detail
-
getFigure
public Figure getFigure()
Get the figure to which this site is attached.- Specified by:
getFigurein interfaceSite- Specified by:
getFigurein classAbstractSite- Returns:
- The figure.
-
getID
public int getID()
Return the ID for this site, which is the number of the port.- Specified by:
getIDin interfaceSite- Specified by:
getIDin classAbstractSite- Returns:
- The number of the port.
-
getNormal
public double getNormal()
Get the normal of the site.- Specified by:
getNormalin interfaceSite- Overrides:
getNormalin classAbstractSite- Returns:
- The normal.
-
getX
public double getX()
Get the x-coordinate of the site.- Specified by:
getXin interfaceSite- Specified by:
getXin classAbstractSite- Returns:
- The x-coordinate of the site.
-
getY
public double getY()
Get the y-coordinate of the site.- Specified by:
getYin interfaceSite- Specified by:
getYin classAbstractSite- Returns:
- The y-coordinate of the site.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-