diva.canvas.connector
Class CenterTarget

java.lang.Object
  extended by diva.canvas.connector.AbstractConnectorTarget
      extended by diva.canvas.connector.CenterTarget
All Implemented Interfaces:
ConnectorTarget

public class CenterTarget
extends AbstractConnectorTarget

An implementation of connector targets that finds center sites.

Version:
$Id: CenterTarget.java 38798 2005-07-08 20:00:01Z cxh $
Author:
John Reekie, Michael Shilman

Field Summary
private  java.util.HashMap _siteMap
          The mapping from figures to sites.
 
Constructor Summary
CenterTarget()
           
 
Method Summary
 Site getHeadSite(Figure f, double x, double y)
          Return a center site located on the figure, if the figure is not a connector.
 
Methods inherited from class diva.canvas.connector.AbstractConnectorTarget
acceptHead, acceptTail, getHeadSite, getHeadSite, getHeadSite, getTailSite, getTailSite, getTailSite, getTailSite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_siteMap

private java.util.HashMap _siteMap
The mapping from figures to sites. Ignore the problem that none of the contents will ever get garbage-collected.

Constructor Detail

CenterTarget

public CenterTarget()
Method Detail

getHeadSite

public Site getHeadSite(Figure f,
                        double x,
                        double y)
Return a center site located on the figure, if the figure is not a connector.

Specified by:
getHeadSite in interface ConnectorTarget
Specified by:
getHeadSite in class AbstractConnectorTarget