diva.canvas.connector
Class StraightTerminal.ConnectSite

java.lang.Object
  extended by diva.canvas.AbstractSite
      extended by diva.canvas.connector.StraightTerminal.ConnectSite
All Implemented Interfaces:
Site
Enclosing class:
StraightTerminal

private class StraightTerminal.ConnectSite
extends AbstractSite

The site at which a connector can connect to a straight terminal. Each StraightTerminal has exactly one ConnectSite, which has ID 0.


Field Summary
 
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
 
Constructor Summary
private StraightTerminal.ConnectSite()
           
 
Method Summary
 Figure getFigure()
          Get the figure to which this site is attached.
 int getID()
          Get the ID of this site.
 double getNormal()
          Get the normal to this site, in radians between zero and 2pi.
 double getX()
          Get the x-coordinate of the site.
 double getY()
          Get the y-coordinate of the site.
 boolean hasNormal()
          Test if this site has a "normal" to it.
 boolean isNormal(int direction)
          Test if this site has a normal in the given direction.
 void translate(double x, double y)
          Translate the site by the indicated distance.
 
Methods inherited from class diva.canvas.AbstractSite
getPoint, getPoint, getPoint, getPoint, getTransformContext, setNormal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StraightTerminal.ConnectSite

private StraightTerminal.ConnectSite()
Method Detail

getID

public int getID()
Get the ID of this site.

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

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

getNormal

public double getNormal()
Get the normal to this site, in radians between zero and 2pi. The direction is "out" 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

hasNormal

public boolean hasNormal()
Test if this site has a "normal" to it. This method returns the same value as the attachment site.

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

isNormal

public boolean isNormal(int direction)
Test if this site has a normal in the given direction. The direction is that given by one of the static constants NORTH, SOUTH, EAST, or WEST, defined in javax.swing.SwingConstants.

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

translate

public void translate(double x,
                      double y)
Translate the site by the indicated distance. This method throws an exception.

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