comparison dwtx/draw2d/PositionConstants.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.PositionConstants;
14
15 import dwt.dwthelper.utils;
16
17 /**
18 * Constants representing cardinal directions and relative positions. Some of these
19 * constants can be grouped as follows:
20 * <TABLE border="1" cellpadding="5" cellspacing="0">
21 * <TBODY>
22 * <TR>
23 * <TD>LEFT, CENTER, RIGHT</TD>
24 * <TD>Used to describe horizontal position.</TD>
25 * </TR>
26 * <TR>
27 * <TD>TOP, MIDDLE, BOTTOM</TD>
28 * <TD>Used to describe vertical position.</TD>
29 * </TR>
30 * <TR>
31 * <TD>NORTH, SOUTH, EAST, WEST</TD>
32 * <TD>Used to describe the four positions relative to an object's center point.
33 * May also be used when describing which direction an object is facing.<BR>
34 * NOTE: If you have a use for all four of these possibilities, do not use TOP,
35 * BOTTOM, RIGHT, LEFT in place of NORTH, SOUTH, EAST, WEST.</TD>
36 * </TR>
37 * </TBODY>
38 * </TABLE>
39 */
40 public interface PositionConstants {
41
42 /** None */
43 static const int NONE = 0;
44
45 /** Left */
46 static const int LEFT = 1;
47 /** Center (Horizontal) */
48 static const int CENTER = 2;
49 /** Right */
50 static const int RIGHT = 4;
51 /** Bit-wise OR of LEFT, CENTER, and RIGHT */
52 static const int LEFT_CENTER_RIGHT = LEFT | CENTER | RIGHT;
53 /** Used to signify left alignment regardless of orientation (i.e., LTR or RTL) */
54 static const int ALWAYS_LEFT = 64;
55 /** Used to signify right alignment regardless of orientation (i.e., LTR or RTL) */
56 static const int ALWAYS_RIGHT = 128;
57
58 /** Top */
59 static const int TOP = 8;
60 /** Middle (Vertical) */
61 static const int MIDDLE = 16;
62 /** Bottom */
63 static const int BOTTOM = 32;
64 /** Bit-wise OR of TOP, MIDDLE, and BOTTOM */
65 static const int TOP_MIDDLE_BOTTOM = TOP | MIDDLE | BOTTOM;
66
67 /** North */
68 static const int NORTH = 1;
69 /** South */
70 static const int SOUTH = 4;
71 /** West */
72 static const int WEST = 8;
73 /** East */
74 static const int EAST = 16;
75
76 /** A constant indicating horizontal direction */
77 static const int HORIZONTAL = 64;
78 /** A constant indicating vertical direction */
79 static const int VERTICAL = 128;
80
81 /** North-East: a bit-wise OR of {@link #NORTH} and {@link #EAST} */
82 static const int NORTH_EAST = NORTH | EAST;
83 /** North-West: a bit-wise OR of {@link #NORTH} and {@link #WEST} */
84 static const int NORTH_WEST = NORTH | WEST;
85 /** South-East: a bit-wise OR of {@link #SOUTH} and {@link #EAST} */
86 static const int SOUTH_EAST = SOUTH | EAST;
87 /** South-West: a bit-wise OR of {@link #SOUTH} and {@link #WEST} */
88 static const int SOUTH_WEST = SOUTH | WEST;
89 /** North-South: a bit-wise OR of {@link #NORTH} and {@link #SOUTH} */
90 static const int NORTH_SOUTH = NORTH | SOUTH;
91 /** East-West: a bit-wise OR of {@link #EAST} and {@link #WEST} */
92 static const int EAST_WEST = EAST | WEST;
93
94 /** North-South-East-West: a bit-wise OR of all 4 directions. */
95 static const int NSEW = NORTH_SOUTH | EAST_WEST;
96
97 }