annotate dwt/graphics/LineAttributes.d @ 246:fd9c62a2998e

Updater SWT 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Tue, 01 Jul 2008 10:15:59 +0200
parents 6696f884b8a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
246
fd9c62a2998e Updater SWT 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
6
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10 * Port to the D programming language:
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 * Frank Benoit <benoit@tionex.de>
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 *******************************************************************************/
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 module dwt.graphics.LineAttributes;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 import dwt.DWT;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 * <code>LineAttributes</code> defines a set of line attributes that
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 * can be modified in a GC.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 * <p>
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 * Application code does <em>not</em> need to explicitly release the
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22 * resources managed by each instance when those instances are no longer
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 * required, and thus no <code>dispose()</code> method is provided.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 * </p>
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 * @see GC#getLineAttributes()
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 * @see GC#setLineAttributes(LineAttributes)
246
fd9c62a2998e Updater SWT 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
28 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
6
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 * @since 3.3
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 public class LineAttributes {
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 * The line width.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 public float width;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 * The line style.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 * @see dwt.DWT#LINE_CUSTOM
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 * @see dwt.DWT#LINE_DASH
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 * @see dwt.DWT#LINE_DASHDOT
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 * @see dwt.DWT#LINE_DASHDOTDOT
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 * @see dwt.DWT#LINE_DOT
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 * @see dwt.DWT#LINE_SOLID
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 public int style;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 * The line cap style.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 * @see dwt.DWT#CAP_FLAT
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 * @see dwt.DWT#CAP_ROUND
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 * @see dwt.DWT#CAP_SQUARE
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 public int cap;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 * The line join style.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 * @see dwt.DWT#JOIN_BEVEL
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 * @see dwt.DWT#JOIN_MITER
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 * @see dwt.DWT#JOIN_ROUND
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 public int join;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 * The line dash style for DWT.LINE_CUSTOM.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72 public float[] dash;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75 * The line dash style offset for DWT.LINE_CUSTOM.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77 public float dashOffset;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 * The line miter limit.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82 public float miterLimit;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85 * Create a new line attributes with the specified line width.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87 * @param width the line width
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 public this(float width) {
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 this(width, DWT.CAP_FLAT, DWT.JOIN_MITER, DWT.LINE_SOLID, null, 0, 10);
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91 }
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94 * Create a new line attributes with the specified line cap, join and width.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 * @param width the line width
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97 * @param cap the line cap style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 * @param join the line join style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 public this(float width, int cap, int join) {
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101 this(width, cap, join, DWT.LINE_SOLID, null, 0, 10);
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 }
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 /**
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105 * Create a new line attributes with the specified arguments.
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 *
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 * @param width the line width
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 * @param cap the line cap style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 * @param join the line join style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 * @param style the line style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 * @param dash the line dash style
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 * @param dashOffset the line dash style offset
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 * @param miterLimit the line miter limit
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 */
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 public this(float width, int cap, int join, int style, float[] dash, float dashOffset, float miterLimit) {
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 this.width = width;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 this.cap = cap;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 this.join = join;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 this.style = style;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 this.dash = dash;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 this.dashOffset = dashOffset;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 this.miterLimit = miterLimit;
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 }
6696f884b8a6 RGB, LineAttributes
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 }