Mercurial > projects > dwt2
comparison org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ParagraphSegment.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 | dbfb303e8fb0 |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
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 org.eclipse.ui.internal.forms.widgets.ParagraphSegment; | |
14 | |
15 import org.eclipse.ui.internal.forms.widgets.Locator; | |
16 import org.eclipse.ui.internal.forms.widgets.SelectionData; | |
17 | |
18 import org.eclipse.swt.graphics.GC; | |
19 import org.eclipse.swt.graphics.Rectangle; | |
20 | |
21 import java.lang.all; | |
22 | |
23 /** | |
24 * @version 1.0 | |
25 * @author | |
26 */ | |
27 public abstract class ParagraphSegment { | |
28 /** | |
29 * Moves the locator according to the content of this segment. | |
30 * @param gc | |
31 * @param wHint | |
32 * @param loc | |
33 * @param objectTable | |
34 * @param computeHeightOnly | |
35 * @return <code>true</code> if text wrapped to the new line, <code>false</code> otherwise. | |
36 */ | |
37 public abstract bool advanceLocator(GC gc, int wHint, Locator loc, Hashtable objectTable, bool computeHeightOnly); | |
38 /** | |
39 * Computes bounding rectangles and row heights of this segments. | |
40 * @param gc | |
41 * @param width | |
42 * @param loc | |
43 * @param resourceTable | |
44 * @param selected | |
45 */ | |
46 public abstract void layout(GC gc, int width, Locator loc, Hashtable resourceTable, bool selected); | |
47 /** | |
48 * Paints this segment. | |
49 * @param gc | |
50 * @param hover | |
51 * @param resourceTable | |
52 * @param selected | |
53 * @param selData | |
54 * @param region | |
55 */ | |
56 public abstract void paint(GC gc, bool hover, Hashtable resourceTable, bool selected, SelectionData selData, Rectangle region); | |
57 /** | |
58 * Paints this segment. | |
59 * @param gc | |
60 * @param resourceTable | |
61 * @param selData | |
62 */ | |
63 public abstract void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData); | |
64 /** | |
65 * Tests if the coordinates are contained in one of the | |
66 * bounding rectangles of this segment. | |
67 * @param x | |
68 * @param y | |
69 * @return true if inside the bounding rectangle, false otherwise. | |
70 */ | |
71 public abstract bool contains(int x, int y); | |
72 /** | |
73 * Tests if the source rectangle intersects with | |
74 * one of the bounding rectangles of this segment. | |
75 * @param rect | |
76 * @return true if the two rectangles intersect, false otherwise. | |
77 */ | |
78 public abstract bool intersects(Rectangle rect); | |
79 /** | |
80 * Returns the tool tip of this segment or <code>null</code> | |
81 * if not defined. | |
82 * @return tooltip or <code>null</code>. | |
83 */ | |
84 public String getTooltipText() { | |
85 return null; | |
86 } | |
87 /** | |
88 * Clears the text metrics cache for the provided font id. | |
89 * @param fontId the id of the font that the cache is kept for. | |
90 * | |
91 */ | |
92 public void clearCache(String fontId) { | |
93 } | |
94 } |