author | Merge Script |
Fri, 17 Jun 2016 07:02:11 +0200 | |
branch | jv |
changeset 7393 | 04ffdb8eebcc |
parent 6528 | 62c1dbef0b84 |
permissions | -rw-r--r-- |
151 | 1 |
" |
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
151 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
12 |
"{ Package: 'stx:libview' }" |
151 | 13 |
|
14 |
Object subclass:#GraphicsAttributes |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
15 |
instanceVariableNames:'paint font lineStyle lineWidth joinStyle capStyle maskOrigin' |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
16 |
classVariableNames:'' |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
17 |
poolDictionaries:'' |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
18 |
category:'Graphics-Support' |
151 | 19 |
! |
20 |
||
21 |
!GraphicsAttributes class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
instances keep multiple graphics attributes as used in a graphicsContext. |
|
40 |
They can be used when multiple attributes are to be set. |
|
157 | 41 |
This class is (currently) not used by the system, but has been added |
42 |
to make porting of existing ST-80 applications easier. |
|
151 | 43 |
|
44 |
Instance variables: |
|
45 |
||
46 |
paint <Color> the paint to be used for drawing |
|
47 |
font <Font> the font to be used for drawing |
|
48 |
lineStyle <Symbol> the lineStyle (i.e. #solid, #dashed, #doubleDashed) |
|
49 |
lineWidth <SmallInteger> the lineWidth (device dependent, usually pixels) |
|
50 |
joinStyle <Symbol> the style in which lines (in polygons) |
|
51 |
are joined (i.e. #miter, #bevel, #round) |
|
52 |
capStyle <Symbol> the style in which the last point of a line is drawn |
|
53 |
(i.e. #notLast, #butt, #round, #projecting) |
|
54 |
maskOrigin <Point> the origin of the mask relative to |
|
55 |
the drawables origin |
|
56 |
||
57 |
CAVEAT: the maskOrigin is called phase in ST-80 |
|
58 |
" |
|
59 |
! ! |
|
60 |
||
61 |
!GraphicsAttributes methodsFor:'accessing'! |
|
62 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
63 |
capStyle |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
64 |
"return the cap-style for line-drawing" |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
65 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
66 |
^ capStyle |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
67 |
! |
151 | 68 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
69 |
capStyle:aStyleSymbol |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
70 |
"set the cap-style for line-drawing; |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
71 |
possible styles are: #notLast, #butt, #round, #projecting" |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
72 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
73 |
capStyle := aStyleSymbol |
151 | 74 |
! |
75 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
76 |
font |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
77 |
"return the drawing font" |
151 | 78 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
79 |
^ font |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
80 |
! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
81 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
82 |
font:aFont |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
83 |
"set the drawing font" |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
84 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
85 |
font := aFont |
151 | 86 |
! |
87 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
88 |
joinStyle |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
89 |
"return the join-style for polygon-drawing" |
151 | 90 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
91 |
^ joinStyle |
151 | 92 |
! |
93 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
94 |
joinStyle:aStyleSymbol |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
95 |
"set the join-style of lines in polygon-drawing; |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
96 |
possible styles are: #miter, #bevel, #round" |
151 | 97 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
98 |
joinStyle := aStyleSymbol |
151 | 99 |
! |
100 |
||
101 |
lineStyle |
|
102 |
"return the line-drawing-style" |
|
103 |
||
104 |
^ lineStyle |
|
105 |
! |
|
106 |
||
107 |
lineStyle:aStyleSymbol |
|
108 |
"set the line-drawing-style; |
|
109 |
possible styles are: #solid, #dashed, #doubleDashed" |
|
110 |
||
111 |
lineStyle := aStyleSymbol |
|
112 |
! |
|
113 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
114 |
lineWidth |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
115 |
"return the drawing linewidth" |
151 | 116 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
117 |
^ lineWidth |
151 | 118 |
! |
119 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
120 |
lineWidth:aNumber |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
121 |
"set the line drawing width in pixels" |
151 | 122 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
123 |
lineWidth := aNumber |
151 | 124 |
! |
125 |
||
126 |
maskOrigin:aPoint |
|
127 |
"set the origin within the mask (used to draw with patterns). |
|
128 |
This is an alias for ST-80's #phase" |
|
129 |
||
130 |
maskOrigin := aPoint |
|
131 |
! |
|
132 |
||
133 |
maskOriginX:x y:y |
|
134 |
"set the origin within the mask (used to draw with patterns)." |
|
135 |
||
136 |
^ maskOrigin |
|
137 |
! |
|
138 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
139 |
paint |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
140 |
"return the current paint drawing color" |
151 | 141 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
142 |
^ paint |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
143 |
! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
144 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
145 |
paint:aColor |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
146 |
"set the drawing painting color" |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
147 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
148 |
paint := aColor |
151 | 149 |
! |
150 |
||
151 |
phase |
|
152 |
"return the origin within the mask (used to draw with patterns). |
|
153 |
This is an alias for ST/X's #maskOrigin" |
|
154 |
||
155 |
^ maskOrigin |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
156 |
! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
157 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
158 |
phase:aPoint |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
159 |
"set the origin within the mask (used to draw with patterns). |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
160 |
This is an alias for ST/X's #maskOrigin:" |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
161 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
162 |
maskOrigin := aPoint |
151 | 163 |
! ! |
164 |
||
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
165 |
!GraphicsAttributes methodsFor:'installing'! |
151 | 166 |
|
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
167 |
installOn:aGC |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
168 |
paint notNil ifTrue:[aGC paint:paint]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
169 |
font notNil ifTrue:[aGC font:font]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
170 |
lineWidth notNil ifTrue:[aGC lineWidth:lineWidth]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
171 |
lineStyle notNil ifTrue:[aGC lineStyle:lineStyle]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
172 |
joinStyle notNil ifTrue:[aGC joinStyle:joinStyle]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
173 |
capStyle notNil ifTrue:[aGC capStyle:capStyle]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
174 |
maskOrigin notNil ifTrue:[aGC maskOrigin:capStyle]. |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
175 |
! ! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
176 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
177 |
!GraphicsAttributes class methodsFor:'documentation'! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
178 |
|
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
179 |
version |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
180 |
^ '$Header: /cvs/stx/stx/libview/GraphicsAttributes.st,v 1.4 1995-11-11 15:51:01 cg Exp $' |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
181 |
! ! |
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
219
diff
changeset
|
182 |