Mercurial > projects > dwt2
comparison org.eclipse.draw2d/src/org/eclipse/draw2d/LabelAnchor.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
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 org.eclipse.draw2d.LabelAnchor; | |
14 | |
15 import java.lang.all; | |
16 | |
17 import org.eclipse.draw2d.geometry.Rectangle; | |
18 import org.eclipse.draw2d.ChopboxAnchor; | |
19 import org.eclipse.draw2d.Label; | |
20 | |
21 /** | |
22 * LabelAnchors must have an owner of type {@link Label}. The LabelAnchor behaves like | |
23 * {@link ChopboxAnchor} but {@link Connection Connections} will point to the center of | |
24 * its owner's icon as opposed to the center of the entire owning Label. | |
25 */ | |
26 public class LabelAnchor | |
27 : ChopboxAnchor | |
28 { | |
29 | |
30 /** | |
31 * Constructs a LabelAnchor with no owner. | |
32 * | |
33 * @since 2.0 | |
34 */ | |
35 protected this() { } | |
36 | |
37 /** | |
38 * Constructs a LabelAnchor with owner <i>label</i>. | |
39 * @param label This LabelAnchor's owner | |
40 * @since 2.0 | |
41 */ | |
42 public this(Label label) { | |
43 super(label); | |
44 } | |
45 | |
46 /** | |
47 * Returns the bounds of this LabelAnchor's owning Label icon. | |
48 * @return The bounds of this LabelAnchor's owning Label icon | |
49 * @since 2.0 | |
50 */ | |
51 protected Rectangle getBox() { | |
52 Label label = cast(Label)getOwner(); | |
53 return label.getIconBounds(); | |
54 } | |
55 | |
56 } |