Mercurial > projects > dwt-addons
comparison dwtx/draw2d/ConnectionAnchor.d @ 98:95307ad235d9
Added Draw2d code, still work in progress
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 00:52:14 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
96:b492ba44e44d | 98:95307ad235d9 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2005 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.draw2d.ConnectionAnchor; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 import dwtx.draw2d.geometry.Point; | |
18 import dwtx.draw2d.AnchorListener; | |
19 import dwtx.draw2d.IFigure; | |
20 | |
21 /** | |
22 * An object to which a {@link Connection} will be anchored. If the ConnectionAnchor | |
23 * moves, the Connection should move with it. | |
24 */ | |
25 public interface ConnectionAnchor { | |
26 | |
27 /** | |
28 * Adds a listener interested in the movement of this ConnectionAnchor. | |
29 * @param listener The AnchorListener to be added | |
30 */ | |
31 void addAnchorListener(AnchorListener listener); | |
32 | |
33 /** | |
34 * Returns the location where the Connection should be anchored in absolute coordinates. | |
35 * The anchor may use the given reference Point to calculate this location. | |
36 * @param reference The reference Point in absolute coordinates | |
37 * @return The anchor's location | |
38 */ | |
39 Point getLocation(Point reference); | |
40 | |
41 /** | |
42 * Returns the IFigure that contains this ConnectionAnchor. Moving this figure will cause | |
43 * the anchor to move with it. | |
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 might be used | |
50 * by another anchor to determine its own location (i.e. {@link ChopboxAnchor}). | |
51 * @return The reference Point | |
52 */ | |
53 Point getReferencePoint(); | |
54 | |
55 /** | |
56 * Removes the listener. | |
57 * @param listener The AnchorListener to be removed | |
58 */ | |
59 void removeAnchorListener(AnchorListener listener); | |
60 | |
61 } |