JHotDraw 7.3.1

org.jhotdraw.draw
Class LocatorConnector

java.lang.Object
  extended by org.jhotdraw.draw.AbstractConnector
      extended by org.jhotdraw.draw.LocatorConnector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Connector, DOMStorable

public class LocatorConnector
extends AbstractConnector

A LocatorConnector locates connection points with the help of a Locator. It supports the definition of connection points to semantic locations.

Version:
$Id: LocatorConnector.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer
See Also:
Locator, Connector, Serialized Form

Field Summary
static int SIZE
          The standard size of the connector.
 
Constructor Summary
LocatorConnector()
          Creates a new instance.
LocatorConnector(Figure owner, Locator l)
           
 
Method Summary
 boolean contains(java.awt.geom.Point2D.Double p)
          Tests if a point is contained in the connector.
 java.awt.geom.Rectangle2D.Double getBounds()
          Gets the display box of the connector.
 Locator getLocator()
           
protected  java.awt.geom.Point2D.Double locate(ConnectionFigure connection)
           
 void read(DOMInput in)
           
 void write(DOMOutput out)
           
 
Methods inherited from class org.jhotdraw.draw.AbstractConnector
clone, draw, findEnd, findPoint, findStart, getAnchor, getConnectorTarget, getDrawingArea, getOwner, isConnectToDecorator, setConnectToDecorator, setOwner, updateAnchor, updateEndLocation, updateStartLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
The standard size of the connector. The display box is centered around the located point.

FIXME - Why do we need a standard size?

See Also:
Constant Field Values
Constructor Detail

LocatorConnector

public LocatorConnector()
Creates a new instance. Only used for DOMStorable.


LocatorConnector

public LocatorConnector(Figure owner,
                        Locator l)
Method Detail

getLocator

public Locator getLocator()

locate

protected java.awt.geom.Point2D.Double locate(ConnectionFigure connection)

contains

public boolean contains(java.awt.geom.Point2D.Double p)
Tests if a point is contained in the connector.

Specified by:
contains in interface Connector
Overrides:
contains in class AbstractConnector

getBounds

public java.awt.geom.Rectangle2D.Double getBounds()
Gets the display box of the connector.

Specified by:
getBounds in interface Connector
Overrides:
getBounds in class AbstractConnector

read

public void read(DOMInput in)
          throws java.io.IOException
Specified by:
read in interface DOMStorable
Overrides:
read in class AbstractConnector
Throws:
java.io.IOException

write

public void write(DOMOutput out)
           throws java.io.IOException
Specified by:
write in interface DOMStorable
Overrides:
write in class AbstractConnector
Throws:
java.io.IOException

Copyright 1996-2009 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.