comparison dwtx/draw2d/text/FlowBorder.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) 2004, 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
14 module dwtx.draw2d.text.FlowBorder;
15
16 import dwt.dwthelper.utils;
17
18 import dwtx.draw2d.Border;
19 import dwtx.draw2d.Graphics;
20 import dwtx.draw2d.geometry.Rectangle;
21 import dwtx.draw2d.text.FlowFigure;
22
23 /**
24 * Experimental API. This is a special type of border for use with {@link
25 * dwtx.draw2d.text.FlowFigure}s. This interface should not be implemented by
26 * clients. Clients should extend {@link dwtx.draw2d.text.AbstractFlowBorder}.
27 * @since 3.1
28 */
29 public interface FlowBorder : Border {
30
31 /**
32 * Returns the collapsable bottom margin in pixels. Margin is the space external to the
33 * border and the flow box on which it is rendered. Vertical margins (top and bottom) may
34 * collapse in some situations, such as adjacent or nested blocks.
35 * @return the bottom margin
36 * @since 3.1
37 */
38 int getBottomMargin();
39
40 /**
41 * Returns the left margin in pixels. Margin is the space external to the border and the
42 * flow box on which it is rendered.
43 * @return the left margin
44 * @since 3.1
45 */
46 int getLeftMargin();
47
48 /**
49 * Returns the right margin in pixels. Margin is the space external to the border and the
50 * flow box on which it is rendered.
51 * @return the right margin
52 * @since 3.1
53 */
54 int getRightMargin();
55
56 /**
57 * Returns the collapsable top margin in pixels. Margin is the space external to the
58 * border and the flow box on which it is rendered. Vertical margins (top and bottom) may
59 * collapse in some situations, such as adjacent or nested blocks.
60 * @return the top margin
61 * @since 3.1
62 */
63 int getTopMargin();
64
65 /**
66 * Paints the border around the given box location. The border is asked to paint each of
67 * the FlowFigure's boxes. The <code>sideInfo</code> parameter is used to indicate whether
68 * the left and right sides should be rendered. This parameter will contain the following
69 * bit flags:
70 * <UL>
71 * <LI>{@link dwt.DWT#LEAD}
72 * <LI>{@link dwt.DWT#TRAIL}
73 * <LI>{@link dwt.DWT#RIGHT_TO_LEFT}
74 * </UL>
75 * @param figure the flow figure whose border is being painted
76 * @param g the graphics
77 * @param where the relative location of the box
78 * @param sides bits indicating sides and bidi orientation
79 * @since 3.1
80 */
81 void paint(FlowFigure figure, Graphics g, Rectangle where, int sides);
82
83 }