1757
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2003 by eXept Software AG
|
|
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 |
"
|
1626
|
12 |
"{ Package: 'stx:libview2' }"
|
1607
|
13 |
|
3454
|
14 |
"{ NameSpace: Smalltalk }"
|
|
15 |
|
1607
|
16 |
Object subclass:#MultiImage
|
|
17 |
instanceVariableNames:'images'
|
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Graphics-Images'
|
|
21 |
!
|
|
22 |
|
1757
|
23 |
!MultiImage class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2003 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
!
|
|
38 |
|
|
39 |
documentation
|
|
40 |
"
|
|
41 |
A multiImage is an image which is drawn by drawing multiple images on top of each other.
|
|
42 |
|
|
43 |
[author:]
|
|
44 |
Claus Gittinger
|
|
45 |
"
|
|
46 |
! !
|
1607
|
47 |
|
|
48 |
!MultiImage class methodsFor:'instance creation'!
|
|
49 |
|
|
50 |
images:imageCollection
|
|
51 |
^ self new images:imageCollection
|
|
52 |
! !
|
|
53 |
|
|
54 |
!MultiImage methodsFor:'accessing'!
|
|
55 |
|
1614
|
56 |
device
|
2064
|
57 |
images isNil ifTrue:[^ nil].
|
1614
|
58 |
^ images first device
|
|
59 |
!
|
|
60 |
|
|
61 |
images
|
|
62 |
"return the value of the instance variable 'images' (automatically generated)"
|
|
63 |
|
|
64 |
^ images
|
|
65 |
!
|
|
66 |
|
1607
|
67 |
images:something
|
|
68 |
"set the value of the instance variable 'images' (automatically generated)"
|
|
69 |
|
|
70 |
images := something.
|
|
71 |
! !
|
|
72 |
|
|
73 |
!MultiImage methodsFor:'displaying'!
|
|
74 |
|
|
75 |
displayOn:aGC x:x y:y opaque:opaque
|
|
76 |
|doOpaque|
|
|
77 |
|
|
78 |
doOpaque := opaque.
|
|
79 |
images do:[:eachImage |
|
|
80 |
eachImage displayOn:aGC x:x y:y opaque:doOpaque.
|
|
81 |
doOpaque := false.
|
|
82 |
].
|
|
83 |
! !
|
|
84 |
|
1614
|
85 |
!MultiImage methodsFor:'misc'!
|
|
86 |
|
|
87 |
clearMaskedPixels
|
|
88 |
images := images do:[:eachImage | eachImage clearMaskedPixels].
|
|
89 |
^ self
|
|
90 |
!
|
|
91 |
|
|
92 |
onDevice:device
|
1654
|
93 |
images := images collect:[:eachImage | (eachImage onDevice:device) ? eachImage].
|
1614
|
94 |
^ self
|
|
95 |
! !
|
|
96 |
|
3454
|
97 |
|
1614
|
98 |
!MultiImage methodsFor:'queries'!
|
|
99 |
|
1708
|
100 |
ascentOn:aGC
|
|
101 |
"I will not draw myself above the baseline"
|
|
102 |
|
|
103 |
^ 0
|
|
104 |
!
|
|
105 |
|
3324
|
106 |
depth
|
|
107 |
^ images inject:0 into:[:maxSoFar :eachImage | maxSoFar max:eachImage depth].
|
|
108 |
!
|
|
109 |
|
|
110 |
extent
|
|
111 |
^ self width @ self height
|
|
112 |
!
|
|
113 |
|
1614
|
114 |
height
|
|
115 |
^ images inject:0 into:[:maxSoFar :eachImage | maxSoFar max:eachImage height].
|
|
116 |
!
|
|
117 |
|
|
118 |
isImageOrForm
|
|
119 |
^ true
|
|
120 |
!
|
|
121 |
|
|
122 |
width
|
|
123 |
^ images inject:0 into:[:maxSoFar :eachImage | maxSoFar max:eachImage width].
|
|
124 |
! !
|
|
125 |
|
1607
|
126 |
!MultiImage class methodsFor:'documentation'!
|
|
127 |
|
|
128 |
version
|
3454
|
129 |
^ '$Header: /cvs/stx/stx/libview2/MultiImage.st,v 1.10 2015-03-26 10:07:18 cg Exp $'
|
1607
|
130 |
! !
|
3324
|
131 |
|