JHotDraw 7.0.6

org.jhotdraw.draw
Interface Connector

All Superinterfaces:
java.lang.Cloneable, DOMStorable, java.io.Serializable
All Known Implementing Classes:
AbstractConnector, ChopBezierConnector, ChopBoxConnector, ChopDiamondConnector, ChopEllipseConnector, ChopRoundRectConnector, ChopTriangleConnector, LocatorConnector, StickyChopConnector

public interface Connector
extends java.lang.Cloneable, java.io.Serializable, DOMStorable

Connectors know how to locate a connection point on a figure. A Connector knows its owning figure and can determine either the start or the endpoint of a given connection figure. A connector has a display box that describes the area of a figure it is responsible for. A connector can be visible but it doesn't have to be.


Method Summary
 java.lang.Object clone()
          Returns a clone of the Connection.
 boolean contains(java.awt.geom.Point2D.Double p)
          Tests if a point is contained in the connector.
 void draw(java.awt.Graphics2D g)
          Draws this connector.
 java.awt.geom.Point2D.Double findEnd(ConnectionFigure connection)
          Finds the end point for the connection.
 java.awt.geom.Point2D.Double findStart(ConnectionFigure connection)
          Finds the start point for the connection.
 java.awt.geom.Point2D.Double getAnchor()
          Gets the anchor of the connector.
 java.awt.geom.Rectangle2D.Double getBounds()
          Gets the display box of the connector.
 Figure getOwner()
          Gets the connector's owner.
 void updateAnchor(java.awt.geom.Point2D.Double p)
          Updates the anchor of the connector.
 
Methods inherited from interface org.jhotdraw.xml.DOMStorable
read, write
 

Method Detail

findStart

java.awt.geom.Point2D.Double findStart(ConnectionFigure connection)
Finds the start point for the connection.


findEnd

java.awt.geom.Point2D.Double findEnd(ConnectionFigure connection)
Finds the end point for the connection.


getOwner

Figure getOwner()
Gets the connector's owner.


getBounds

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


getAnchor

java.awt.geom.Point2D.Double getAnchor()
Gets the anchor of the connector. This is a point at the center or at the bounds of the figure, where the start or the end point will most likely be attached. The purpose of this method is to give the user a hint, where the connector will most likely be attached to the owner of the connector.


updateAnchor

void updateAnchor(java.awt.geom.Point2D.Double p)
Updates the anchor of the connector. This method is called when the user manually changes the end point of the ConnectionFigure. The Connector can use this as a hint, where the user wants to place the start or end point of the ConnectionFigure.


contains

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


draw

void draw(java.awt.Graphics2D g)
Draws this connector. Connectors don't have to be visible and it is OK leave this method empty.


clone

java.lang.Object clone()
Returns a clone of the Connection.


Copyright 1996-2006 © JHotDraw.org