Mercurial > projects > dwt-mac
comparison dwt/graphics/LineAttributes.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 1a8b3cb347e0 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
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 *******************************************************************************/ | |
11 module dwt.graphics.LineAttributes; | |
12 | |
13 import dwt.dwthelper.utils; | |
14 | |
15 import dwt.DWT; | |
16 | |
17 /** | |
18 * <code>LineAttributes</code> defines a set of line attributes that | |
19 * can be modified in a GC. | |
20 * <p> | |
21 * Application code does <em>not</em> need to explicitly release the | |
22 * resources managed by each instance when those instances are no longer | |
23 * required, and thus no <code>dispose()</code> method is provided. | |
24 * </p> | |
25 * | |
26 * @see GC#getLineAttributes() | |
27 * @see GC#setLineAttributes(LineAttributes) | |
28 * | |
29 * @since 3.3 | |
30 */ | |
31 public class LineAttributes { | |
32 | |
33 /** | |
34 * The line width. | |
35 */ | |
36 public float width; | |
37 | |
38 /** | |
39 * The line style. | |
40 * | |
41 * @see dwt.DWT#LINE_CUSTOM | |
42 * @see dwt.DWT#LINE_DASH | |
43 * @see dwt.DWT#LINE_DASHDOT | |
44 * @see dwt.DWT#LINE_DASHDOTDOT | |
45 * @see dwt.DWT#LINE_DOT | |
46 * @see dwt.DWT#LINE_SOLID | |
47 */ | |
48 public int style; | |
49 | |
50 /** | |
51 * The line cap style. | |
52 * | |
53 * @see dwt.DWT#CAP_FLAT | |
54 * @see dwt.DWT#CAP_ROUND | |
55 * @see dwt.DWT#CAP_SQUARE | |
56 */ | |
57 public int cap; | |
58 | |
59 /** | |
60 * The line join style. | |
61 * | |
62 * @see dwt.DWT#JOIN_BEVEL | |
63 * @see dwt.DWT#JOIN_MITER | |
64 * @see dwt.DWT#JOIN_ROUND | |
65 */ | |
66 public int join; | |
67 | |
68 /** | |
69 * The line dash style for DWT.LINE_CUSTOM. | |
70 */ | |
71 public float[] dash; | |
72 | |
73 /** | |
74 * The line dash style offset for DWT.LINE_CUSTOM. | |
75 */ | |
76 public float dashOffset; | |
77 | |
78 /** | |
79 * The line miter limit. | |
80 */ | |
81 public float miterLimit; | |
82 | |
83 /** | |
84 * Create a new line attributes with the specified line width. | |
85 * | |
86 * @param width the line width | |
87 */ | |
88 public LineAttributes(float width) { | |
89 this(width, DWT.CAP_FLAT, DWT.JOIN_MITER, DWT.LINE_SOLID, null, 0, 10); | |
90 } | |
91 | |
92 /** | |
93 * Create a new line attributes with the specified line cap, join and width. | |
94 * | |
95 * @param width the line width | |
96 * @param cap the line cap style | |
97 * @param join the line join style | |
98 */ | |
99 public LineAttributes(float width, int cap, int join) { | |
100 this(width, cap, join, DWT.LINE_SOLID, null, 0, 10); | |
101 } | |
102 | |
103 /** | |
104 * Create a new line attributes with the specified arguments. | |
105 * | |
106 * @param width the line width | |
107 * @param cap the line cap style | |
108 * @param join the line join style | |
109 * @param style the line style | |
110 * @param dash the line dash style | |
111 * @param dashOffset the line dash style offset | |
112 * @param miterLimit the line miter limit | |
113 */ | |
114 public LineAttributes(float width, int cap, int join, int style, float[] dash, float dashOffset, float miterLimit) { | |
115 this.width = width; | |
116 this.cap = cap; | |
117 this.join = join; | |
118 this.style = style; | |
119 this.dash = dash; | |
120 this.dashOffset = dashOffset; | |
121 this.miterLimit = miterLimit; | |
122 } | |
123 } |