Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.draw2d;
12

    
13
import org.eclipse.draw2d.geometry.Point;
14

    
15
/**
16
 * An object to which a {@link Connection} will be anchored. If the
17
 * ConnectionAnchor moves, the Connection should move with it.
18
 */
19
public interface ConnectionAnchor {
20

    
21
	/**
22
	 * Adds a listener interested in the movement of this ConnectionAnchor.
23
	 * 
24
	 * @param listener
25
	 *            The AnchorListener to be added
26
	 */
27
	void addAnchorListener(AnchorListener listener);
28

    
29
	/**
30
	 * Returns the location where the Connection should be anchored in absolute
31
	 * coordinates. The anchor may use the given reference Point to calculate
32
	 * this location.
33
	 * 
34
	 * @param reference
35
	 *            The reference Point in absolute coordinates
36
	 * @return The anchor's location
37
	 */
38
	Point getLocation(Point reference);
39

    
40
	/**
41
	 * Returns the IFigure that contains this ConnectionAnchor. Moving this
42
	 * figure will cause the anchor to move with it.
43
	 * 
44
	 * @return The IFigure that contains this ConnectionAnchor
45
	 */
46
	IFigure getOwner();
47

    
48
	/**
49
	 * Returns the reference point for this anchor in absolute coordinates. This
50
	 * might be used by another anchor to determine its own location (i.e.
51
	 * {@link ChopboxAnchor}).
52
	 * 
53
	 * @return The reference Point
54
	 */
55
	Point getReferencePoint();
56

    
57
	/**
58
	 * Removes the listener.
59
	 * 
60
	 * @param listener
61
	 *            The AnchorListener to be removed
62
	 */
63
	void removeAnchorListener(AnchorListener listener);
64

    
65
}
(43-43/171)