comparison dwtx/draw2d/Connection.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.Connection;
14
15 import dwt.dwthelper.utils;
16
17 import dwtx.draw2d.geometry.PointList;
18 import dwtx.draw2d.IFigure;
19 import dwtx.draw2d.ConnectionRouter;
20 import dwtx.draw2d.ConnectionAnchor;
21
22 /**
23 * A Connection is a figure that connects two objects.
24 */
25 public interface Connection : IFigure {
26
27 /**
28 * The connection router property. Used to signify that the ConnectionRouter has changed.
29 */
30 static const String PROPERTY_CONNECTION_ROUTER = "connectionRouter"; //$NON-NLS-1$
31 /**
32 * The points property. Used to signify the points in the Connection have changed.
33 */
34 static const String PROPERTY_POINTS = "points"; //$NON-NLS-1$
35
36 /**
37 * Returns the ConnectionRouter used to route this Connection. Does not return null.
38 *
39 * @return The ConnectionRouter for this Connection
40 */
41 ConnectionRouter getConnectionRouter();
42
43 /**
44 * Sets the ConnectionRouter for this Connection.
45 *
46 * @param router The ConnectionRouter to set for this Connection
47 */
48 void setConnectionRouter(ConnectionRouter router);
49
50 /**
51 * Returns the ConnectionAnchor at the <b>source</b> end of this Connection.
52 * @return The ConnectionAnchor at the <b>source</b> end of this Connection
53 */
54 ConnectionAnchor getSourceAnchor();
55
56 /**
57 * Returns the ConnectionAnchor at the <b>target</b> end of this Connection.
58 * @return The ConnectionAnchor at the <b>target</b> end of this Connection
59 */
60 ConnectionAnchor getTargetAnchor();
61
62 /**
63 * Returns the routing constraint. May be <code>null</code>.
64 * @return The routing constraint
65 */
66 Object getRoutingConstraint();
67
68 /**
69 * Sets the routing constraint used by the router.
70 * @param cons The routing constraint
71 */
72 void setRoutingConstraint(Object cons);
73
74 /**
75 * Sets the ConnectionAnchor to be used at the <i>source</i> end of this Connection.
76 * @param anchor The source anchor
77 */
78 void setSourceAnchor(ConnectionAnchor anchor);
79
80 /**
81 * Sets the ConnectionAnchor to be used at the <i>target</i> end of this Connection.
82 * @param anchor The target anchor
83 */
84 void setTargetAnchor(ConnectionAnchor anchor);
85
86 /**
87 * Returns the PointList containing the Points that make up this Connection. This may be
88 * returned by reference.
89 * @return The points for this Connection
90 */
91 PointList getPoints();
92
93 /**
94 * Sets the PointList containing the Points that make up this Connection.
95 * @param list The points for this Connection
96 */
97 void setPoints(PointList list);
98
99 }