Mercurial > projects > dwt-addons
annotate dwtx/ui/internal/forms/widgets/ParagraphSegment.d @ 104:04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 15:01:33 +0200 |
parents | 5d489b9f966c |
children |
rev | line source |
---|---|
75 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2007 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.ui.internal.forms.widgets.ParagraphSegment; | |
14 | |
15 import dwtx.ui.internal.forms.widgets.Locator; | |
16 import dwtx.ui.internal.forms.widgets.SelectionData; | |
17 | |
18 import dwt.graphics.GC; | |
19 import dwt.graphics.Rectangle; | |
20 | |
21 import dwt.dwthelper.utils; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
75
diff
changeset
|
22 import dwtx.dwtxhelper.Collection; |
75 | 23 |
24 /** | |
25 * @version 1.0 | |
26 * @author | |
27 */ | |
28 public abstract class ParagraphSegment { | |
29 /** | |
30 * Moves the locator according to the content of this segment. | |
31 * @param gc | |
32 * @param wHint | |
33 * @param loc | |
34 * @param objectTable | |
35 * @param computeHeightOnly | |
36 * @return <code>true</code> if text wrapped to the new line, <code>false</code> otherwise. | |
37 */ | |
38 public abstract bool advanceLocator(GC gc, int wHint, Locator loc, Hashtable objectTable, bool computeHeightOnly); | |
39 /** | |
40 * Computes bounding rectangles and row heights of this segments. | |
41 * @param gc | |
42 * @param width | |
43 * @param loc | |
44 * @param resourceTable | |
45 * @param selected | |
46 */ | |
47 public abstract void layout(GC gc, int width, Locator loc, Hashtable resourceTable, bool selected); | |
48 /** | |
49 * Paints this segment. | |
50 * @param gc | |
51 * @param hover | |
52 * @param resourceTable | |
53 * @param selected | |
54 * @param selData | |
55 * @param region | |
56 */ | |
57 public abstract void paint(GC gc, bool hover, Hashtable resourceTable, bool selected, SelectionData selData, Rectangle region); | |
58 /** | |
59 * Paints this segment. | |
60 * @param gc | |
61 * @param resourceTable | |
62 * @param selData | |
63 */ | |
64 public abstract void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData); | |
65 /** | |
66 * Tests if the coordinates are contained in one of the | |
67 * bounding rectangles of this segment. | |
68 * @param x | |
69 * @param y | |
70 * @return true if inside the bounding rectangle, false otherwise. | |
71 */ | |
72 public abstract bool contains(int x, int y); | |
73 /** | |
74 * Tests if the source rectangle intersects with | |
75 * one of the bounding rectangles of this segment. | |
76 * @param rect | |
77 * @return true if the two rectangles intersect, false otherwise. | |
78 */ | |
79 public abstract bool intersects(Rectangle rect); | |
80 /** | |
81 * Returns the tool tip of this segment or <code>null</code> | |
82 * if not defined. | |
83 * @return tooltip or <code>null</code>. | |
84 */ | |
85 public String getTooltipText() { | |
86 return null; | |
87 } | |
88 /** | |
89 * Clears the text metrics cache for the provided font id. | |
90 * @param fontId the id of the font that the cache is kept for. | |
91 * | |
92 */ | |
93 public void clearCache(String fontId) { | |
94 } | |
95 } |