author | Claus Gittinger <cg@exept.de> |
Fri, 04 Mar 2011 15:38:39 +0100 | |
changeset 2837 | 491837239003 |
parent 2827 | c99d2c520b28 |
child 2841 | 5f247fa01174 |
permissions | -rw-r--r-- |
400 | 1 |
" |
767 | 2 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 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 |
|
405 | 7 |
inclusion of the above copyright notice. This software may not |
400 | 8 |
be provided or otherwise made available to, or used by, any |
405 | 9 |
other person. No title to or ownership of the software is |
400 | 10 |
hereby transferred. |
11 |
" |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
12 |
"{ Package: 'stx:libtool2' }" |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
13 |
|
1975 | 14 |
ResourceSpecEditor subclass:#ImageEditor |
975 | 15 |
instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode |
1960 | 16 |
selectedColorIndex postOpenAction imageSeqNr drawingColormap |
2767 | 17 |
lastShiftUsedWrap lastGrabbedScreenArea |
18 |
allowedToChangeImageDimensionAndDepth' |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
19 |
classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode |
2796 | 20 |
DefaultRelativeSizes LastURL' |
929 | 21 |
poolDictionaries:'' |
22 |
category:'Interface-UIPainter' |
|
400 | 23 |
! |
24 |
||
25 |
!ImageEditor class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
767 | 29 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 30 |
All Rights Reserved |
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
405 | 34 |
inclusion of the above copyright notice. This software may not |
400 | 35 |
be provided or otherwise made available to, or used by, any |
405 | 36 |
other person. No title to or ownership of the software is |
400 | 37 |
hereby transferred. |
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
737 | 43 |
Image Editor allows you to create, design, modify or just inspect images. |
400 | 44 |
|
45 |
[start with:] |
|
46 |
ImageEditor open |
|
941 | 47 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
400 | 48 |
|
49 |
[see also:] |
|
50 |
ImageEditView Image |
|
51 |
||
52 |
[author:] |
|
544 | 53 |
Thomas Zwick, eXept Software AG |
1806 | 54 |
Claus Gittinger, eXept Software AG |
400 | 55 |
" |
56 |
! ! |
|
57 |
||
58 |
!ImageEditor class methodsFor:'instance creation'! |
|
59 |
||
1975 | 60 |
openLoadingImageWith:aBlock |
61 |
"opens an Image Editor on anImage" |
|
62 |
||
63 |
|editor| |
|
64 |
||
65 |
editor := self new. |
|
66 |
editor allButOpen. |
|
67 |
aBlock value:editor. |
|
2764 | 68 |
editor openWindow. |
69 |
^ editor |
|
1975 | 70 |
! |
71 |
||
400 | 72 |
openModalOnClass: aClass andSelector: aSelector |
1975 | 73 |
"opens a modal Image Editor on aClass and aSelector. |
74 |
Returns the real name of the edited resource method (in case, user changed it)." |
|
75 |
||
76 |
|imageEditor imageEditView className resourceClass resourceSelector| |
|
767 | 77 |
|
400 | 78 |
imageEditor := self new. |
767 | 79 |
|
900 | 80 |
aClass isClass ifTrue: [className := aClass name]. |
81 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 82 |
aClass isNil ifTrue: [className := '']. |
400 | 83 |
|
2764 | 84 |
imageEditor postOpenAction: [ |
85 |
imageEditView := imageEditor imageEditView. |
|
86 |
imageEditor loadFromOrPrepareForClass: aClass andSelector: aSelector |
|
87 |
]. |
|
400 | 88 |
imageEditor openModal. |
89 |
||
1975 | 90 |
resourceClass := imageEditView resourceClass. |
91 |
resourceSelector := imageEditView resourceSelector. |
|
92 |
||
93 |
(resourceClass isNil or:[resourceSelector isNil]) ifTrue:[^ nil]. |
|
94 |
^ Array with:resourceClass with:resourceSelector |
|
1966 | 95 |
|
96 |
" |
|
97 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
98 |
" |
|
400 | 99 |
! |
100 |
||
2764 | 101 |
openModalOnImage:anImage |
102 |
"opens a modal Image Editor on an image. |
|
103 |
Returns the modified image or nil if unsaved/unchanged" |
|
104 |
||
105 |
|imageEditor imageEditView newImage| |
|
106 |
||
107 |
imageEditor := self new. |
|
2767 | 108 |
imageEditor allowedToChangeImageDimensionAndDepth:false. |
2764 | 109 |
imageEditor postOpenAction: [ |
110 |
imageEditView := imageEditor imageEditView. |
|
111 |
imageEditor loadFromImage: anImage |
|
112 |
]. |
|
113 |
imageEditor openModal. |
|
114 |
||
2766 | 115 |
newImage := imageEditor savedImage. |
2764 | 116 |
^ newImage |
117 |
! |
|
118 |
||
1966 | 119 |
openOnClass:aClass andSelector:aSelector |
120 |
"opens an Image Editor on aClass and aSelector" |
|
400 | 121 |
|
2764 | 122 |
self openLoadingImageWith:[:editor | |
123 |
editor loadFromClass:aClass theNonMetaclass andSelector:aSelector. |
|
124 |
] |
|
1057 | 125 |
|
1966 | 126 |
" |
127 |
self openOnClass:self andSelector:#leftMouseKeyIcon |
|
128 |
self openOnClass:self andSelector:nil |
|
129 |
" |
|
130 |
||
1057 | 131 |
"Modified: / 16.3.1999 / 21:33:49 / cg" |
400 | 132 |
! |
133 |
||
1966 | 134 |
openOnFile:aFileName |
135 |
"opens an Image Editor on aFileName" |
|
400 | 136 |
|
2764 | 137 |
self openLoadingImageWith:[:editor | |
138 |
editor loadFromFile:aFileName. |
|
139 |
] |
|
1057 | 140 |
|
1966 | 141 |
" |
1975 | 142 |
self openOnFile: '../../goodies/bitmaps/gifImages/back.gif' |
1966 | 143 |
" |
144 |
||
1057 | 145 |
"Modified: / 16.3.1999 / 21:33:25 / cg" |
400 | 146 |
! |
147 |
||
1966 | 148 |
openOnImage:anImage |
149 |
"opens an Image Editor on anImage" |
|
400 | 150 |
|
2764 | 151 |
self openLoadingImageWith:[:editor | |
152 |
editor loadFromImage: anImage. |
|
153 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
154 |
|
1966 | 155 |
" |
156 |
self openOnImage: Icon startIcon |
|
157 |
" |
|
158 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
159 |
"Modified: / 11.3.1999 / 16:18:33 / cg" |
400 | 160 |
! ! |
161 |
||
162 |
!ImageEditor class methodsFor:'accessing'! |
|
163 |
||
164 |
listOfColorMaps |
|
767 | 165 |
"returns the list of default color maps for a new image" |
400 | 166 |
|
167 |
|colorMap| |
|
898 | 168 |
|
400 | 169 |
(colorMap := OrderedCollection new) |
170 |
add: Color black; |
|
171 |
add: Color white; |
|
172 |
add: Color red; |
|
173 |
add: Color green; |
|
174 |
add: Color blue; |
|
175 |
add: Color cyan; |
|
176 |
add: Color yellow; |
|
177 |
add: Color magenta; |
|
898 | 178 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
179 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
180 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
181 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
182 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
183 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
184 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
185 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
186 |
||
400 | 187 |
0 to: 5 do: |
188 |
[:r| |
|
189 |
0 to: 5 do: |
|
190 |
[:g| |
|
191 |
0 to: 5 do: |
|
192 |
[:b| |
|
898 | 193 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 194 |
] |
195 |
] |
|
196 |
]. |
|
197 |
||
198 |
1 to: 25 do: |
|
199 |
[:g| |
|
898 | 200 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 201 |
]. |
202 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
203 |
^ Dictionary new |
2571 | 204 |
at: #depth32 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
205 |
at: #depth24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
206 |
at: #masked24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
207 |
at: #depth16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
208 |
at: #masked16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
209 |
at: #depth8 put: colorMap; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
210 |
at: #masked8 put: colorMap; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
211 |
at: #depth4 put: (colorMap copyFrom: 1 to: 16); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
212 |
at: #masked4 put: (colorMap copyFrom: 1 to: 16); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
213 |
at: #depth2 put: (colorMap copyFrom: 1 to: 4); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
214 |
at: #masked2 put: (colorMap copyFrom: 1 to: 4); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
215 |
at: #depth1 put: (colorMap copyFrom: 1 to: 2); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
216 |
at: #masked1 put: (colorMap copyFrom: 1 to: 2); |
400 | 217 |
yourself |
218 |
! |
|
219 |
||
220 |
listOfDefaultSizes |
|
767 | 221 |
"returns the list of default sizes for a new image" |
400 | 222 |
|
1960 | 223 |
^ #('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
224 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
225 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
226 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
227 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
228 |
namesOfColorMaps |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
229 |
^ Dictionary new |
2571 | 230 |
at: #depth32 put: '32-plane (rgba)'; |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
231 |
at: #depth24 put: '24-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
232 |
at: #masked24 put: '24-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
233 |
at: #depth16 put: '16-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
234 |
at: #masked16 put: '16-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
235 |
at: #depth8 put: ' 8-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
236 |
at: #masked8 put: ' 8-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
237 |
at: #depth4 put: ' 4-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
238 |
at: #masked4 put: ' 4-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
239 |
at: #depth2 put: ' 2-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
240 |
at: #masked2 put: ' 2-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
241 |
at: #depth1 put: ' 1-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
242 |
at: #masked1 put: ' 1-plane + mask' ; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
243 |
yourself |
400 | 244 |
! ! |
245 |
||
460 | 246 |
!ImageEditor class methodsFor:'help specs'! |
247 |
||
1545 | 248 |
flyByHelpSpec |
249 |
<resource: #help> |
|
250 |
||
251 |
^super flyByHelpSpec addPairsFrom:#( |
|
252 |
||
253 |
#drawModeBox |
|
254 |
'Rectangle' |
|
255 |
||
256 |
#drawModeCopy |
|
257 |
'Copy' |
|
258 |
||
259 |
#drawModeFill |
|
1637 | 260 |
'Flood-Fill' |
1545 | 261 |
|
262 |
#drawModeFilledBox |
|
1637 | 263 |
'Filled Rectangle' |
1545 | 264 |
|
265 |
#drawModePaste |
|
266 |
'Paste' |
|
267 |
||
268 |
#drawModePasteUnder |
|
1637 | 269 |
'Paste Under' |
270 |
||
271 |
#drawModePasteWithMask |
|
1656 | 272 |
'Paste with Mask' |
1545 | 273 |
|
274 |
#drawModePoint |
|
275 |
'Point' |
|
276 |
||
1639 | 277 |
#drawModeSpecial |
278 |
'Special Operations' |
|
279 |
||
1545 | 280 |
#fileGrabImage |
1748
a62052c6ee71
toolBar: icons and added a saveToFile button
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
281 |
'Pick from Screen' |
1545 | 282 |
|
283 |
#fileLoadFromClass |
|
1884 | 284 |
'Load from Method...' |
1545 | 285 |
|
286 |
#fileLoadFromFile |
|
1884 | 287 |
'Load from File...' |
1545 | 288 |
|
289 |
#fileNewImage |
|
1637 | 290 |
'New Image' |
1545 | 291 |
|
292 |
#filePrint |
|
293 |
'Print' |
|
294 |
||
295 |
#fileSaveAs |
|
1884 | 296 |
'Save to File...' |
1545 | 297 |
|
298 |
#fileSaveMaskAs |
|
1884 | 299 |
'Save Mask to File...' |
1545 | 300 |
|
301 |
#fileSaveMethod |
|
1637 | 302 |
'Save as Method' |
1545 | 303 |
|
304 |
#fileSaveMethodAs |
|
1884 | 305 |
'Save as Method...' |
1545 | 306 |
|
2812 | 307 |
#nextImageInSequence |
308 |
'Go to the next image in the animated gif image sequence.' |
|
309 |
||
310 |
#previousImageInSequence |
|
311 |
'Go to the previous image in the animated gif image sequence.' |
|
1545 | 312 |
) |
2812 | 313 |
|
314 |
"Modified: / 21-10-2010 / 14:58:32 / cg" |
|
1545 | 315 |
! |
316 |
||
460 | 317 |
helpSpec |
737 | 318 |
"This resource specification was automatically generated |
319 |
by the UIHelpTool of ST/X." |
|
320 |
||
321 |
"Do not manually edit this!! If it is corrupted, |
|
322 |
the UIHelpTool may not be able to read the specification." |
|
460 | 323 |
|
324 |
" |
|
737 | 325 |
UIHelpTool openOnClass:ImageEditor |
460 | 326 |
" |
327 |
||
737 | 328 |
<resource: #help> |
329 |
||
2765 | 330 |
^ super helpSpec addPairsFrom:#( |
460 | 331 |
|
332 |
#colorMap |
|
2765 | 333 |
'ColorMap functions' |
929 | 334 |
|
335 |
#colorMap1 |
|
2765 | 336 |
'Convert to depth-1 image' |
929 | 337 |
|
986 | 338 |
#colorMap1M |
2765 | 339 |
'Convert to depth-1 image plus mask' |
986 | 340 |
|
929 | 341 |
#colorMap2 |
2765 | 342 |
'Convert to depth-2 image' |
343 |
||
344 |
#colorMap24 |
|
345 |
'Convert to depth-24 image (rgb)' |
|
929 | 346 |
|
986 | 347 |
#colorMap2M |
2765 | 348 |
'Convert to depth-2 image plus mask' |
349 |
||
350 |
#colorMap32 |
|
351 |
'Convert to depth-32 image (rgba)' |
|
986 | 352 |
|
929 | 353 |
#colorMap4 |
2765 | 354 |
'Convert to depth-4 image' |
929 | 355 |
|
986 | 356 |
#colorMap4M |
2765 | 357 |
'Convert to depth-4 image plus mask' |
986 | 358 |
|
929 | 359 |
#colorMap8 |
2765 | 360 |
'Convert to depth-8 image' |
929 | 361 |
|
362 |
#colorMap8M |
|
2765 | 363 |
'Convert to depth-8 image plus mask' |
2571 | 364 |
|
986 | 365 |
#colorMapTable |
2765 | 366 |
'Shows a list of used colors of the image' |
986 | 367 |
|
929 | 368 |
#compressColormap |
2765 | 369 |
'Remove unneeded entries from the colorMap' |
460 | 370 |
|
1045 | 371 |
#cropAll |
2765 | 372 |
'Find and remove all borders' |
986 | 373 |
|
1045 | 374 |
#cropBottom |
2765 | 375 |
'Find and remove bottom border' |
986 | 376 |
|
1045 | 377 |
#cropLeft |
2765 | 378 |
'Find and remove left border' |
986 | 379 |
|
1045 | 380 |
#cropManual |
986 | 381 |
'Specify border(s) to remove.' |
382 |
||
1045 | 383 |
#cropRight |
2765 | 384 |
'Find and remove right border' |
986 | 385 |
|
1045 | 386 |
#cropTop |
2765 | 387 |
'Find and remove top border' |
487 | 388 |
|
460 | 389 |
#drawModeBox |
2765 | 390 |
'Rectangle Drawing Mode' |
460 | 391 |
|
2375 | 392 |
#drawModeCircle |
2765 | 393 |
'Circle Drawing Mode' |
2375 | 394 |
|
460 | 395 |
#drawModeCopy |
2765 | 396 |
'Area Copy Mode' |
460 | 397 |
|
398 |
#drawModeFill |
|
2765 | 399 |
'Flood Fill Mode' |
460 | 400 |
|
401 |
#drawModeFilledBox |
|
2765 | 402 |
'Filled Rectangle Drawing Mode' |
460 | 403 |
|
404 |
#drawModePaste |
|
2765 | 405 |
'Paste Mode' |
914 | 406 |
|
407 |
#drawModePasteUnder |
|
2765 | 408 |
'Paste-Under Mode' |
1637 | 409 |
|
410 |
#drawModePasteWithMask |
|
2765 | 411 |
'Paste-with-Mask Mode' |
460 | 412 |
|
413 |
#drawModePoint |
|
2765 | 414 |
'Point Drawing Mode' |
2375 | 415 |
|
1639 | 416 |
#drawModeSpecial |
417 |
'Special Operations' |
|
418 |
||
2765 | 419 |
#drawModeSpray |
420 |
'Spray Drawing Mode' |
|
421 |
||
460 | 422 |
#editFlipHorizontal |
2765 | 423 |
'Flip the image horizontally' |
460 | 424 |
|
425 |
#editFlipVertical |
|
2765 | 426 |
'Flip the image vertically' |
460 | 427 |
|
428 |
#editMagnifyImage |
|
2765 | 429 |
'Magnify the image' |
460 | 430 |
|
431 |
#editNegate |
|
2765 | 432 |
'Invert the images colors' |
460 | 433 |
|
434 |
#editResize |
|
2765 | 435 |
'Resize the image (preserving the old image)' |
460 | 436 |
|
437 |
#editRotate |
|
2765 | 438 |
'Rotate the image' |
460 | 439 |
|
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
440 |
#fileGrabImageFromScreen |
2765 | 441 |
'Pick an image from the screen (specify area)' |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
442 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
443 |
#fileGrabImageFromWindow |
2765 | 444 |
'Pick an image from a window on the screen (click on window)' |
929 | 445 |
|
460 | 446 |
#fileLoadFromClass |
2765 | 447 |
'Select and load an image from a resource method' |
460 | 448 |
|
449 |
#fileLoadFromFile |
|
2765 | 450 |
'Select and load an image from a file' |
460 | 451 |
|
2796 | 452 |
#fileLoadFromURL |
453 |
'Load an image from the net, given its URL' |
|
454 |
||
460 | 455 |
#fileNewImage |
914 | 456 |
'Create a new image' |
460 | 457 |
|
458 |
#filePrint |
|
2765 | 459 |
'Print the image on a postscript printer' |
460 |
||
461 |
#fileSave |
|
462 |
'Save the image' |
|
460 | 463 |
|
464 |
#fileSaveAs |
|
2765 | 465 |
'Save the image to a file' |
466 |
||
467 |
#fileSaveButtonImageAs |
|
468 |
'Save an image of a button with the image to a file (for html use)' |
|
460 | 469 |
|
470 |
#fileSaveMaskAs |
|
2765 | 471 |
'Save the mask of the image to a file' |
1613 | 472 |
|
460 | 473 |
#fileSaveMethod |
2765 | 474 |
'Save the image as resource method in the current class and selector' |
460 | 475 |
|
476 |
#fileSaveMethodAs |
|
2765 | 477 |
'Save the image as resource method in a class' |
460 | 478 |
|
487 | 479 |
#magnificationNumber |
2765 | 480 |
'Shows the current magnification' |
487 | 481 |
|
482 |
#magnifyImageDown |
|
2765 | 483 |
'Decrease magnification' |
487 | 484 |
|
485 |
#magnifyImageUp |
|
2765 | 486 |
'Increase magnification' |
487 | 487 |
|
488 |
#mouseKeyColorMode |
|
2765 | 489 |
'Toggle between left and right mouse button color' |
487 | 490 |
|
491 |
#previewView |
|
2765 | 492 |
'Shows a preview of the image' |
487 | 493 |
|
905 | 494 |
#settingsGridMagnification |
2765 | 495 |
'Change the grid magnification of the edit view' |
905 | 496 |
|
460 | 497 |
) |
498 |
! ! |
|
499 |
||
737 | 500 |
!ImageEditor class methodsFor:'image specs'! |
501 |
||
2272 | 502 |
circleIcon |
503 |
"This resource specification was automatically generated |
|
504 |
by the ImageEditor of ST/X." |
|
505 |
||
506 |
"Do not manually edit this!! If it is corrupted, |
|
507 |
the ImageEditor may not be able to read the specification." |
|
508 |
||
509 |
" |
|
510 |
self circleIcon inspect |
|
511 |
ImageEditor openOnClass:self andSelector:#circleIcon |
|
512 |
Icon flushCachedIcons |
|
513 |
" |
|
514 |
||
515 |
<resource: #image> |
|
516 |
||
517 |
^Icon |
|
518 |
constantNamed:'ImageEditor class circleIcon' |
|
519 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@N@CF@PDA@PH@ BB@HDA@PD@1 @8@@@@@a') ; yourself); yourself] |
|
520 |
! |
|
521 |
||
1637 | 522 |
copyIcon |
523 |
"This resource specification was automatically generated |
|
524 |
by the ImageEditor of ST/X." |
|
525 |
||
526 |
"Do not manually edit this!! If it is corrupted, |
|
527 |
the ImageEditor may not be able to read the specification." |
|
528 |
||
529 |
" |
|
530 |
self copyIcon inspect |
|
531 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
532 |
Icon flushCachedIcons |
|
533 |
" |
|
534 |
||
535 |
<resource: #image> |
|
536 |
||
537 |
^Icon |
|
2272 | 538 |
constantNamed:'ImageEditor class copyIcon' |
1975 | 539 |
ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@** @@J)UUTB*Z*)@*&**PJ)**$B*Z*)@*&**PJ)**$@@Z*)@@F**P@AUUT@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@C? O>@??3??O?<??3??O?<??3??@_<A?0@@@@a') ; yourself); yourself] |
1637 | 540 |
! |
541 |
||
2155 | 542 |
defaultIcon |
543 |
<resource: #programImage> |
|
544 |
||
545 |
^ ToolbarIconLibrary startImageEditorIcon |
|
546 |
! |
|
547 |
||
1637 | 548 |
fillIcon |
549 |
"This resource specification was automatically generated |
|
550 |
by the ImageEditor of ST/X." |
|
551 |
||
552 |
"Do not manually edit this!! If it is corrupted, |
|
553 |
the ImageEditor may not be able to read the specification." |
|
554 |
||
555 |
" |
|
556 |
self fillIcon inspect |
|
557 |
ImageEditor openOnClass:self andSelector:#fillIcon |
|
558 |
Icon flushCachedIcons |
|
559 |
" |
|
560 |
||
561 |
<resource: #image> |
|
562 |
||
563 |
^Icon |
|
2272 | 564 |
constantNamed:'ImageEditor class fillIcon' |
1975 | 565 |
ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@ @@@@*H@@D*(@@DUUP@EAUU@AAEU@@@@U@@DDA@@@@@@@@PP@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C @Q@BN@I<@?8C?0[?!!G<@O P\@@ D@@@@@@@@@a') ; yourself); yourself] |
1637 | 566 |
! |
567 |
||
568 |
fillRectIcon |
|
569 |
"This resource specification was automatically generated |
|
570 |
by the ImageEditor of ST/X." |
|
571 |
||
572 |
"Do not manually edit this!! If it is corrupted, |
|
573 |
the ImageEditor may not be able to read the specification." |
|
574 |
||
575 |
" |
|
576 |
self fillRectIcon inspect |
|
577 |
ImageEditor openOnClass:self andSelector:#fillRectIcon |
|
578 |
Icon flushCachedIcons |
|
579 |
" |
|
580 |
||
581 |
<resource: #image> |
|
582 |
||
583 |
^Icon |
|
2272 | 584 |
constantNamed:'ImageEditor class fillRectIcon' |
585 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a') ; yourself); yourself] |
|
1637 | 586 |
! |
587 |
||
2837 | 588 |
flipHorizontalIcon |
589 |
"This resource specification was automatically generated |
|
590 |
by the ImageEditor of ST/X." |
|
591 |
||
592 |
"Do not manually edit this!! If it is corrupted, |
|
593 |
the ImageEditor may not be able to read the specification." |
|
594 |
||
595 |
" |
|
596 |
self flipHorizontalIcon inspect |
|
597 |
ImageEditor openOnClass:self andSelector:#flipHorizontalIcon |
|
598 |
Icon flushCachedIcons |
|
599 |
" |
|
600 |
||
601 |
<resource: #image> |
|
602 |
||
603 |
^Icon |
|
604 |
constantNamed:'ImageEditor class flipHorizontalIcon' |
|
605 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@A@C?8HP )JC$8_?1??C$8JR !!BC?8@P@@@@@a') ; yourself); yourself] |
|
606 |
! |
|
607 |
||
608 |
flipVerticalIcon |
|
609 |
"This resource specification was automatically generated |
|
610 |
by the ImageEditor of ST/X." |
|
611 |
||
612 |
"Do not manually edit this!! If it is corrupted, |
|
613 |
the ImageEditor may not be able to read the specification." |
|
614 |
||
615 |
" |
|
616 |
self flipVerticalIcon inspect |
|
617 |
ImageEditor openOnClass:self andSelector:#flipVerticalIcon |
|
618 |
Icon flushCachedIcons |
|
619 |
" |
|
620 |
||
621 |
<resource: #image> |
|
622 |
||
623 |
^Icon |
|
624 |
constantNamed:'ImageEditor class flipVerticalIcon' |
|
625 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@C@C?0I9@/4BLPH1A?>BLPH1@/4B^PO?@C@@@a') ; yourself); yourself] |
|
626 |
! |
|
627 |
||
737 | 628 |
leftMouseKeyIcon |
629 |
"This resource specification was automatically generated |
|
630 |
by the ImageEditor of ST/X." |
|
631 |
||
632 |
"Do not manually edit this!! If it is corrupted, |
|
633 |
the ImageEditor may not be able to read the specification." |
|
634 |
||
635 |
" |
|
1405 | 636 |
self leftMouseKeyIcon inspect |
737 | 637 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
2272 | 638 |
Icon flushCachedIcons |
737 | 639 |
" |
640 |
||
641 |
<resource: #image> |
|
642 |
||
643 |
^Icon |
|
2272 | 644 |
constantNamed:'ImageEditor class leftMouseKeyIcon' |
645 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EJJ@@AR" @@T((@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself] |
|
1433 | 646 |
! |
737 | 647 |
|
1637 | 648 |
pasteIcon |
649 |
"This resource specification was automatically generated |
|
650 |
by the ImageEditor of ST/X." |
|
651 |
||
652 |
"Do not manually edit this!! If it is corrupted, |
|
653 |
the ImageEditor may not be able to read the specification." |
|
654 |
||
655 |
" |
|
656 |
self pasteIcon inspect |
|
657 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
658 |
Icon flushCachedIcons |
|
659 |
" |
|
660 |
||
661 |
<resource: #image> |
|
662 |
||
663 |
^Icon |
|
2272 | 664 |
constantNamed:'ImageEditor class pasteIcon' |
1975 | 665 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3A&Y&X@@SL0Y A&@@D3LF@@A @AL3A&@FX@@QDPY&Y& |
666 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
1637 | 667 |
! |
668 |
||
669 |
pasteUnderIcon |
|
670 |
"This resource specification was automatically generated |
|
671 |
by the ImageEditor of ST/X." |
|
672 |
||
673 |
"Do not manually edit this!! If it is corrupted, |
|
674 |
the ImageEditor may not be able to read the specification." |
|
675 |
||
676 |
" |
|
677 |
self pasteUnderIcon inspect |
|
678 |
ImageEditor openOnClass:self andSelector:#pasteUnderIcon |
|
679 |
Icon flushCachedIcons |
|
680 |
" |
|
681 |
||
682 |
<resource: #image> |
|
683 |
||
684 |
^Icon |
|
2272 | 685 |
constantNamed:'ImageEditor class pasteUnderIcon' |
1975 | 686 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L3LP@@@AL3L3E&X@@SL3L0A&@@D3L3@@A @AL3L3@FX@@QDQDQY& |
687 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
1637 | 688 |
! |
689 |
||
690 |
pasteWithMaskIcon |
|
691 |
"This resource specification was automatically generated |
|
692 |
by the ImageEditor of ST/X." |
|
693 |
||
694 |
"Do not manually edit this!! If it is corrupted, |
|
695 |
the ImageEditor may not be able to read the specification." |
|
696 |
||
697 |
" |
|
698 |
self pasteWithMaskIcon inspect |
|
699 |
ImageEditor openOnClass:self andSelector:#pasteWithMaskIcon |
|
700 |
Icon flushCachedIcons |
|
701 |
" |
|
702 |
||
703 |
<resource: #image> |
|
704 |
||
705 |
^Icon |
|
2272 | 706 |
constantNamed:'ImageEditor class pasteWithMaskIcon' |
707 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3@3M&X@@SL0L3A&@@D3LCL0A @AL3@3LFX@@QDPY&Y& |
|
708 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
1637 | 709 |
! |
710 |
||
711 |
pointIcon |
|
712 |
"This resource specification was automatically generated |
|
713 |
by the ImageEditor of ST/X." |
|
714 |
||
715 |
"Do not manually edit this!! If it is corrupted, |
|
716 |
the ImageEditor may not be able to read the specification." |
|
717 |
||
718 |
" |
|
719 |
self pointIcon inspect |
|
720 |
ImageEditor openOnClass:self andSelector:#pointIcon |
|
721 |
Icon flushCachedIcons |
|
722 |
" |
|
723 |
||
724 |
<resource: #image> |
|
725 |
||
726 |
^Icon |
|
2272 | 727 |
constantNamed:'ImageEditor class pointIcon' |
1975 | 728 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@0@G@@8@G@@8@G@@8@G@@X@@@@@@@@@@@a') ; yourself); yourself] |
1637 | 729 |
! |
730 |
||
731 |
rectIcon |
|
732 |
"This resource specification was automatically generated |
|
733 |
by the ImageEditor of ST/X." |
|
734 |
||
735 |
"Do not manually edit this!! If it is corrupted, |
|
736 |
the ImageEditor may not be able to read the specification." |
|
737 |
||
738 |
" |
|
739 |
self rectIcon inspect |
|
740 |
ImageEditor openOnClass:self andSelector:#rectIcon |
|
741 |
Icon flushCachedIcons |
|
742 |
" |
|
743 |
||
744 |
<resource: #image> |
|
745 |
||
746 |
^Icon |
|
2272 | 747 |
constantNamed:'ImageEditor class rectIcon' |
748 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0HA@ DB@PHA@ DB@PHA@ DC?0@@@@@@@a') ; yourself); yourself] |
|
1637 | 749 |
! |
750 |
||
737 | 751 |
rightMouseKeyIcon |
752 |
"This resource specification was automatically generated |
|
753 |
by the ImageEditor of ST/X." |
|
754 |
||
755 |
"Do not manually edit this!! If it is corrupted, |
|
756 |
the ImageEditor may not be able to read the specification." |
|
757 |
||
758 |
" |
|
1405 | 759 |
self rightMouseKeyIcon inspect |
737 | 760 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
2272 | 761 |
Icon flushCachedIcons |
737 | 762 |
" |
763 |
||
764 |
<resource: #image> |
|
765 |
||
766 |
^Icon |
|
2272 | 767 |
constantNamed:'ImageEditor class rightMouseKeyIcon' |
768 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself] |
|
1637 | 769 |
! |
770 |
||
771 |
specialIcon |
|
772 |
"This resource specification was automatically generated |
|
773 |
by the ImageEditor of ST/X." |
|
774 |
||
775 |
"Do not manually edit this!! If it is corrupted, |
|
776 |
the ImageEditor may not be able to read the specification." |
|
777 |
||
778 |
" |
|
779 |
self specialIcon inspect |
|
780 |
ImageEditor openOnClass:self andSelector:#specialIcon |
|
781 |
Icon flushCachedIcons |
|
782 |
" |
|
783 |
||
784 |
<resource: #image> |
|
785 |
||
786 |
^Icon |
|
2272 | 787 |
constantNamed:'ImageEditor class specialIcon' |
788 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@@B@@@@@0@@@@@@@@@@@@@@@P@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@0@G @^@A8@G @L@@0@@@@L@@0@@@@@a') ; yourself); yourself] |
|
2375 | 789 |
! |
790 |
||
791 |
sprayIcon |
|
792 |
"This resource specification was automatically generated |
|
793 |
by the ImageEditor of ST/X." |
|
794 |
||
795 |
"Do not manually edit this!! If it is corrupted, |
|
796 |
the ImageEditor may not be able to read the specification." |
|
797 |
||
798 |
" |
|
799 |
self sprayIcon inspect |
|
800 |
ImageEditor openOnClass:self andSelector:#sprayIcon |
|
801 |
Icon flushCachedIcons |
|
802 |
" |
|
803 |
||
804 |
<resource: #image> |
|
805 |
||
806 |
^Icon |
|
807 |
constantNamed:'ImageEditor class sprayIcon' |
|
808 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#[4]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@D@@@@@@@DA@@@@@@D@D@@@@@@A@PD@@@@@@A@P@@@@@@@A@P@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
809 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 84 84 84 170 170 170 255 255 255 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@B@@(A)@F*@IPA2 H$@"@BH@H @"@BH@O @@a') ; yourself); yourself] |
|
1433 | 810 |
! ! |
737 | 811 |
|
400 | 812 |
!ImageEditor class methodsFor:'interface specs'! |
813 |
||
1650 | 814 |
changeHLSDialogSpec |
815 |
"This resource specification was automatically generated |
|
816 |
by the UIPainter of ST/X." |
|
817 |
||
818 |
"Do not manually edit this!! If it is corrupted, |
|
819 |
the UIPainter may not be able to read the specification." |
|
820 |
||
821 |
" |
|
822 |
UIPainter new openOnClass:ImageEditor andSelector:#changeHLSDialogSpec |
|
823 |
ImageEditor new openInterface:#changeHLSDialogSpec |
|
824 |
" |
|
825 |
||
826 |
<resource: #canvas> |
|
827 |
||
828 |
^ |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
829 |
#(FullSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
830 |
name: changeHLSDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
831 |
window: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
832 |
(WindowSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
833 |
label: 'HLS Edit Dialog' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
834 |
name: 'HLS Edit Dialog' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
835 |
min: (Point 10 10) |
2438 | 836 |
bounds: (Rectangle 0 0 312 258) |
1650 | 837 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
838 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
839 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
840 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
841 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
842 |
label: 'Hue-Shift:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
843 |
name: 'HueLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
844 |
layout: (LayoutFrame 20 0 21 0 120 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
845 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
846 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
847 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
848 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
849 |
name: 'HueShiftEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
850 |
layout: (LayoutFrame 123 0 21 0 166 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
851 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
852 |
model: hueShiftAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
853 |
type: numberInRange |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
854 |
minValue: 0 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
855 |
maxValue: 360 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
856 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
857 |
acceptOnPointerLeave: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
858 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
859 |
(ThumbWheelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
860 |
name: 'HueWheel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
861 |
layout: (LayoutFrame 180 0 22 0 297 0 42 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
862 |
model: hueShiftAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
863 |
orientation: horizontal |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
864 |
step: 1 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
865 |
endlessRotation: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
866 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
867 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
868 |
label: 'Light Factor:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
869 |
name: 'LightLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
870 |
layout: (LayoutFrame 18 0 50 0 120 0 72 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
871 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
872 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
873 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
874 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
875 |
name: 'LightEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
876 |
layout: (LayoutFrame 123 0 50 0 166 0 72 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
877 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
878 |
model: lightAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
879 |
type: numberInRange |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
880 |
minValue: 0 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
881 |
maxValue: 1000 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
882 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
883 |
acceptOnPointerLeave: false |
1650 | 884 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
885 |
(ThumbWheelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
886 |
name: 'LightWheel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
887 |
layout: (LayoutFrame 180 0 51 0 297 0 71 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
888 |
model: lightAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
889 |
orientation: horizontal |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
890 |
stop: 1000 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
891 |
step: 1 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
892 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
893 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
894 |
label: 'Saturation Factor:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
895 |
name: 'SaturationLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
896 |
layout: (LayoutFrame 9 0 79 0 120 0 101 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
897 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
898 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
899 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
900 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
901 |
name: 'SaturationEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
902 |
layout: (LayoutFrame 123 0 79 0 166 0 101 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
903 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
904 |
model: saturationAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
905 |
type: numberInRange |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
906 |
minValue: 0 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
907 |
maxValue: 1000 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
908 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
909 |
acceptOnPointerLeave: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
910 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
911 |
(ThumbWheelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
912 |
name: 'SaturationWheel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
913 |
layout: (LayoutFrame 180 0 80 0 297 0 100 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
914 |
model: saturationAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
915 |
orientation: horizontal |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
916 |
stop: 1000 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
917 |
step: 1 |
1650 | 918 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
919 |
(LabelSpec |
2438 | 920 |
label: 'Color Shift' |
921 |
name: 'Label2' |
|
922 |
layout: (LayoutFrame 5 0 110 0 -15 0.5 132 0) |
|
923 |
translateLabel: true |
|
924 |
) |
|
925 |
(LabelSpec |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
926 |
name: 'HueColorLabel' |
2438 | 927 |
layout: (LayoutFrame 18 0.0 133 0 -41 0.5 217 0) |
928 |
level: -1 |
|
1975 | 929 |
backgroundChannel: hlsColor |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
930 |
translateLabel: true |
1650 | 931 |
) |
2438 | 932 |
(LabelSpec |
933 |
label: 'Preview' |
|
934 |
name: 'Label3' |
|
935 |
layout: (LayoutFrame 5 0.5 110 0 -5 1 132 0) |
|
936 |
translateLabel: true |
|
937 |
) |
|
938 |
(LabelSpec |
|
939 |
name: 'PreviewLabel' |
|
940 |
layout: (LayoutFrame 36 0.5 133 0 -23 1.0 217 0) |
|
941 |
level: -1 |
|
942 |
translateLabel: true |
|
943 |
labelChannel: previewImageHolder |
|
944 |
) |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
945 |
(HorizontalPanelViewSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
946 |
name: 'HorizontalPanel1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
947 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
948 |
horizontalLayout: fitSpace |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
949 |
verticalLayout: center |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
950 |
horizontalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
951 |
verticalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
952 |
reverseOrderIfOKAtLeft: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
953 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
954 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
955 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
956 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
957 |
label: 'Cancel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
958 |
name: 'Button1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
959 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
960 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
961 |
model: cancel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
962 |
extent: (Point 151 22) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
963 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
964 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
965 |
label: 'OK' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
966 |
name: 'Button2' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
967 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
968 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
969 |
model: accept |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
970 |
extent: (Point 152 22) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
971 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
972 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
973 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
974 |
) |
1650 | 975 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
976 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
977 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
978 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
979 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
980 |
! |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
981 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
982 |
cropDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
983 |
"This resource specification was automatically generated |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
984 |
by the UIPainter of ST/X." |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
985 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
986 |
"Do not manually edit this!! If it is corrupted, |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
987 |
the UIPainter may not be able to read the specification." |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
988 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
989 |
" |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
990 |
UIPainter new openOnClass:ImageEditor andSelector:#cropDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
991 |
ImageEditor new openInterface:#cropDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
992 |
" |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
993 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
994 |
<resource: #canvas> |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
995 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
996 |
^ |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
997 |
#(FullSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
998 |
name: cropDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
999 |
window: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1000 |
(WindowSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1001 |
label: 'Crop Border(s)' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1002 |
name: 'Crop Border(s)' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1003 |
min: (Point 10 10) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1004 |
bounds: (Rectangle 14 46 259 229) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1005 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1006 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1007 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1008 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1009 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1010 |
label: 'Left:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1011 |
name: 'GropLeftLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1012 |
layout: (LayoutFrame 14 0 21 0 90 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1013 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1014 |
adjust: right |
1650 | 1015 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1016 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1017 |
name: 'GropLeftEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1018 |
layout: (LayoutFrame 95 0 21 0 132 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1019 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1020 |
model: left |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1021 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1022 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1023 |
acceptOnPointerLeave: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1024 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1025 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1026 |
label: 'Now' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1027 |
name: 'GropLeftNowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1028 |
layout: (LayoutFrame 148 0 21 0 221 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1029 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1030 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1031 |
model: gropLeftNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1032 |
autoRepeat: true |
1650 | 1033 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1034 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1035 |
label: 'Right:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1036 |
name: 'GropRightLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1037 |
layout: (LayoutFrame 14 0 51 0 90 0 73 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1038 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1039 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1040 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1041 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1042 |
name: 'GropRightEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1043 |
layout: (LayoutFrame 95 0 51 0 132 0 73 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1044 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1045 |
model: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1046 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1047 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1048 |
acceptOnPointerLeave: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1049 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1050 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1051 |
label: 'Now' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1052 |
name: 'GropRightButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1053 |
layout: (LayoutFrame 148 0 51 0 221 0 73 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1054 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1055 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1056 |
model: gropRightNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1057 |
autoRepeat: true |
1650 | 1058 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1059 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1060 |
label: 'Top:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1061 |
name: 'GropTopLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1062 |
layout: (LayoutFrame 14 0 81 0 90 0 103 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1063 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1064 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1065 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1066 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1067 |
name: 'GropTopEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1068 |
layout: (LayoutFrame 95 0 81 0 132 0 103 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1069 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1070 |
model: top |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1071 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1072 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1073 |
acceptOnPointerLeave: false |
1650 | 1074 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1075 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1076 |
label: 'Now' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1077 |
name: 'GropTopButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1078 |
layout: (LayoutFrame 148 0 81 0 221 0 103 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1079 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1080 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1081 |
model: gropTopNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1082 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1083 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1084 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1085 |
label: 'Bottom:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1086 |
name: 'GropBottomLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1087 |
layout: (LayoutFrame 14 0 111 0 90 0 133 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1088 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1089 |
adjust: right |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1090 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1091 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1092 |
name: 'GropBottomEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1093 |
layout: (LayoutFrame 95 0 111 0 132 0 133 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1094 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1095 |
model: bottom |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1096 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1097 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1098 |
acceptOnPointerLeave: false |
1650 | 1099 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1100 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1101 |
label: 'Now' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1102 |
name: 'GropBottomButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1103 |
layout: (LayoutFrame 148 0 111 0 221 0 133 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1104 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1105 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1106 |
model: gropBottomNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1107 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1108 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1109 |
(HorizontalPanelViewSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1110 |
name: 'HorizontalPanel1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1111 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1112 |
horizontalLayout: fitSpace |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1113 |
verticalLayout: center |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1114 |
horizontalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1115 |
verticalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1116 |
reverseOrderIfOKAtLeft: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1117 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1118 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1119 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1120 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1121 |
label: 'Cancel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1122 |
name: 'Button1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1123 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1124 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1125 |
model: cancel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1126 |
extent: (Point 77 22) |
1650 | 1127 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1128 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1129 |
label: 'Apply' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1130 |
name: 'Button3' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1131 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1132 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1133 |
model: applyAction |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1134 |
extent: (Point 78 22) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1135 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1136 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1137 |
label: 'OK' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1138 |
name: 'Button2' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1139 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1140 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1141 |
model: accept |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1142 |
extent: (Point 78 22) |
1650 | 1143 |
) |
1144 |
) |
|
1145 |
||
1146 |
) |
|
1147 |
) |
|
1148 |
) |
|
1149 |
||
1150 |
) |
|
1151 |
) |
|
1152 |
! |
|
1153 |
||
767 | 1154 |
dialogSpecForNewImage |
737 | 1155 |
"This resource specification was automatically generated |
1156 |
by the UIPainter of ST/X." |
|
519 | 1157 |
|
737 | 1158 |
"Do not manually edit this!! If it is corrupted, |
1159 |
the UIPainter may not be able to read the specification." |
|
519 | 1160 |
|
1161 |
" |
|
767 | 1162 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
1163 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 1164 |
" |
1165 |
||
1166 |
<resource: #canvas> |
|
1167 |
||
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1168 |
^ |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1169 |
#(FullSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1170 |
name: dialogSpecForNewImage |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1171 |
window: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1172 |
(WindowSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1173 |
label: 'New Image' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1174 |
name: 'New Image' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1175 |
min: (Point 10 10) |
1806 | 1176 |
bounds: (Rectangle 0 0 301 119) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1177 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1178 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1179 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1180 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1181 |
(ViewSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1182 |
name: 'View' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1183 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1184 |
level: 1 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1185 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1186 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1187 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1188 |
(FramedBoxSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1189 |
label: 'Size' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1190 |
name: 'framedBox1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1191 |
layout: (LayoutFrame 1 0.0 7 0.0 0 0.4 76 0) |
1806 | 1192 |
style: (FontDescription helvetica medium roman 12) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1193 |
labelPosition: topLeft |
1806 | 1194 |
translateLabel: true |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1195 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1196 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1197 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1198 |
(ComboBoxSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1199 |
name: 'defaultSizesComboBox' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1200 |
layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1201 |
model: selectionOfSize |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1202 |
type: string |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1203 |
acceptOnPointerLeave: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1204 |
comboList: listOfDefaultSizes |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1205 |
isFilenameBox: false |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1206 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1207 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1208 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1209 |
) |
1490 | 1210 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1211 |
(FramedBoxSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1212 |
label: 'Color Map' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1213 |
name: 'framedBox2' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1214 |
layout: (LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0) |
1806 | 1215 |
style: (FontDescription helvetica medium roman 12) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1216 |
labelPosition: topLeft |
1806 | 1217 |
translateLabel: true |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1218 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1219 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1220 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1221 |
(ComboListSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1222 |
name: 'colorMapComboBox' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1223 |
layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1224 |
model: selectionOfColorMap |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1225 |
comboList: listOfColorMaps |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1226 |
useIndex: false |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1227 |
hidePullDownMenuButton: false |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1228 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1229 |
) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1230 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1231 |
) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1232 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1233 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1234 |
|
986 | 1235 |
) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1236 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1237 |
(UISubSpecification |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1238 |
name: 'windowSpecForCommitWithoutChannels' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1239 |
layout: (LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1240 |
minorKey: windowSpecForCommitWithoutChannels |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1241 |
) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1242 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1243 |
|
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1244 |
) |
986 | 1245 |
) |
1246 |
! |
|
1247 |
||
1557 | 1248 |
shiftDialogSpec |
1249 |
"This resource specification was automatically generated |
|
1250 |
by the UIPainter of ST/X." |
|
1251 |
||
1252 |
"Do not manually edit this!! If it is corrupted, |
|
1253 |
the UIPainter may not be able to read the specification." |
|
1254 |
||
1255 |
" |
|
1256 |
UIPainter new openOnClass:ImageEditor andSelector:#shiftDialogSpec |
|
1257 |
ImageEditor new openInterface:#shiftDialogSpec |
|
1258 |
" |
|
1259 |
||
1260 |
<resource: #canvas> |
|
1261 |
||
1262 |
^ |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1263 |
#(FullSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1264 |
name: shiftDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1265 |
window: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1266 |
(WindowSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1267 |
label: 'Shift' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1268 |
name: 'Shift' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1269 |
min: (Point 10 10) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1270 |
bounds: (Rectangle 14 46 259 229) |
1557 | 1271 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1272 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1273 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1274 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1275 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1276 |
label: 'Amount:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1277 |
name: 'AmountLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1278 |
layout: (LayoutFrame 14 0 21 0 90 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1279 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1280 |
adjust: right |
1557 | 1281 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1282 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1283 |
name: 'AmountEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1284 |
layout: (LayoutFrame 95 0 21 0 139 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1285 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1286 |
model: shiftAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1287 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1288 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1289 |
acceptOnPointerLeave: false |
1557 | 1290 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1291 |
(HorizontalPanelViewSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1292 |
name: 'HorizontalPanel1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1293 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1294 |
horizontalLayout: fitSpace |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1295 |
verticalLayout: center |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1296 |
horizontalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1297 |
verticalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1298 |
reverseOrderIfOKAtLeft: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1299 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1300 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1301 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1302 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1303 |
label: 'Cancel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1304 |
name: 'Button1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1305 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1306 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1307 |
model: cancel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1308 |
extent: (Point 118 22) |
1557 | 1309 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1310 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1311 |
label: 'OK' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1312 |
name: 'Button2' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1313 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1314 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1315 |
model: accept |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1316 |
extent: (Point 118 22) |
1557 | 1317 |
) |
1318 |
) |
|
1319 |
||
1320 |
) |
|
1321 |
) |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1322 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1323 |
name: 'upArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1324 |
layout: (LayoutFrame 105 0 63 0 127 0 85 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1325 |
model: shiftUpNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1326 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1327 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1328 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1329 |
direction: up |
1557 | 1330 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1331 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1332 |
name: 'leftArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1333 |
layout: (LayoutFrame 84 0 86 0 106 0 108 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1334 |
model: shiftLeftNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1335 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1336 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1337 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1338 |
direction: left |
1557 | 1339 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1340 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1341 |
name: 'rightArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1342 |
layout: (LayoutFrame 126 0 86 0 148 0 108 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1343 |
model: shiftRightNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1344 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1345 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1346 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1347 |
direction: right |
1557 | 1348 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1349 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1350 |
name: 'downArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1351 |
layout: (LayoutFrame 105 0 107 0 127 0 129 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1352 |
model: shiftDownNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1353 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1354 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1355 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1356 |
direction: down |
1557 | 1357 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1358 |
(CheckBoxSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1359 |
label: 'Wrap' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1360 |
name: 'CheckBox1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1361 |
layout: (LayoutFrame 153 0 22 0 289 0 44 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1362 |
model: wrap |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1363 |
translateLabel: true |
1713 | 1364 |
) |
1557 | 1365 |
) |
1366 |
||
1367 |
) |
|
1368 |
) |
|
1369 |
! |
|
1370 |
||
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1371 |
uncropDialogSpec |
1480 | 1372 |
"This resource specification was automatically generated |
1373 |
by the UIPainter of ST/X." |
|
1796 | 1374 |
|
1480 | 1375 |
"Do not manually edit this!! If it is corrupted, |
1376 |
the UIPainter may not be able to read the specification." |
|
1796 | 1377 |
|
1480 | 1378 |
" |
1796 | 1379 |
UIPainter new openOnClass:ImageEditor andSelector:#uncropDialogSpec |
1380 |
ImageEditor new openInterface:#uncropDialogSpec |
|
1480 | 1381 |
" |
1796 | 1382 |
|
1383 |
<resource: #canvas> |
|
1384 |
||
1385 |
^ |
|
1386 |
#(FullSpec |
|
1387 |
name: uncropDialogSpec |
|
1388 |
window: |
|
1389 |
(WindowSpec |
|
1390 |
label: 'Add Border(s)' |
|
1391 |
name: 'Add Border(s)' |
|
1392 |
min: (Point 10 10) |
|
1393 |
max: (Point 800 478) |
|
1394 |
bounds: (Rectangle 0 0 261 228) |
|
1395 |
) |
|
1396 |
component: |
|
1397 |
(SpecCollection |
|
1398 |
collection: ( |
|
1399 |
(LabelSpec |
|
1400 |
label: 'Left:' |
|
1401 |
name: 'Label1' |
|
1402 |
layout: (LayoutFrame 14 0 21 0 90 0 43 0) |
|
1403 |
translateLabel: true |
|
1404 |
adjust: right |
|
1405 |
) |
|
1406 |
(InputFieldSpec |
|
1407 |
name: 'EntryField1' |
|
1408 |
layout: (LayoutFrame 95 0 21 0 132 0 43 0) |
|
1409 |
model: left |
|
1410 |
type: number |
|
1411 |
acceptOnPointerLeave: false |
|
1412 |
) |
|
1413 |
(LabelSpec |
|
1414 |
label: 'Right:' |
|
1415 |
name: 'Label2' |
|
1416 |
layout: (LayoutFrame 14 0 51 0 90 0 73 0) |
|
1417 |
translateLabel: true |
|
1418 |
adjust: right |
|
1419 |
) |
|
1420 |
(InputFieldSpec |
|
1421 |
name: 'EntryField2' |
|
1422 |
layout: (LayoutFrame 95 0 51 0 132 0 73 0) |
|
1423 |
model: right |
|
1424 |
type: number |
|
1425 |
acceptOnPointerLeave: false |
|
1426 |
) |
|
1427 |
(LabelSpec |
|
1428 |
label: 'Top:' |
|
1429 |
name: 'Label3' |
|
1430 |
layout: (LayoutFrame 14 0 81 0 90 0 103 0) |
|
1431 |
translateLabel: true |
|
1432 |
adjust: right |
|
1433 |
) |
|
1434 |
(InputFieldSpec |
|
1435 |
name: 'EntryField3' |
|
1436 |
layout: (LayoutFrame 95 0 81 0 132 0 103 0) |
|
1437 |
model: top |
|
1438 |
type: number |
|
1439 |
acceptOnPointerLeave: false |
|
1440 |
) |
|
1441 |
(LabelSpec |
|
1442 |
label: 'Bottom:' |
|
1443 |
name: 'Label4' |
|
1444 |
layout: (LayoutFrame 14 0 111 0 90 0 133 0) |
|
1445 |
translateLabel: true |
|
1446 |
adjust: right |
|
1447 |
) |
|
1448 |
(InputFieldSpec |
|
1449 |
name: 'EntryField4' |
|
1450 |
layout: (LayoutFrame 95 0 111 0 132 0 133 0) |
|
1451 |
model: bottom |
|
1452 |
type: number |
|
1453 |
acceptOnPointerLeave: false |
|
1454 |
) |
|
1455 |
(HorizontalPanelViewSpec |
|
1456 |
name: 'HorizontalPanel1' |
|
1457 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
1458 |
horizontalLayout: fitSpace |
|
1459 |
verticalLayout: center |
|
1460 |
horizontalSpace: 3 |
|
1461 |
verticalSpace: 3 |
|
1462 |
reverseOrderIfOKAtLeft: true |
|
1463 |
component: |
|
1464 |
(SpecCollection |
|
1465 |
collection: ( |
|
1466 |
(ActionButtonSpec |
|
1467 |
label: 'Cancel' |
|
1468 |
name: 'Button1' |
|
1469 |
translateLabel: true |
|
1470 |
model: cancel |
|
1471 |
extent: (Point 118 22) |
|
1472 |
) |
|
1473 |
(ActionButtonSpec |
|
1474 |
label: 'OK' |
|
1475 |
name: 'Button2' |
|
1476 |
translateLabel: true |
|
1477 |
model: accept |
|
1478 |
extent: (Point 118 22) |
|
1479 |
) |
|
1480 |
) |
|
1481 |
||
1482 |
) |
|
1483 |
) |
|
1484 |
) |
|
1485 |
||
1486 |
) |
|
1487 |
) |
|
1480 | 1488 |
! |
1489 |
||
767 | 1490 |
windowSpec |
1491 |
"This resource specification was automatically generated |
|
1492 |
by the UIPainter of ST/X." |
|
1493 |
||
1494 |
"Do not manually edit this!! If it is corrupted, |
|
1495 |
the UIPainter may not be able to read the specification." |
|
1496 |
||
1497 |
" |
|
1498 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
1499 |
ImageEditor new openInterface:#windowSpec |
|
1500 |
ImageEditor open |
|
1501 |
" |
|
1502 |
||
1503 |
<resource: #canvas> |
|
1504 |
||
1558 | 1505 |
^ |
1820 | 1506 |
#(FullSpec |
1507 |
name: windowSpec |
|
1508 |
window: |
|
1509 |
(WindowSpec |
|
1510 |
label: 'Image Editor' |
|
1511 |
name: 'Image Editor' |
|
1512 |
min: (Point 400 320) |
|
1513 |
bounds: (Rectangle 0 0 450 350) |
|
1514 |
menu: menu |
|
2155 | 1515 |
icon: defaultIcon |
1558 | 1516 |
) |
1820 | 1517 |
component: |
1518 |
(SpecCollection |
|
1519 |
collection: ( |
|
1520 |
(MenuPanelSpec |
|
1521 |
name: 'menuToolbarView' |
|
1522 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1523 |
style: (FontDescription helvetica medium roman 10) |
|
1524 |
menu: menuToolbar |
|
1525 |
showSeparatingLines: true |
|
1558 | 1526 |
) |
1820 | 1527 |
(VariableHorizontalPanelSpec |
1998 | 1528 |
name: 'mainPanel' |
1820 | 1529 |
layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
1530 |
snapMode: both |
|
1843 | 1531 |
barLevel: 0 |
1820 | 1532 |
component: |
1533 |
(SpecCollection |
|
1534 |
collection: ( |
|
1535 |
(ViewSpec |
|
1536 |
name: 'leftView' |
|
1537 |
level: 1 |
|
1538 |
component: |
|
1539 |
(SpecCollection |
|
1540 |
collection: ( |
|
1541 |
(VariableVerticalPanelSpec |
|
1542 |
name: 'verticalPanel' |
|
1543 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
1544 |
level: 0 |
|
1545 |
snapMode: both |
|
1546 |
component: |
|
1547 |
(SpecCollection |
|
1548 |
collection: ( |
|
1549 |
(ViewSpec |
|
1550 |
name: 'View1' |
|
1551 |
component: |
|
1552 |
(SpecCollection |
|
1553 |
collection: ( |
|
1554 |
(MenuPanelSpec |
|
1555 |
name: 'MouseButtonColorToolBar' |
|
1556 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
1557 |
level: 0 |
|
1558 |
menu: menuMouseButtonColors |
|
1558 | 1559 |
) |
1820 | 1560 |
(DataSetSpec |
1561 |
name: 'colorDataSetView' |
|
1562 |
layout: (LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
1563 |
activeHelpKey: colorMapTable |
|
1564 |
style: (FontDescription helvetica medium roman 10) |
|
1565 |
model: selectionOfColor |
|
1566 |
menu: colorMapMenu |
|
1567 |
hasHorizontalScrollBar: true |
|
1568 |
hasVerticalScrollBar: true |
|
1569 |
miniScrollerHorizontal: true |
|
1570 |
miniScrollerVertical: true |
|
1571 |
dataList: listOfColors |
|
1572 |
has3Dseparators: true |
|
2174 | 1573 |
doubleClickSelector: doubleClickOnColor: |
1900 | 1574 |
columnHolder: colorTableColumns |
1820 | 1575 |
verticalSpacing: 1 |
1576 |
columnAdaptor: colorColumnAdaptor |
|
767 | 1577 |
) |
1558 | 1578 |
) |
1579 |
||
1580 |
) |
|
1581 |
) |
|
1820 | 1582 |
(ArbitraryComponentSpec |
1583 |
name: 'imagePreView' |
|
1584 |
activeHelpKey: previewView |
|
1585 |
menu: previewMenu |
|
1586 |
hasHorizontalScrollBar: true |
|
1587 |
hasVerticalScrollBar: true |
|
2728 | 1588 |
miniScrollerHorizontal: false |
1589 |
miniScrollerVertical: false |
|
1820 | 1590 |
hasBorder: false |
1591 |
component: ImageView |
|
767 | 1592 |
) |
1558 | 1593 |
) |
1594 |
||
767 | 1595 |
) |
1820 | 1596 |
handles: (Any 0.5 1.0) |
767 | 1597 |
) |
1558 | 1598 |
) |
1599 |
||
767 | 1600 |
) |
1558 | 1601 |
) |
1820 | 1602 |
(ViewSpec |
1603 |
name: 'rightView' |
|
1604 |
component: |
|
1605 |
(SpecCollection |
|
1606 |
collection: ( |
|
1607 |
(MenuPanelSpec |
|
1608 |
name: 'ToolBar1' |
|
1609 |
layout: (LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
|
1610 |
level: 1 |
|
1611 |
menu: toolsMenuToolbar |
|
1612 |
verticalLayout: true |
|
1613 |
centerItems: true |
|
1614 |
textDefault: true |
|
1558 | 1615 |
) |
1820 | 1616 |
(ViewSpec |
1617 |
name: 'editingView' |
|
1618 |
layout: (LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
|
1619 |
level: 1 |
|
1620 |
component: |
|
1621 |
(SpecCollection |
|
1622 |
collection: ( |
|
1623 |
(ArbitraryComponentSpec |
|
1624 |
name: 'imageEditView' |
|
1625 |
layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
1626 |
hasHorizontalScrollBar: true |
|
1627 |
hasVerticalScrollBar: true |
|
1628 |
hasBorder: false |
|
1629 |
component: ImageEditView |
|
1637 | 1630 |
) |
1820 | 1631 |
(LabelSpec |
1632 |
name: 'coordLabel' |
|
1633 |
layout: (LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
1634 |
level: -1 |
|
1635 |
labelChannel: imageInfoHolder |
|
1636 |
resizeForLabel: false |
|
1637 |
adjust: left |
|
1637 | 1638 |
) |
1820 | 1639 |
(ArrowButtonSpec |
1640 |
name: 'magnifyDownButton' |
|
1641 |
layout: (LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
1642 |
activeHelpKey: magnifyImageDown |
|
1643 |
model: doMagnifyDown |
|
2792 | 1644 |
enableChannel: imageIsLoadedHolder |
1820 | 1645 |
isTriggerOnDown: true |
1646 |
direction: left |
|
1637 | 1647 |
) |
1820 | 1648 |
(ArrowButtonSpec |
1649 |
name: 'magnifyUpButton' |
|
1650 |
layout: (LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
1651 |
activeHelpKey: magnifyImageUp |
|
1652 |
model: doMagnifyUp |
|
2792 | 1653 |
enableChannel: imageIsLoadedHolder |
1820 | 1654 |
isTriggerOnDown: true |
1655 |
direction: right |
|
1637 | 1656 |
) |
1820 | 1657 |
(InputFieldSpec |
1658 |
name: 'magnificationInputField' |
|
1659 |
layout: (LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
1660 |
activeHelpKey: magnificationNumber |
|
2792 | 1661 |
enableChannel: imageIsLoadedHolder |
1987 | 1662 |
model: magnificationHolder |
1820 | 1663 |
type: numberInRange |
1975 | 1664 |
acceptOnReturn: true |
1665 |
acceptOnTab: true |
|
1820 | 1666 |
numChars: 2 |
1667 |
minValue: 1 |
|
1668 |
maxValue: 99 |
|
1975 | 1669 |
acceptOnPointerLeave: true |
1637 | 1670 |
) |
1671 |
) |
|
1672 |
||
1673 |
) |
|
1558 | 1674 |
) |
1675 |
) |
|
1676 |
||
1677 |
) |
|
1678 |
) |
|
1679 |
) |
|
1680 |
||
767 | 1681 |
) |
1843 | 1682 |
handles: (Any 0.288889 1.0) |
1558 | 1683 |
) |
1820 | 1684 |
(UISubSpecification |
1685 |
name: 'infoBarSubSpec' |
|
1686 |
layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
1687 |
majorKey: ToolApplicationModel |
|
1688 |
minorKey: windowSpecForInfoBar |
|
1558 | 1689 |
) |
1690 |
) |
|
1691 |
||
1692 |
) |
|
767 | 1693 |
) |
2792 | 1694 |
|
1695 |
"Modified: / 04-07-2010 / 10:18:33 / cg" |
|
519 | 1696 |
! ! |
1697 |
||
1698 |
!ImageEditor class methodsFor:'menu specs'! |
|
1699 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1700 |
colorMapMenu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1701 |
"This resource specification was automatically generated |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1702 |
by the MenuEditor of ST/X." |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1703 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1704 |
"Do not manually edit this!! If it is corrupted, |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1705 |
the MenuEditor may not be able to read the specification." |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1706 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1707 |
" |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1708 |
MenuEditor new openOnClass:ImageEditor andSelector:#colorMapMenu |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1709 |
(Menu new fromLiteralArrayEncoding:(ImageEditor colorMapMenu)) startUp |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1710 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1711 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1712 |
<resource: #menu> |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1713 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1714 |
^ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1715 |
#(Menu |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1716 |
( |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1717 |
(MenuItem |
2792 | 1718 |
enabled: hasColormapHolder |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1719 |
label: 'Add Color' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1720 |
itemValue: addColorToColormap |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1721 |
translateLabel: true |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1722 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1723 |
(MenuItem |
2792 | 1724 |
enabled: hasColormapHolder |
2539 | 1725 |
label: 'Pick and Add Color...' |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1726 |
itemValue: pickAndAddColorToColormap |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1727 |
translateLabel: true |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1728 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1729 |
(MenuItem |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1730 |
label: '-' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1731 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1732 |
(MenuItem |
2651 | 1733 |
enabled: hasColormapAndColorSelected |
1852 | 1734 |
label: 'Cut Color' |
1735 |
itemValue: cutColorFromColormap |
|
1736 |
translateLabel: true |
|
1737 |
isVisible: false |
|
1738 |
) |
|
1739 |
(MenuItem |
|
2792 | 1740 |
enabled: hasColorSelectedHolder |
1852 | 1741 |
label: 'Copy Color' |
1742 |
itemValue: copyColorFromColormap |
|
1743 |
translateLabel: true |
|
1744 |
) |
|
1745 |
(MenuItem |
|
2651 | 1746 |
enabled: hasColormapAndColorSelected |
2539 | 1747 |
label: 'Pick and Paste Color...' |
1933 | 1748 |
itemValue: pickAndPasteColor |
1852 | 1749 |
translateLabel: true |
1750 |
) |
|
1751 |
(MenuItem |
|
1752 |
label: 'Paste Color' |
|
1753 |
itemValue: pasteColorIntoColormap |
|
1754 |
translateLabel: true |
|
1755 |
) |
|
1756 |
(MenuItem |
|
1757 |
label: '-' |
|
1758 |
) |
|
1759 |
(MenuItem |
|
2651 | 1760 |
enabled: hasColormapAndColorSelected |
2539 | 1761 |
label: 'Edit Color...' |
1931 | 1762 |
itemValue: editSelectedColor |
1763 |
translateLabel: true |
|
1764 |
) |
|
1765 |
(MenuItem |
|
2651 | 1766 |
enabled: hasColormapAndColorSelected |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1767 |
label: 'Brighter' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1768 |
itemValue: makeSelectedColorBrighter |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1769 |
translateLabel: true |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1770 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1771 |
(MenuItem |
2651 | 1772 |
enabled: hasColormapAndColorSelected |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1773 |
label: 'Darker' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1774 |
itemValue: makeSelectedColorDarker |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1775 |
translateLabel: true |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1776 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1777 |
(MenuItem |
2651 | 1778 |
enabled: hasColormapAndColorSelected |
1884 | 1779 |
label: 'Make Gray' |
1780 |
itemValue: makeSelectedColorGray |
|
1781 |
translateLabel: true |
|
1782 |
) |
|
1783 |
(MenuItem |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1784 |
label: '-' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1785 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1786 |
(MenuItem |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1787 |
label: 'Inspect Color' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1788 |
itemValue: inspectColor |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1789 |
translateLabel: true |
2792 | 1790 |
enabled: hasColorSelectedHolder |
2651 | 1791 |
) |
1792 |
(MenuItem |
|
2792 | 1793 |
enabled: hasColormapHolder |
2651 | 1794 |
label: 'Inspect Colormap' |
1795 |
itemValue: inspectColormap |
|
1796 |
translateLabel: true |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1797 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1798 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1799 |
nil |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
1800 |
nil |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1801 |
) |
2190 | 1802 |
|
2792 | 1803 |
"Modified: / 04-07-2010 / 10:13:57 / cg" |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1804 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1805 |
|
400 | 1806 |
menu |
737 | 1807 |
"This resource specification was automatically generated |
1808 |
by the MenuEditor of ST/X." |
|
400 | 1809 |
|
737 | 1810 |
"Do not manually edit this!! If it is corrupted, |
1811 |
the MenuEditor may not be able to read the specification." |
|
400 | 1812 |
|
1813 |
" |
|
1814 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
1815 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
1816 |
" |
|
1817 |
||
1818 |
<resource: #menu> |
|
1819 |
||
1124 | 1820 |
^ |
1882 | 1821 |
#(Menu |
1822 |
( |
|
1823 |
(MenuItem |
|
1824 |
label: '&File' |
|
1825 |
translateLabel: true |
|
2196 | 1826 |
submenuChannel: menuFile |
2585 | 1827 |
"/ keepLinkedMenu: true |
1124 | 1828 |
) |
1882 | 1829 |
(MenuItem |
1830 |
label: 'Edit' |
|
1831 |
translateLabel: true |
|
2196 | 1832 |
submenuChannel: menuEdit |
2585 | 1833 |
"/ keepLinkedMenu: true |
1124 | 1834 |
) |
1882 | 1835 |
(MenuItem |
1836 |
label: 'Mode' |
|
1837 |
translateLabel: true |
|
1838 |
submenuChannel: modeMenu |
|
1637 | 1839 |
) |
1882 | 1840 |
(MenuItem |
1924 | 1841 |
label: 'Colors' |
1882 | 1842 |
translateLabel: true |
2585 | 1843 |
submenuChannel: menuColors |
1124 | 1844 |
) |
1882 | 1845 |
(MenuItem |
1846 |
label: 'Settings' |
|
1847 |
translateLabel: true |
|
2585 | 1848 |
submenuChannel: menuSettings |
1124 | 1849 |
) |
1882 | 1850 |
(MenuItem |
1851 |
label: 'History' |
|
1852 |
translateLabel: true |
|
1975 | 1853 |
isVisible: isStandAlone |
1882 | 1854 |
submenuChannel: menuHistory |
1124 | 1855 |
) |
1882 | 1856 |
(MenuItem |
2136
bb10485fa455
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1857 |
label: 'MENU_Help' |
1882 | 1858 |
translateLabel: true |
2125 | 1859 |
startGroup: conditionalRight |
1882 | 1860 |
submenuChannel: menuHelp |
1124 | 1861 |
) |
1862 |
) |
|
1863 |
nil |
|
1864 |
nil |
|
400 | 1865 |
) |
1866 |
! |
|
1867 |
||
2585 | 1868 |
menuColors |
1869 |
"This resource specification was automatically generated |
|
1870 |
by the MenuEditor of ST/X." |
|
1871 |
||
1872 |
"Do not manually edit this!! If it is corrupted, |
|
1873 |
the MenuEditor may not be able to read the specification." |
|
1874 |
||
1875 |
" |
|
1876 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuColors |
|
1877 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuColors)) startUp |
|
1878 |
" |
|
1879 |
||
1880 |
<resource: #menu> |
|
1881 |
||
1882 |
^ |
|
1883 |
#(Menu |
|
1884 |
( |
|
1885 |
(MenuItem |
|
2767 | 1886 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2585 | 1887 |
label: 'Depth' |
1888 |
translateLabel: true |
|
1889 |
submenu: |
|
1890 |
(Menu |
|
1891 |
( |
|
1892 |
(MenuItem |
|
1893 |
activeHelpKey: colorMap1 |
|
1894 |
label: '1-Plane' |
|
1895 |
itemValue: colorMapMode: |
|
1896 |
translateLabel: true |
|
1897 |
argument: depth1 |
|
1898 |
choice: colorMapMode |
|
1899 |
choiceValue: depth1 |
|
1900 |
) |
|
1901 |
(MenuItem |
|
1902 |
activeHelpKey: colorMap1M |
|
1903 |
label: '1-Plane + Mask' |
|
1904 |
itemValue: colorMapMode: |
|
1905 |
translateLabel: true |
|
1906 |
argument: masked1 |
|
1907 |
choice: colorMapMode |
|
1908 |
choiceValue: masked1 |
|
1909 |
) |
|
1910 |
(MenuItem |
|
1911 |
label: '-' |
|
1912 |
) |
|
1913 |
(MenuItem |
|
1914 |
activeHelpKey: colorMap2 |
|
1915 |
label: '2-Plane' |
|
1916 |
itemValue: colorMapMode: |
|
1917 |
translateLabel: true |
|
1918 |
argument: depth2 |
|
1919 |
choice: colorMapMode |
|
1920 |
choiceValue: depth2 |
|
1921 |
) |
|
1922 |
(MenuItem |
|
1923 |
activeHelpKey: colorMap2M |
|
1924 |
label: '2-Plane + Mask' |
|
1925 |
itemValue: colorMapMode: |
|
1926 |
translateLabel: true |
|
1927 |
argument: masked2 |
|
1928 |
choice: colorMapMode |
|
1929 |
choiceValue: masked2 |
|
1930 |
) |
|
1931 |
(MenuItem |
|
1932 |
label: '-' |
|
1933 |
) |
|
1934 |
(MenuItem |
|
1935 |
activeHelpKey: colorMap4 |
|
1936 |
label: '4-Plane' |
|
1937 |
itemValue: colorMapMode: |
|
1938 |
translateLabel: true |
|
1939 |
argument: depth4 |
|
1940 |
choice: colorMapMode |
|
1941 |
choiceValue: depth4 |
|
1942 |
) |
|
1943 |
(MenuItem |
|
1944 |
activeHelpKey: colorMap4M |
|
1945 |
label: '4-Plane + Mask' |
|
1946 |
itemValue: colorMapMode: |
|
1947 |
translateLabel: true |
|
1948 |
argument: masked4 |
|
1949 |
choice: colorMapMode |
|
1950 |
choiceValue: masked4 |
|
1951 |
) |
|
1952 |
(MenuItem |
|
1953 |
label: '-' |
|
1954 |
) |
|
1955 |
(MenuItem |
|
1956 |
activeHelpKey: colorMap8 |
|
1957 |
label: '8-Plane' |
|
1958 |
itemValue: colorMapMode: |
|
1959 |
translateLabel: true |
|
1960 |
argument: depth8 |
|
1961 |
choice: colorMapMode |
|
1962 |
choiceValue: depth8 |
|
1963 |
) |
|
1964 |
(MenuItem |
|
1965 |
activeHelpKey: colorMap8M |
|
1966 |
label: '8-Plane + Mask' |
|
1967 |
itemValue: colorMapMode: |
|
1968 |
translateLabel: true |
|
1969 |
argument: masked8 |
|
1970 |
choice: colorMapMode |
|
1971 |
choiceValue: masked8 |
|
1972 |
) |
|
1973 |
(MenuItem |
|
1974 |
label: '-' |
|
1975 |
) |
|
1976 |
(MenuItem |
|
1977 |
activeHelpKey: colorMap16 |
|
1978 |
label: '16-Plane' |
|
1979 |
itemValue: colorMapMode: |
|
1980 |
translateLabel: true |
|
1981 |
argument: depth16 |
|
1982 |
choice: colorMapMode |
|
1983 |
choiceValue: depth16 |
|
1984 |
) |
|
1985 |
(MenuItem |
|
1986 |
activeHelpKey: colorMap16M |
|
1987 |
label: '16-Plane + Mask' |
|
1988 |
itemValue: colorMapMode: |
|
1989 |
translateLabel: true |
|
1990 |
argument: masked16 |
|
1991 |
choice: colorMapMode |
|
1992 |
choiceValue: masked16 |
|
1993 |
) |
|
1994 |
(MenuItem |
|
1995 |
label: '-' |
|
1996 |
) |
|
1997 |
(MenuItem |
|
1998 |
activeHelpKey: colorMap24 |
|
1999 |
label: '24-Plane' |
|
2000 |
itemValue: colorMapMode: |
|
2001 |
translateLabel: true |
|
2002 |
argument: depth24 |
|
2003 |
choice: colorMapMode |
|
2004 |
choiceValue: depth24 |
|
2005 |
) |
|
2006 |
(MenuItem |
|
2007 |
activeHelpKey: colorMap24M |
|
2008 |
label: '24-Plane + Mask' |
|
2009 |
itemValue: colorMapMode: |
|
2010 |
translateLabel: true |
|
2011 |
argument: masked24 |
|
2012 |
choice: colorMapMode |
|
2013 |
choiceValue: masked24 |
|
2014 |
) |
|
2015 |
(MenuItem |
|
2016 |
label: '-' |
|
2017 |
) |
|
2018 |
(MenuItem |
|
2019 |
activeHelpKey: colorMap32 |
|
2020 |
label: '32-Plane (rgba)' |
|
2021 |
itemValue: colorMapMode: |
|
2022 |
translateLabel: true |
|
2023 |
argument: depth32 |
|
2024 |
choice: colorMapMode |
|
2025 |
choiceValue: depth32 |
|
2026 |
) |
|
2027 |
) |
|
2028 |
nil |
|
2029 |
nil |
|
2030 |
) |
|
2031 |
) |
|
2032 |
(MenuItem |
|
2792 | 2033 |
enabled: imageIsLoadedHolder |
2585 | 2034 |
label: 'ColorMap' |
2035 |
translateLabel: true |
|
2036 |
submenu: |
|
2037 |
(Menu |
|
2038 |
( |
|
2039 |
(MenuItem |
|
2040 |
activeHelpKey: compressColormap |
|
2792 | 2041 |
enabled: hasColormapHolder |
2585 | 2042 |
label: 'Compress Colormap' |
2826 | 2043 |
itemValue: #'menu_compressColorMap' |
2585 | 2044 |
translateLabel: true |
2045 |
) |
|
2046 |
(MenuItem |
|
2792 | 2047 |
enabled: hasColormapHolder |
2585 | 2048 |
label: 'Sort Colormap' |
2826 | 2049 |
itemValue: #'menu_sortColorMap' |
2585 | 2050 |
translateLabel: true |
2051 |
) |
|
2052 |
(MenuItem |
|
2053 |
label: 'Reduce Number of Colors by Rounding...' |
|
2054 |
itemValue: reduceNumberOfColors2 |
|
2055 |
translateLabel: true |
|
2056 |
) |
|
2057 |
(MenuItem |
|
2058 |
label: 'Reduce Number of Colors by Masking Bits...' |
|
2059 |
itemValue: reduceNumberOfColors |
|
2060 |
translateLabel: true |
|
2061 |
) |
|
2062 |
(MenuItem |
|
2063 |
label: 'Dither to Depth...' |
|
2064 |
itemValue: ditherToDepth |
|
2065 |
translateLabel: true |
|
2066 |
) |
|
2067 |
(MenuItem |
|
2068 |
label: '-' |
|
2069 |
) |
|
2070 |
(MenuItem |
|
2792 | 2071 |
enabled: imageIsLoadedHolder |
2585 | 2072 |
label: 'Brighten' |
2073 |
itemValue: doBrightenImage |
|
2074 |
translateLabel: true |
|
2075 |
) |
|
2076 |
(MenuItem |
|
2792 | 2077 |
enabled: imageIsLoadedHolder |
2585 | 2078 |
label: 'Darken' |
2079 |
itemValue: doDarkenImage |
|
2080 |
translateLabel: true |
|
2081 |
) |
|
2652 | 2082 |
(MenuItem |
2792 | 2083 |
enabled: imageIsLoadedHolder |
2652 | 2084 |
label: 'Invert' |
2085 |
itemValue: doNegativeImage |
|
2086 |
translateLabel: true |
|
2087 |
) |
|
2585 | 2088 |
) |
2089 |
nil |
|
2090 |
nil |
|
2091 |
) |
|
2092 |
) |
|
2093 |
(MenuItem |
|
2792 | 2094 |
enabled: imageIsLoadedHolder |
2585 | 2095 |
label: 'Process' |
2096 |
translateLabel: true |
|
2097 |
submenu: |
|
2098 |
(Menu |
|
2099 |
( |
|
2100 |
(MenuItem |
|
2101 |
label: 'Make GrayScale' |
|
2102 |
itemValue: makeGrayScaleImage |
|
2103 |
translateLabel: true |
|
2104 |
) |
|
2105 |
(MenuItem |
|
2826 | 2106 |
enabled: allowedToChangeImageDimensionAndDepth |
2585 | 2107 |
label: 'Make dithered 8Bit Palette' |
2108 |
itemValue: makeDitheredPaletteImage |
|
2109 |
translateLabel: true |
|
2110 |
isVisible: false |
|
2111 |
) |
|
2112 |
(MenuItem |
|
2826 | 2113 |
label: 'Make Inverse' |
2114 |
itemValue: makeInverse |
|
2115 |
translateLabel: true |
|
2116 |
) |
|
2117 |
(MenuItem |
|
2118 |
label: '-' |
|
2119 |
) |
|
2120 |
(MenuItem |
|
2121 |
label: 'Make Slightly Brighter' |
|
2122 |
itemValue: makeSlightlyBrighter |
|
2123 |
translateLabel: true |
|
2124 |
) |
|
2125 |
(MenuItem |
|
2126 |
label: 'Make Slightly Darker' |
|
2127 |
itemValue: makeSlightlyDarker |
|
2128 |
translateLabel: true |
|
2129 |
) |
|
2130 |
(MenuItem |
|
2131 |
label: '-' |
|
2132 |
) |
|
2133 |
(MenuItem |
|
2585 | 2134 |
label: 'Make Brighter' |
2135 |
itemValue: makeBrighter |
|
2136 |
translateLabel: true |
|
2137 |
) |
|
2138 |
(MenuItem |
|
2139 |
label: 'Make Darker' |
|
2140 |
itemValue: makeDarker |
|
2141 |
translateLabel: true |
|
2142 |
) |
|
2143 |
(MenuItem |
|
2144 |
label: '-' |
|
2145 |
) |
|
2146 |
(MenuItem |
|
2147 |
label: 'Change HLS...' |
|
2148 |
itemValue: changeHLS |
|
2149 |
translateLabel: true |
|
2150 |
) |
|
2151 |
(MenuItem |
|
2152 |
label: 'Colorize...' |
|
2153 |
itemValue: colorize |
|
2154 |
translateLabel: true |
|
2155 |
) |
|
2156 |
) |
|
2157 |
nil |
|
2158 |
nil |
|
2159 |
) |
|
2160 |
) |
|
2161 |
(MenuItem |
|
2792 | 2162 |
enabled: imageIsLoadedHolder |
2585 | 2163 |
label: 'Mask' |
2164 |
translateLabel: true |
|
2165 |
submenu: |
|
2166 |
(Menu |
|
2167 |
( |
|
2168 |
(MenuItem |
|
2169 |
activeHelpKey: copyMask |
|
2170 |
enabled: hasMask |
|
2171 |
label: 'Copy Mask' |
|
2826 | 2172 |
itemValue: #'menu_copyMask' |
2585 | 2173 |
translateLabel: true |
2174 |
) |
|
2175 |
(MenuItem |
|
2176 |
activeHelpKey: pasteMask |
|
2177 |
enabled: hasMask |
|
2178 |
label: 'Paste Mask' |
|
2826 | 2179 |
itemValue: #'menu_pasteMask' |
2585 | 2180 |
translateLabel: true |
2181 |
) |
|
2182 |
(MenuItem |
|
2183 |
enabled: hasMask |
|
2184 |
label: 'Clear Masked Pixels' |
|
2826 | 2185 |
itemValue: #'menu_clearMaskedPixels' |
2652 | 2186 |
translateLabel: true |
2187 |
) |
|
2188 |
(MenuItem |
|
2189 |
enabled: hasMask |
|
2653 | 2190 |
label: 'Clear Colormap Entry for Masked Pixels' |
2826 | 2191 |
itemValue: #'menu_clearColormapEntry0AndMaskedPixels' |
2585 | 2192 |
translateLabel: true |
2193 |
) |
|
2194 |
) |
|
2195 |
nil |
|
2196 |
nil |
|
2197 |
) |
|
2198 |
) |
|
2199 |
) |
|
2200 |
nil |
|
2201 |
nil |
|
2202 |
) |
|
2203 |
! |
|
2204 |
||
2196 | 2205 |
menuEdit |
2206 |
"This resource specification was automatically generated |
|
2207 |
by the MenuEditor of ST/X." |
|
2208 |
||
2209 |
"Do not manually edit this!! If it is corrupted, |
|
2210 |
the MenuEditor may not be able to read the specification." |
|
2211 |
||
2212 |
" |
|
2213 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuEdit |
|
2214 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuEdit)) startUp |
|
2215 |
" |
|
2216 |
||
2217 |
<resource: #menu> |
|
2218 |
||
2219 |
^ |
|
2220 |
#(Menu |
|
2221 |
( |
|
2222 |
(MenuItem |
|
2223 |
activeHelpKey: editUndo |
|
2224 |
enabled: canUndoHolder |
|
2225 |
label: 'Undo' |
|
2226 |
itemValue: doUndo |
|
2227 |
translateLabel: true |
|
2228 |
) |
|
2229 |
(MenuItem |
|
2230 |
label: '-' |
|
2231 |
) |
|
2232 |
(MenuItem |
|
2812 | 2233 |
enabled: imageIsLoadedHolder |
2234 |
label: 'Copy to Clipboard' |
|
2235 |
itemValue: doCopyImageToClipboard |
|
2236 |
translateLabel: true |
|
2237 |
) |
|
2238 |
(MenuItem |
|
2239 |
label: '-' |
|
2240 |
) |
|
2241 |
(MenuItem |
|
2242 |
activeHelpKey: editResize |
|
2767 | 2243 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2244 |
label: 'Resize...' |
2245 |
itemValue: doResizeImage |
|
2246 |
translateLabel: true |
|
2247 |
) |
|
2248 |
(MenuItem |
|
2812 | 2249 |
activeHelpKey: editMagnifyImage |
2767 | 2250 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2251 |
label: 'Magnify...' |
2252 |
itemValue: doMagnifyImage |
|
2253 |
translateLabel: true |
|
2254 |
) |
|
2255 |
(MenuItem |
|
2812 | 2256 |
activeHelpKey: editMagnifyImage |
2767 | 2257 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2258 |
label: 'Magnify By...' |
2259 |
itemValue: doMagnifyImageBy |
|
2260 |
translateLabel: true |
|
2261 |
) |
|
2262 |
(MenuItem |
|
2812 | 2263 |
activeHelpKey: editRotate |
2767 | 2264 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2265 |
label: 'Rotate...' |
2266 |
itemValue: doRotateImage |
|
2267 |
translateLabel: true |
|
2268 |
) |
|
2269 |
(MenuItem |
|
2812 | 2270 |
activeHelpKey: edit3DProjection |
2767 | 2271 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2354
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
2272 |
label: '3D Projection...' |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
2273 |
itemValue: do3DProjection |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
2274 |
translateLabel: true |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
2275 |
) |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
2276 |
(MenuItem |
2792 | 2277 |
enabled: imageIsLoadedHolder |
2196 | 2278 |
label: 'Flip' |
2279 |
translateLabel: true |
|
2280 |
submenu: |
|
2281 |
(Menu |
|
2282 |
( |
|
2283 |
(MenuItem |
|
2284 |
activeHelpKey: editFlipVertical |
|
2812 | 2285 |
enabled: imageIsLoadedHolder |
2196 | 2286 |
label: 'Flip - Vertical' |
2287 |
itemValue: doFlipVertical |
|
2288 |
translateLabel: true |
|
2837 | 2289 |
labelImage: (ResourceRetriever ImageEditor flipVerticalIcon 'Flip - Vertical') |
2196 | 2290 |
) |
2291 |
(MenuItem |
|
2292 |
activeHelpKey: editFlipHorizontal |
|
2812 | 2293 |
enabled: imageIsLoadedHolder |
2196 | 2294 |
label: 'Flip - Horizontal' |
2295 |
itemValue: doFlipHorizontal |
|
2296 |
translateLabel: true |
|
2837 | 2297 |
labelImage: (ResourceRetriever ImageEditor flipHorizontalIcon 'Flip - Horizontal') |
2196 | 2298 |
) |
2299 |
) |
|
2300 |
nil |
|
2301 |
nil |
|
2302 |
) |
|
2303 |
) |
|
2304 |
(MenuItem |
|
2305 |
label: '-' |
|
2306 |
) |
|
2307 |
(MenuItem |
|
2767 | 2308 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2309 |
label: 'Crop' |
2310 |
translateLabel: true |
|
2311 |
submenu: |
|
2312 |
(Menu |
|
2313 |
( |
|
2314 |
(MenuItem |
|
2315 |
activeHelpKey: cropManual |
|
2316 |
label: 'Manual...' |
|
2317 |
itemValue: doCropManual |
|
2318 |
translateLabel: true |
|
2319 |
) |
|
2320 |
(MenuItem |
|
2321 |
label: '-' |
|
2322 |
) |
|
2323 |
(MenuItem |
|
2324 |
activeHelpKey: cropAll |
|
2325 |
label: 'All' |
|
2326 |
itemValue: doCropAll |
|
2327 |
translateLabel: true |
|
2328 |
) |
|
2329 |
(MenuItem |
|
2330 |
label: '-' |
|
2331 |
) |
|
2332 |
(MenuItem |
|
2333 |
activeHelpKey: cropLeft |
|
2334 |
label: 'Left' |
|
2335 |
itemValue: doCropLeft |
|
2336 |
translateLabel: true |
|
2337 |
) |
|
2338 |
(MenuItem |
|
2339 |
activeHelpKey: cropRight |
|
2340 |
label: 'Right' |
|
2341 |
itemValue: doCropRight |
|
2342 |
translateLabel: true |
|
2343 |
) |
|
2344 |
(MenuItem |
|
2345 |
activeHelpKey: cropTop |
|
2346 |
label: 'Top' |
|
2347 |
itemValue: doCropTop |
|
2348 |
translateLabel: true |
|
2349 |
) |
|
2350 |
(MenuItem |
|
2351 |
activeHelpKey: cropBottom |
|
2352 |
label: 'Bottom' |
|
2353 |
itemValue: doCropBottom |
|
2354 |
translateLabel: true |
|
2355 |
) |
|
2356 |
) |
|
2357 |
nil |
|
2358 |
nil |
|
2359 |
) |
|
2360 |
) |
|
2361 |
(MenuItem |
|
2812 | 2362 |
activeHelpKey: uncropManual |
2767 | 2363 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
2196 | 2364 |
label: 'Uncrop (Add Border)...' |
2365 |
itemValue: doUnCropManual |
|
2366 |
translateLabel: true |
|
2367 |
) |
|
2368 |
(MenuItem |
|
2812 | 2369 |
activeHelpKey: shiftManual |
2792 | 2370 |
enabled: imageIsLoadedHolder |
2196 | 2371 |
label: 'Shift...' |
2372 |
itemValue: doShiftManual |
|
2373 |
translateLabel: true |
|
2374 |
) |
|
2375 |
(MenuItem |
|
2376 |
label: '-' |
|
2377 |
) |
|
2378 |
(MenuItem |
|
2585 | 2379 |
activeHelpKey: fileEditMask |
2792 | 2380 |
enabled: imageIsLoadedHolder |
2585 | 2381 |
label: 'Edit Mask' |
2382 |
itemValue: doEditMask |
|
2383 |
translateLabel: true |
|
2384 |
) |
|
2385 |
(MenuItem |
|
2792 | 2386 |
enabled: imageIsLoadedHolder |
2196 | 2387 |
label: 'Text...' |
2388 |
itemValue: doInsertTextFromUser |
|
2389 |
translateLabel: true |
|
2390 |
) |
|
2812 | 2391 |
(MenuItem |
2392 |
label: '-' |
|
2393 |
) |
|
2394 |
(MenuItem |
|
2814 | 2395 |
label: 'Animation Sequence' |
2812 | 2396 |
translateLabel: true |
2397 |
submenu: |
|
2398 |
(Menu |
|
2399 |
( |
|
2400 |
(MenuItem |
|
2401 |
enabled: imageHasNextImageHolder |
|
2402 |
label: 'Next in Sequence' |
|
2403 |
itemValue: nextImageInSequence |
|
2404 |
translateLabel: true |
|
2405 |
) |
|
2406 |
(MenuItem |
|
2407 |
enabled: imageHasPreviousImageHolder |
|
2813 | 2408 |
label: 'Previous in Sequence' |
2812 | 2409 |
itemValue: previousImageInSequence |
2410 |
translateLabel: true |
|
2411 |
) |
|
2412 |
(MenuItem |
|
2413 |
label: '-' |
|
2414 |
) |
|
2415 |
(MenuItem |
|
2416 |
enabled: imageHasImageSequenceHolder |
|
2417 |
label: 'Edit each from Sequence' |
|
2418 |
itemValue: editEachImageFromSequence |
|
2419 |
translateLabel: true |
|
2420 |
) |
|
2421 |
) |
|
2422 |
nil |
|
2423 |
nil |
|
2424 |
) |
|
2425 |
) |
|
2196 | 2426 |
) |
2427 |
nil |
|
2428 |
nil |
|
2429 |
) |
|
2430 |
! |
|
2431 |
||
2432 |
menuFile |
|
2433 |
"This resource specification was automatically generated |
|
2434 |
by the MenuEditor of ST/X." |
|
2435 |
||
2436 |
"Do not manually edit this!! If it is corrupted, |
|
2437 |
the MenuEditor may not be able to read the specification." |
|
2438 |
||
2439 |
" |
|
2440 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuFile |
|
2441 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuFile)) startUp |
|
2442 |
" |
|
2443 |
||
2444 |
<resource: #menu> |
|
2445 |
||
2446 |
^ |
|
2447 |
#(Menu |
|
2448 |
( |
|
2449 |
(MenuItem |
|
2450 |
activeHelpKey: fileNewImageEditor |
|
2451 |
label: 'New ImageEditor' |
|
2452 |
itemValue: doNewImageEditor |
|
2453 |
translateLabel: true |
|
2454 |
) |
|
2455 |
(MenuItem |
|
2456 |
activeHelpKey: fileNewImage |
|
2457 |
label: 'New...' |
|
2458 |
itemValue: doNewImage |
|
2459 |
translateLabel: true |
|
2460 |
) |
|
2461 |
(MenuItem |
|
2462 |
activeHelpKey: fileNewImage |
|
2463 |
label: 'New from ClipBoard' |
|
2464 |
itemValue: doNewImageFromClipboard |
|
2465 |
translateLabel: true |
|
2466 |
) |
|
2467 |
(MenuItem |
|
2468 |
label: '-' |
|
2469 |
) |
|
2470 |
(MenuItem |
|
2471 |
activeHelpKey: fileLoadFromClass |
|
2472 |
label: 'Load...' |
|
2473 |
itemValue: doLoadFromClass |
|
2474 |
translateLabel: true |
|
2475 |
) |
|
2476 |
(MenuItem |
|
2477 |
activeHelpKey: fileLoadFromFile |
|
2478 |
label: 'Load from File...' |
|
2479 |
itemValue: doLoadFromFile |
|
2480 |
translateLabel: true |
|
2481 |
) |
|
2482 |
(MenuItem |
|
2796 | 2483 |
activeHelpKey: fileLoadFromURL |
2484 |
label: 'Load from URL...' |
|
2485 |
itemValue: doLoadFromURL |
|
2486 |
translateLabel: true |
|
2487 |
) |
|
2488 |
(MenuItem |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2489 |
label: 'Grab' |
2196 | 2490 |
translateLabel: true |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2491 |
submenu: |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2492 |
(Menu |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2493 |
( |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2494 |
(MenuItem |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2495 |
activeHelpKey: fileGrabImageFromScreen |
2717 | 2496 |
label: 'Grab from Screen Area...' |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2497 |
itemValue: grabScreenImage |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2498 |
translateLabel: true |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2499 |
) |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2500 |
(MenuItem |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2501 |
activeHelpKey: fileGrabImageFromScreen |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2502 |
enabled: hasLastGrabScreenArea |
2711 | 2503 |
label: 'Grab again from same Screen Area' |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2504 |
itemValue: grabScreenImageFromLastArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2505 |
translateLabel: true |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2506 |
) |
2771 | 2507 |
(MenuItem |
2508 |
label: '-' |
|
2509 |
) |
|
2510 |
(MenuItem |
|
2511 |
activeHelpKey: fileGrabImageFromWindow |
|
2512 |
label: 'Grab from Window...' |
|
2513 |
itemValue: grabWindowImage |
|
2514 |
translateLabel: true |
|
2515 |
) |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2516 |
) |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2517 |
nil |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2518 |
nil |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
2519 |
) |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
2520 |
) |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
2521 |
(MenuItem |
2196 | 2522 |
label: '-' |
2523 |
) |
|
2524 |
(MenuItem |
|
2525 |
activeHelpKey: fileSaveMethod |
|
2526 |
enabled: imageIsLoadedAndClassDefined |
|
2527 |
label: 'Save' |
|
2528 |
itemValue: doSaveMethod |
|
2529 |
translateLabel: true |
|
2530 |
) |
|
2531 |
(MenuItem |
|
2532 |
activeHelpKey: fileSaveMethodAs |
|
2792 | 2533 |
enabled: imageIsLoadedHolder |
2196 | 2534 |
label: 'Save As...' |
2535 |
itemValue: doSaveMethodAs |
|
2536 |
translateLabel: true |
|
2537 |
) |
|
2538 |
(MenuItem |
|
2539 |
activeHelpKey: fileSaveAs |
|
2792 | 2540 |
enabled: imageIsLoadedHolder |
2196 | 2541 |
label: 'Save to File...' |
2542 |
itemValue: doSaveImageFileAs |
|
2543 |
translateLabel: true |
|
2544 |
) |
|
2545 |
(MenuItem |
|
2546 |
activeHelpKey: fileSaveMaskAs |
|
2792 | 2547 |
enabled: imageIsLoadedHolder |
2196 | 2548 |
label: 'Save Mask to File...' |
2549 |
itemValue: doSaveImageMaskFileAs |
|
2550 |
translateLabel: true |
|
2551 |
) |
|
2552 |
(MenuItem |
|
2553 |
activeHelpKey: fileSaveButtonImageAs |
|
2792 | 2554 |
enabled: imageIsLoadedHolder |
2196 | 2555 |
label: 'Save as Button to File...' |
2556 |
itemValue: doSaveButtonImageToFileAs |
|
2557 |
translateLabel: true |
|
2558 |
) |
|
2559 |
(MenuItem |
|
2560 |
label: '-' |
|
2561 |
) |
|
2562 |
(MenuItem |
|
2563 |
activeHelpKey: filePrint |
|
2792 | 2564 |
enabled: imageIsLoadedHolder |
2196 | 2565 |
label: 'Print' |
2566 |
itemValue: doPrint |
|
2567 |
translateLabel: true |
|
2568 |
) |
|
2569 |
(MenuItem |
|
2570 |
label: '-' |
|
2571 |
isVisible: isStandAlone |
|
2572 |
) |
|
2573 |
(MenuItem |
|
2574 |
activeHelpKey: fileBrowseClass |
|
2792 | 2575 |
enabled: hasClassDefinedHolder |
2196 | 2576 |
label: 'Browse Class' |
2577 |
itemValue: doBrowseClass |
|
2578 |
translateLabel: true |
|
2579 |
isVisible: isStandAlone |
|
2580 |
) |
|
2581 |
(MenuItem |
|
2792 | 2582 |
enabled: imageIsLoadedHolder |
2196 | 2583 |
label: 'Inspect Image' |
2584 |
itemValue: doInspectImage |
|
2585 |
translateLabel: true |
|
2586 |
isVisible: isStandAlone |
|
2587 |
) |
|
2588 |
(MenuItem |
|
2585 | 2589 |
activeHelpKey: fileShowStoreString |
2792 | 2590 |
enabled: imageIsLoadedHolder |
2585 | 2591 |
label: 'Show storeString' |
2592 |
itemValue: doShowStoreString |
|
2593 |
translateLabel: true |
|
2594 |
) |
|
2595 |
(MenuItem |
|
2196 | 2596 |
label: '-' |
2597 |
isVisible: isStandAlone |
|
2598 |
) |
|
2599 |
(MenuItem |
|
2600 |
activeHelpKey: fileExit |
|
2601 |
label: 'Exit' |
|
2602 |
itemValue: closeRequest |
|
2603 |
translateLabel: true |
|
2604 |
isVisible: isStandAlone |
|
2605 |
) |
|
2606 |
) |
|
2607 |
nil |
|
2608 |
nil |
|
2609 |
) |
|
2812 | 2610 |
|
2611 |
"Modified: / 21-10-2010 / 14:30:06 / cg" |
|
2196 | 2612 |
! |
2613 |
||
679 | 2614 |
menuMouseButtonColors |
737 | 2615 |
"This resource specification was automatically generated |
2616 |
by the MenuEditor of ST/X." |
|
679 | 2617 |
|
737 | 2618 |
"Do not manually edit this!! If it is corrupted, |
2619 |
the MenuEditor may not be able to read the specification." |
|
679 | 2620 |
|
2621 |
" |
|
2622 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
2623 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
2624 |
" |
|
2625 |
||
2626 |
<resource: #menu> |
|
2627 |
||
2628 |
^ |
|
2629 |
||
2630 |
#(#Menu |
|
2631 |
||
2632 |
#( |
|
2633 |
#(#MenuItem |
|
2634 |
#label: 'Left Mouse Button' |
|
2635 |
#nameKey: #leftMouseKeyButton |
|
2636 |
#activeHelpKey: #mouseKeyColorMode |
|
2792 | 2637 |
#enabled: #imageIsLoadedHolder |
679 | 2638 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
975 | 2639 |
#choice: #mouseKeyColorMode |
2640 |
#choiceValue: 1 |
|
679 | 2641 |
) |
2642 |
#(#MenuItem |
|
2643 |
#label: 'Right Mouse Button' |
|
2644 |
#nameKey: #rightMouseKeyButton |
|
2645 |
#activeHelpKey: #mouseKeyColorMode |
|
2792 | 2646 |
#enabled: #imageIsLoadedHolder |
679 | 2647 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
975 | 2648 |
#choice: #mouseKeyColorMode |
2649 |
#choiceValue: 2 |
|
679 | 2650 |
) |
2651 |
) nil |
|
2652 |
nil |
|
2653 |
) |
|
2792 | 2654 |
|
2655 |
"Modified: / 04-07-2010 / 10:17:37 / cg" |
|
679 | 2656 |
! |
2657 |
||
2585 | 2658 |
menuSettings |
2659 |
"This resource specification was automatically generated |
|
2660 |
by the MenuEditor of ST/X." |
|
2661 |
||
2662 |
"Do not manually edit this!! If it is corrupted, |
|
2663 |
the MenuEditor may not be able to read the specification." |
|
2664 |
||
2665 |
" |
|
2666 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuSettings |
|
2667 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuSettings)) startUp |
|
2668 |
" |
|
2669 |
||
2670 |
<resource: #menu> |
|
2671 |
||
2672 |
^ |
|
2673 |
#(Menu |
|
2674 |
( |
|
2675 |
(MenuItem |
|
2676 |
activeHelpKey: settingsGridMagnification |
|
2677 |
label: 'Grid Magnification Limit...' |
|
2678 |
itemValue: doChangeGridMagnification |
|
2679 |
translateLabel: true |
|
2680 |
) |
|
2681 |
(MenuItem |
|
2682 |
label: 'Pen' |
|
2683 |
translateLabel: true |
|
2684 |
submenu: |
|
2685 |
(Menu |
|
2686 |
( |
|
2687 |
(MenuItem |
|
2688 |
label: '1' |
|
2689 |
itemValue: penWidth: |
|
2690 |
translateLabel: true |
|
2691 |
argument: 1 |
|
2692 |
) |
|
2693 |
(MenuItem |
|
2694 |
label: '5' |
|
2695 |
itemValue: penWidth: |
|
2696 |
translateLabel: true |
|
2697 |
argument: 5 |
|
2698 |
) |
|
2699 |
(MenuItem |
|
2700 |
label: '10' |
|
2701 |
itemValue: penWidth: |
|
2702 |
translateLabel: true |
|
2703 |
argument: 10 |
|
2704 |
) |
|
2705 |
) |
|
2706 |
nil |
|
2707 |
nil |
|
2708 |
) |
|
2709 |
) |
|
2710 |
(MenuItem |
|
2711 |
label: 'Spray' |
|
2712 |
translateLabel: true |
|
2713 |
submenu: |
|
2714 |
(Menu |
|
2715 |
( |
|
2716 |
(MenuItem |
|
2717 |
label: '4' |
|
2718 |
itemValue: spraySpot: |
|
2719 |
translateLabel: true |
|
2720 |
argument: 4 |
|
2721 |
) |
|
2722 |
(MenuItem |
|
2723 |
label: '8' |
|
2724 |
itemValue: spraySpot: |
|
2725 |
translateLabel: true |
|
2726 |
argument: 8 |
|
2727 |
) |
|
2728 |
(MenuItem |
|
2729 |
label: '16' |
|
2730 |
itemValue: spraySpot: |
|
2731 |
translateLabel: true |
|
2732 |
argument: 16 |
|
2733 |
) |
|
2734 |
(MenuItem |
|
2735 |
label: '32' |
|
2736 |
itemValue: spraySpot: |
|
2737 |
translateLabel: true |
|
2738 |
argument: 32 |
|
2739 |
) |
|
2740 |
) |
|
2741 |
nil |
|
2742 |
nil |
|
2743 |
) |
|
2744 |
) |
|
2745 |
) |
|
2746 |
nil |
|
2747 |
nil |
|
2748 |
) |
|
2749 |
! |
|
2750 |
||
400 | 2751 |
menuToolbar |
737 | 2752 |
"This resource specification was automatically generated |
2753 |
by the MenuEditor of ST/X." |
|
400 | 2754 |
|
737 | 2755 |
"Do not manually edit this!! If it is corrupted, |
2756 |
the MenuEditor may not be able to read the specification." |
|
400 | 2757 |
|
2758 |
" |
|
2759 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
2760 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
2761 |
" |
|
2762 |
||
2763 |
<resource: #menu> |
|
2764 |
||
1196 | 2765 |
^ |
1820 | 2766 |
#(Menu |
2767 |
( |
|
2768 |
(MenuItem |
|
2769 |
activeHelpKey: fileNewImage |
|
2770 |
label: 'newImage' |
|
2771 |
itemValue: doNewImage |
|
2772 |
translateLabel: true |
|
2773 |
isButton: true |
|
1883 | 2774 |
labelImage: (ResourceRetriever ToolbarIconLibrary newImageIcon) |
1196 | 2775 |
) |
1820 | 2776 |
(MenuItem |
1949 | 2777 |
label: '-' |
2778 |
) |
|
2779 |
(MenuItem |
|
1970 | 2780 |
activeHelpKey: fileLoadFromClass |
2781 |
label: 'loadFromClass' |
|
2782 |
itemValue: doLoadFromClass |
|
2783 |
translateLabel: true |
|
2784 |
isButton: true |
|
1975 | 2785 |
isVisible: isStandAlone |
1970 | 2786 |
submenuChannel: menuHistory |
2787 |
labelImage: (ResourceRetriever XPToolbarIconLibrary loadImageFromMethodIcon) |
|
2788 |
keepLinkedMenu: true |
|
2789 |
) |
|
2790 |
(MenuItem |
|
2567 | 2791 |
activeHelpKey: fileSaveMethodAs |
2792 | 2792 |
enabled: imageIsLoadedHolder |
2567 | 2793 |
label: 'fileSaveMethodAs' |
1970 | 2794 |
itemValue: doSaveMethodAs |
2795 |
translateLabel: true |
|
2796 |
isButton: true |
|
1975 | 2797 |
isVisible: isStandAlone |
1970 | 2798 |
labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageAsMethodAsIcon) |
2799 |
) |
|
2800 |
(MenuItem |
|
2801 |
activeHelpKey: fileSaveMethod |
|
2792 | 2802 |
enabled: imageIsLoadedHolder |
1970 | 2803 |
label: 'saveAsMethod' |
2804 |
itemValue: doSaveMethod |
|
2805 |
translateLabel: true |
|
2806 |
isButton: true |
|
1975 | 2807 |
isVisible: isNotStandAlone |
2590 | 2808 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveImageAsMethodIcon) |
1970 | 2809 |
) |
2810 |
(MenuItem |
|
2811 |
label: '-' |
|
2812 |
) |
|
2813 |
(MenuItem |
|
1820 | 2814 |
activeHelpKey: fileLoadFromFile |
2815 |
label: 'loadFromFile' |
|
2816 |
itemValue: doLoadFromFile |
|
2817 |
translateLabel: true |
|
2818 |
isButton: true |
|
1884 | 2819 |
labelImage: (ResourceRetriever ToolbarIconLibrary loadImageFromFileIcon) |
1820 | 2820 |
) |
2821 |
(MenuItem |
|
2822 |
activeHelpKey: fileSaveAs |
|
2792 | 2823 |
enabled: imageIsLoadedHolder |
1820 | 2824 |
label: 'saveAsFile' |
2825 |
itemValue: doSaveImageFileAs |
|
2826 |
translateLabel: true |
|
2827 |
isButton: true |
|
1885 | 2828 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveImageToFileAsIcon) |
1820 | 2829 |
) |
2830 |
(MenuItem |
|
1949 | 2831 |
label: '-' |
1196 | 2832 |
) |
1820 | 2833 |
(MenuItem |
2834 |
activeHelpKey: editUndo |
|
1987 | 2835 |
enabled: canUndoHolder |
1820 | 2836 |
label: 'Undo' |
2837 |
itemValue: doUndo |
|
2838 |
translateLabel: true |
|
2839 |
isButton: true |
|
1883 | 2840 |
labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon) |
1196 | 2841 |
) |
2812 | 2842 |
(MenuItem |
2843 |
label: '-' |
|
2844 |
isVisible: imageHasImageSequenceHolder |
|
2845 |
) |
|
2846 |
(MenuItem |
|
2847 |
activeHelpKey: previousImageInSequence |
|
2848 |
enabled: imageHasPreviousImageHolder |
|
2849 |
label: 'Previous Image' |
|
2850 |
itemValue: previousImageInSequence |
|
2851 |
translateLabel: true |
|
2852 |
isVisible: imageHasImageSequenceHolder |
|
2853 |
labelImage: (ResourceRetriever ToolbarIconLibrary leftArrow24x24Icon) |
|
2854 |
) |
|
2855 |
(MenuItem |
|
2856 |
activeHelpKey: nextImageInSequence |
|
2857 |
enabled: imageHasNextImageHolder |
|
2858 |
label: 'Next Image' |
|
2859 |
itemValue: nextImageInSequence |
|
2860 |
translateLabel: true |
|
2861 |
isVisible: imageHasImageSequenceHolder |
|
2862 |
labelImage: (ResourceRetriever ToolbarIconLibrary rightArrow24x24Icon) |
|
2863 |
) |
|
1637 | 2864 |
) |
2865 |
nil |
|
2866 |
nil |
|
2867 |
) |
|
2792 | 2868 |
|
2812 | 2869 |
"Modified: / 21-10-2010 / 14:57:32 / cg" |
1637 | 2870 |
! |
2871 |
||
2872 |
modeMenu |
|
2873 |
"This resource specification was automatically generated |
|
2874 |
by the MenuEditor of ST/X." |
|
2875 |
||
2876 |
"Do not manually edit this!! If it is corrupted, |
|
2877 |
the MenuEditor may not be able to read the specification." |
|
2878 |
||
2879 |
" |
|
2880 |
MenuEditor new openOnClass:ImageEditor andSelector:#modeMenu |
|
2881 |
(Menu new fromLiteralArrayEncoding:(ImageEditor modeMenu)) startUp |
|
2882 |
" |
|
2883 |
||
2884 |
<resource: #menu> |
|
2885 |
||
2886 |
^ |
|
2592 | 2887 |
#(Menu |
2888 |
( |
|
2889 |
(MenuItem |
|
2890 |
activeHelpKey: drawModePoint |
|
2792 | 2891 |
enabled: imageIsLoadedHolder |
2592 | 2892 |
label: 'Point' |
2893 |
translateLabel: true |
|
2894 |
labelImage: (ResourceRetriever ImageEditor pointIcon 'Point') |
|
2895 |
choice: editMode |
|
2896 |
choiceValue: point |
|
2897 |
) |
|
2898 |
(MenuItem |
|
2899 |
activeHelpKey: drawModePoint |
|
2792 | 2900 |
enabled: imageIsLoadedHolder |
2592 | 2901 |
label: 'Spray' |
2902 |
translateLabel: true |
|
2903 |
labelImage: (ResourceRetriever ImageEditor sprayIcon 'Spray') |
|
2904 |
choice: editMode |
|
2905 |
choiceValue: spray |
|
1196 | 2906 |
) |
2592 | 2907 |
(MenuItem |
2908 |
activeHelpKey: drawModeBox |
|
2792 | 2909 |
enabled: imageIsLoadedHolder |
2592 | 2910 |
label: 'Rect' |
2911 |
translateLabel: true |
|
2912 |
labelImage: (ResourceRetriever ImageEditor rectIcon 'Rect') |
|
2913 |
choice: editMode |
|
2914 |
choiceValue: box |
|
1196 | 2915 |
) |
2592 | 2916 |
(MenuItem |
2917 |
activeHelpKey: drawModeFilledBox |
|
2792 | 2918 |
enabled: imageIsLoadedHolder |
2592 | 2919 |
label: 'Filled Rectangle' |
2920 |
translateLabel: true |
|
2921 |
labelImage: (ResourceRetriever ImageEditor fillRectIcon 'Filled Rectangle') |
|
2922 |
choice: editMode |
|
2923 |
choiceValue: filledBox |
|
1196 | 2924 |
) |
2592 | 2925 |
(MenuItem |
2926 |
activeHelpKey: drawModeBox |
|
2792 | 2927 |
enabled: imageIsLoadedHolder |
2592 | 2928 |
label: 'Circle' |
2929 |
translateLabel: true |
|
2930 |
labelImage: (ResourceRetriever ImageEditor circleIcon 'Circle') |
|
2931 |
choice: editMode |
|
2932 |
choiceValue: circle |
|
1196 | 2933 |
) |
2592 | 2934 |
(MenuItem |
2935 |
activeHelpKey: drawModeFill |
|
2792 | 2936 |
enabled: imageIsLoadedHolder |
2592 | 2937 |
label: 'Fill' |
2938 |
translateLabel: true |
|
2939 |
labelImage: (ResourceRetriever ImageEditor fillIcon 'Fill') |
|
2940 |
choice: editMode |
|
2941 |
choiceValue: fill |
|
1196 | 2942 |
) |
2592 | 2943 |
(MenuItem |
2944 |
activeHelpKey: drawModeCopy |
|
2792 | 2945 |
enabled: imageIsLoadedHolder |
2592 | 2946 |
label: 'Copy' |
2947 |
translateLabel: true |
|
2948 |
labelImage: (ResourceRetriever ImageEditor copyIcon 'Copy') |
|
2949 |
choice: editMode |
|
2950 |
choiceValue: copy |
|
2951 |
) |
|
2952 |
(MenuItem |
|
2953 |
activeHelpKey: drawModePaste |
|
2792 | 2954 |
enabled: imageIsLoadedHolder |
2592 | 2955 |
label: 'Paste' |
2956 |
translateLabel: true |
|
2957 |
labelImage: (ResourceRetriever ImageEditor pasteIcon 'Paste') |
|
2958 |
choice: editMode |
|
2959 |
choiceValue: paste |
|
1196 | 2960 |
) |
2592 | 2961 |
(MenuItem |
2962 |
activeHelpKey: drawModePasteUnder |
|
2792 | 2963 |
enabled: imageIsLoadedHolder |
2592 | 2964 |
label: 'Paste Under' |
2965 |
translateLabel: true |
|
2966 |
labelImage: (ResourceRetriever ImageEditor pasteUnderIcon 'Paste Under') |
|
2967 |
choice: editMode |
|
2968 |
choiceValue: pasteUnder |
|
1196 | 2969 |
) |
2592 | 2970 |
(MenuItem |
2971 |
activeHelpKey: drawModePasteWithMask |
|
2792 | 2972 |
enabled: imageIsLoadedHolder |
2592 | 2973 |
label: 'Paste with Mask' |
2974 |
translateLabel: true |
|
2975 |
labelImage: (ResourceRetriever ImageEditor pasteWithMaskIcon 'Paste with Mask') |
|
2976 |
choice: editMode |
|
2977 |
choiceValue: pasteWithMask |
|
1579 | 2978 |
) |
2592 | 2979 |
(MenuItem |
2980 |
activeHelpKey: drawModeSpecial |
|
2792 | 2981 |
enabled: imageIsLoadedHolder |
2592 | 2982 |
label: 'Special' |
2983 |
translateLabel: true |
|
2984 |
labelImage: (ResourceRetriever ImageEditor specialIcon 'Special') |
|
2985 |
choice: editMode |
|
2986 |
choiceValue: specialOperation |
|
1411 | 2987 |
) |
1196 | 2988 |
) |
2989 |
nil |
|
2990 |
nil |
|
400 | 2991 |
) |
2792 | 2992 |
|
2993 |
"Modified: / 04-07-2010 / 10:18:08 / cg" |
|
1558 | 2994 |
! |
2995 |
||
2996 |
previewMenu |
|
2997 |
"This resource specification was automatically generated |
|
2998 |
by the MenuEditor of ST/X." |
|
2999 |
||
3000 |
"Do not manually edit this!! If it is corrupted, |
|
3001 |
the MenuEditor may not be able to read the specification." |
|
3002 |
||
3003 |
" |
|
3004 |
MenuEditor new openOnClass:ImageEditor andSelector:#previewMenu |
|
3005 |
(Menu new fromLiteralArrayEncoding:(ImageEditor previewMenu)) startUp |
|
3006 |
" |
|
3007 |
||
3008 |
<resource: #menu> |
|
3009 |
||
3010 |
^ |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3011 |
#(Menu |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3012 |
( |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3013 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3014 |
label: 'TileMode' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3015 |
translateLabel: true |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3016 |
indication: tileModeHolder |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3017 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3018 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3019 |
label: '-' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3020 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3021 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3022 |
label: 'Background Color' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3023 |
translateLabel: true |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3024 |
submenu: |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3025 |
(Menu |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3026 |
( |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3027 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3028 |
label: 'Gray' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3029 |
translateLabel: true |
2792 | 3030 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3031 |
choiceValue: nil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3032 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3033 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3034 |
label: 'Black' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3035 |
translateLabel: true |
2792 | 3036 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3037 |
choiceValue: black |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3038 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3039 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3040 |
label: 'White' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3041 |
translateLabel: true |
2792 | 3042 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3043 |
choiceValue: white |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3044 |
) |
1774 | 3045 |
(MenuItem |
3046 |
label: '-' |
|
3047 |
) |
|
3048 |
(MenuItem |
|
3049 |
label: 'Red' |
|
3050 |
translateLabel: true |
|
2792 | 3051 |
choice: previewBackgroundColorHolder |
1774 | 3052 |
choiceValue: red |
3053 |
) |
|
3054 |
(MenuItem |
|
3055 |
label: 'Green' |
|
3056 |
translateLabel: true |
|
2792 | 3057 |
choice: previewBackgroundColorHolder |
1774 | 3058 |
choiceValue: green |
3059 |
) |
|
3060 |
(MenuItem |
|
3061 |
label: 'Blue' |
|
3062 |
translateLabel: true |
|
2792 | 3063 |
choice: previewBackgroundColorHolder |
1774 | 3064 |
choiceValue: blue |
3065 |
) |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3066 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3067 |
nil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3068 |
nil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3069 |
) |
1558 | 3070 |
) |
3071 |
) |
|
3072 |
nil |
|
3073 |
nil |
|
3074 |
) |
|
2792 | 3075 |
|
3076 |
"Modified: / 04-07-2010 / 10:20:09 / cg" |
|
1637 | 3077 |
! |
3078 |
||
3079 |
toolsMenuToolbar |
|
3080 |
"This resource specification was automatically generated |
|
3081 |
by the MenuEditor of ST/X." |
|
3082 |
||
3083 |
"Do not manually edit this!! If it is corrupted, |
|
3084 |
the MenuEditor may not be able to read the specification." |
|
3085 |
||
3086 |
" |
|
3087 |
MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar |
|
3088 |
(Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp |
|
3089 |
" |
|
3090 |
||
3091 |
<resource: #menu> |
|
3092 |
||
3093 |
^ |
|
3094 |
#(#Menu |
|
3095 |
#( |
|
3096 |
#(#MenuItem |
|
3097 |
#activeHelpKey: #drawModePoint |
|
2792 | 3098 |
#enabled: #imageIsLoadedHolder |
1637 | 3099 |
#label: 'Point' |
3100 |
#translateLabel: true |
|
3101 |
#isButton: true |
|
3102 |
#labelImage: #(#ResourceRetriever #ImageEditor #pointIcon) |
|
3103 |
#choice: #editMode |
|
3104 |
#choiceValue: #point |
|
3105 |
) |
|
3106 |
#(#MenuItem |
|
2375 | 3107 |
#activeHelpKey: #drawModeSpray |
2792 | 3108 |
#enabled: #imageIsLoadedHolder |
2375 | 3109 |
#label: 'Spray' |
3110 |
#translateLabel: true |
|
3111 |
#isButton: true |
|
3112 |
#labelImage: #(#ResourceRetriever #ImageEditor #sprayIcon) |
|
3113 |
#choice: #editMode |
|
3114 |
#choiceValue: #spray |
|
3115 |
) |
|
3116 |
#(#MenuItem |
|
1637 | 3117 |
#activeHelpKey: #drawModeBox |
2792 | 3118 |
#enabled: #imageIsLoadedHolder |
1637 | 3119 |
#label: 'Rect' |
3120 |
#translateLabel: true |
|
3121 |
#isButton: true |
|
3122 |
#labelImage: #(#ResourceRetriever #ImageEditor #rectIcon) |
|
3123 |
#choice: #editMode |
|
3124 |
#choiceValue: #box |
|
3125 |
) |
|
3126 |
#(#MenuItem |
|
3127 |
#activeHelpKey: #drawModeFilledBox |
|
2792 | 3128 |
#enabled: #imageIsLoadedHolder |
1637 | 3129 |
#label: 'FillRect' |
3130 |
#translateLabel: true |
|
3131 |
#isButton: true |
|
3132 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillRectIcon) |
|
3133 |
#choice: #editMode |
|
3134 |
#choiceValue: #filledBox |
|
3135 |
) |
|
3136 |
#(#MenuItem |
|
2375 | 3137 |
#activeHelpKey: #drawModeCircle |
2792 | 3138 |
#enabled: #imageIsLoadedHolder |
2375 | 3139 |
#label: 'Circle' |
3140 |
#translateLabel: true |
|
3141 |
#isButton: true |
|
3142 |
#labelImage: #(#ResourceRetriever #ImageEditor #circleIcon) |
|
3143 |
#choice: #editMode |
|
3144 |
#choiceValue: #circle |
|
3145 |
) |
|
3146 |
#(#MenuItem |
|
1637 | 3147 |
#activeHelpKey: #drawModeFill |
2792 | 3148 |
#enabled: #imageIsLoadedHolder |
1637 | 3149 |
#label: 'Fill' |
3150 |
#translateLabel: true |
|
3151 |
#isButton: true |
|
3152 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillIcon) |
|
3153 |
#choice: #editMode |
|
3154 |
#choiceValue: #fill |
|
3155 |
) |
|
3156 |
#(#MenuItem |
|
3157 |
#activeHelpKey: #drawModeCopy |
|
2792 | 3158 |
#enabled: #imageIsLoadedHolder |
1637 | 3159 |
#label: 'Copy' |
3160 |
#translateLabel: true |
|
3161 |
#isButton: true |
|
3162 |
#labelImage: #(#ResourceRetriever #ImageEditor #copyIcon) |
|
3163 |
#choice: #editMode |
|
3164 |
#choiceValue: #copy |
|
3165 |
) |
|
3166 |
#(#MenuItem |
|
3167 |
#activeHelpKey: #drawModePaste |
|
2792 | 3168 |
#enabled: #imageIsLoadedHolder |
1637 | 3169 |
#label: 'Paste' |
3170 |
#translateLabel: true |
|
3171 |
#isButton: true |
|
3172 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteIcon) |
|
3173 |
#choice: #editMode |
|
3174 |
#choiceValue: #paste |
|
3175 |
) |
|
3176 |
#(#MenuItem |
|
3177 |
#activeHelpKey: #drawModePasteUnder |
|
2792 | 3178 |
#enabled: #imageIsLoadedHolder |
1637 | 3179 |
#label: 'Paste Under' |
3180 |
#translateLabel: true |
|
3181 |
#isButton: true |
|
3182 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteUnderIcon) |
|
3183 |
#choice: #editMode |
|
3184 |
#choiceValue: #pasteUnder |
|
3185 |
) |
|
3186 |
#(#MenuItem |
|
3187 |
#activeHelpKey: #drawModePasteWithMask |
|
2792 | 3188 |
#enabled: #imageIsLoadedHolder |
1637 | 3189 |
#label: 'Paste With Mask' |
3190 |
#translateLabel: true |
|
3191 |
#isButton: true |
|
3192 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteWithMaskIcon) |
|
3193 |
#choice: #editMode |
|
3194 |
#choiceValue: #pasteWithMask |
|
3195 |
) |
|
3196 |
#(#MenuItem |
|
3197 |
#activeHelpKey: #drawModeSpecial |
|
2792 | 3198 |
#enabled: #imageIsLoadedHolder |
1637 | 3199 |
#label: 'Special' |
3200 |
#translateLabel: true |
|
3201 |
#isButton: true |
|
3202 |
#labelImage: #(#ResourceRetriever #ImageEditor #specialIcon) |
|
3203 |
#choice: #editMode |
|
3204 |
#choiceValue: #specialOperation |
|
3205 |
) |
|
3206 |
) |
|
3207 |
nil |
|
3208 |
nil |
|
3209 |
) |
|
2792 | 3210 |
|
3211 |
"Modified: / 04-07-2010 / 10:18:24 / cg" |
|
400 | 3212 |
! ! |
3213 |
||
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3214 |
!ImageEditor class methodsFor:'tableColumns specs'! |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3215 |
|
1900 | 3216 |
colorTableColumns |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3217 |
"This resource specification was automatically generated |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3218 |
by the DataSetBuilder of ST/X." |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3219 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3220 |
"Do not manually edit this!! If it is corrupted, |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3221 |
the DataSetBuilder may not be able to read the specification." |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3222 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3223 |
" |
1975 | 3224 |
DataSetBuilder new openOnClass:ImageEditor andSelector:#colorTableColumns |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3225 |
" |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3226 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3227 |
<resource: #tableColumns> |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3228 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3229 |
^#( |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3230 |
(DataSetColumnSpec |
2174 | 3231 |
activeHelpKey: '' |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3232 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3233 |
rendererType: rowSelector |
2712 | 3234 |
backgroundSelector: theColorItself: |
3235 |
selectedBackgroundSelector: theColorItself: |
|
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3236 |
isResizeable: false |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3237 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3238 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3239 |
label: 'R' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3240 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3241 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3242 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3243 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3244 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3245 |
model: redFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3246 |
writeSelector: redAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3247 |
selectSelector: canSelectRedInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3248 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3249 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3250 |
label: 'G' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3251 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3252 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3253 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3254 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3255 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3256 |
model: greenFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3257 |
writeSelector: greenAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3258 |
selectSelector: canSelectGreenInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3259 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3260 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3261 |
label: 'B' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3262 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3263 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3264 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3265 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3266 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3267 |
model: blueFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3268 |
writeSelector: blueAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3269 |
selectSelector: canSelectBlueInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3270 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3271 |
) |
2174 | 3272 |
|
3273 |
"Modified: / 22-07-2007 / 13:21:57 / cg" |
|
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3274 |
! ! |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3275 |
|
400 | 3276 |
!ImageEditor methodsFor:'accessing'! |
3277 |
||
3278 |
image |
|
767 | 3279 |
"returns the current editing image" |
400 | 3280 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3281 |
^ imageEditView image |
400 | 3282 |
! |
3283 |
||
3284 |
postOpenAction: anAction |
|
767 | 3285 |
"sets an action which is evaluated after opening" |
400 | 3286 |
|
3287 |
postOpenAction := anAction |
|
1381 | 3288 |
! |
3289 |
||
3290 |
resourceClass:aClass |
|
3291 |
imageEditView resourceClass:aClass |
|
400 | 3292 |
! ! |
3293 |
||
2767 | 3294 |
!ImageEditor methodsFor:'accessing-behavior'! |
3295 |
||
3296 |
allowedToChangeImageDimensionAndDepth |
|
3297 |
"used to edit an existing image's contents only (Expecco)" |
|
3298 |
||
3299 |
^ allowedToChangeImageDimensionAndDepth ? true |
|
3300 |
! |
|
3301 |
||
3302 |
allowedToChangeImageDimensionAndDepth:aBoolean |
|
3303 |
"used to edit an existing image's contents only (Expecco)" |
|
3304 |
||
3305 |
allowedToChangeImageDimensionAndDepth := aBoolean |
|
3306 |
! ! |
|
3307 |
||
1398 | 3308 |
!ImageEditor methodsFor:'accessing-views'! |
400 | 3309 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3310 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3311 |
"returns the view of the colormap" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3312 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
3313 |
^(self componentAt: #colorDataSetView) |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3314 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3315 |
"Created: / 26.7.1998 / 12:02:14 / cg" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3316 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3317 |
|
487 | 3318 |
coordLabel |
767 | 3319 |
"returns the view the coord label" |
487 | 3320 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
3321 |
^self componentAt: #coordLabel |
487 | 3322 |
! |
3323 |
||
400 | 3324 |
imageEditView |
911 | 3325 |
"returns the view of the image" |
400 | 3326 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3327 |
imageEditView isNil ifTrue:[ |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
3328 |
imageEditView := (self componentAt: #imageEditView) scrolledView. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3329 |
imageEditView addDependent:self. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3330 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3331 |
^ imageEditView |
1345 | 3332 |
|
3333 |
"Modified: / 10.2.2000 / 23:19:20 / cg" |
|
400 | 3334 |
! |
3335 |
||
3336 |
imagePreView |
|
767 | 3337 |
"returns the preview of the image" |
400 | 3338 |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3339 |
|imagePreViewSubViews| |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3340 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3341 |
imagePreViewSubViews := (self componentAt: #imagePreView) subViews. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3342 |
|
2043 | 3343 |
"subViews is an empty array at closing image Editor" |
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3344 |
imagePreViewSubViews isEmptyOrNil ifTrue:[ |
2043 | 3345 |
^ nil |
3346 |
]. |
|
3347 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3348 |
^ imagePreViewSubViews first |
475 | 3349 |
! ! |
3350 |
||
400 | 3351 |
!ImageEditor methodsFor:'aspects'! |
3352 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3353 |
activityInfoHolder |
1987 | 3354 |
^ self infoLabelHolder |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3355 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3356 |
"Modified: / 29.7.1998 / 18:49:03 / cg" |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3357 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3358 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3359 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3360 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3361 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3362 |
"Created: / 26.7.1998 / 12:17:03 / cg" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3363 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3364 |
|
2792 | 3365 |
hasClassAndSelectorDefinedHolder |
1054 | 3366 |
^ [ |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
3367 |
|cls| |
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
3368 |
|
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
3369 |
(cls := imageEditView resourceClass) notNil |
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
3370 |
and:[imageEditView resourceSelector notNil] |
1054 | 3371 |
] |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3372 |
|
2792 | 3373 |
"Created: / 04-07-2010 / 10:11:10 / cg" |
3374 |
! |
|
3375 |
||
3376 |
hasClassDefinedHolder |
|
1054 | 3377 |
^ [ |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
3378 |
imageEditView resourceClass notNil |
1054 | 3379 |
] |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3380 |
|
2792 | 3381 |
"Created: / 04-07-2010 / 10:11:47 / cg" |
3382 |
! |
|
3383 |
||
3384 |
hasColorSelectedHolder |
|
3385 |
^ [ self selectedColorIndexOrNil notNil ] |
|
3386 |
||
3387 |
"Created: / 04-07-2010 / 10:12:22 / cg" |
|
2651 | 3388 |
! |
3389 |
||
1008 | 3390 |
hasColormap |
2792 | 3391 |
^ self image notNil and:[self image colorMap notNil] |
3392 |
||
3393 |
"Created: / 30-09-1998 / 23:53:55 / cg" |
|
3394 |
"Modified: / 04-07-2010 / 10:13:26 / cg" |
|
1008 | 3395 |
! |
3396 |
||
2651 | 3397 |
hasColormapAndColorSelected |
2792 | 3398 |
^ [ self hasColormapHolder value and:[self hasColorSelectedHolder value]] |
3399 |
||
3400 |
"Modified: / 04-07-2010 / 10:13:13 / cg" |
|
3401 |
! |
|
3402 |
||
3403 |
hasColormapHolder |
|
3404 |
^ [self hasColormap] |
|
3405 |
||
3406 |
"Created: / 04-07-2010 / 10:13:05 / cg" |
|
3407 |
! |
|
3408 |
||
2812 | 3409 |
imageHasImageSequence |
3410 |
^ self image notNil and:[self image imageSequence notNil] |
|
3411 |
||
3412 |
"Created: / 21-10-2010 / 14:35:45 / cg" |
|
3413 |
! |
|
3414 |
||
3415 |
imageHasImageSequenceHolder |
|
3416 |
|holder| |
|
3417 |
||
3418 |
(holder := builder bindingAt:#imageHasImageSequenceHolder) isNil ifTrue:[ |
|
3419 |
builder aspectAt:#imageHasImageSequenceHolder put:(holder := false asValue). |
|
3420 |
holder value:(self imageHasImageSequence). |
|
3421 |
]. |
|
3422 |
^ holder |
|
3423 |
||
3424 |
"Modified: / 21-10-2010 / 14:36:57 / cg" |
|
3425 |
! |
|
3426 |
||
3427 |
imageHasNextImage |
|
3428 |
^ self imageHasImageSequence and:[ (imageSeqNr ? 1) < self image imageSequence size ] |
|
3429 |
||
3430 |
"Created: / 21-10-2010 / 14:37:10 / cg" |
|
3431 |
! |
|
3432 |
||
2792 | 3433 |
imageHasNextImageHolder |
2812 | 3434 |
|holder| |
3435 |
||
3436 |
(holder := builder bindingAt:#imageHasNextImageHolder) isNil ifTrue:[ |
|
3437 |
builder aspectAt:#imageHasNextImageHolder put:(holder := false asValue). |
|
3438 |
holder value:(self imageHasNextImage). |
|
3439 |
]. |
|
3440 |
^ holder |
|
3441 |
||
3442 |
"Modified: / 21-10-2010 / 14:37:40 / cg" |
|
3443 |
! |
|
3444 |
||
3445 |
imageHasPreviousImage |
|
3446 |
^ self imageHasImageSequence and:[ (imageSeqNr ? 1) > 1 ] |
|
3447 |
||
3448 |
"Created: / 21-10-2010 / 14:37:21 / cg" |
|
3449 |
! |
|
3450 |
||
3451 |
imageHasPreviousImageHolder |
|
3452 |
|holder| |
|
3453 |
||
3454 |
(holder := builder bindingAt:#imageHasPreviousImageHolder) isNil ifTrue:[ |
|
3455 |
builder aspectAt:#imageHasPreviousImageHolder put:(holder := false asValue). |
|
3456 |
holder value:(self imageHasPreviousImage). |
|
3457 |
]. |
|
3458 |
^ holder |
|
3459 |
||
3460 |
"Modified: / 21-10-2010 / 14:37:48 / cg" |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
3461 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
3462 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3463 |
imageInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3464 |
|holder| |
2792 | 3465 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3466 |
(holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3467 |
builder aspectAt:#imageInfoHolder put:(holder := '' asValue). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3468 |
]. |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3469 |
^ holder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3470 |
|
2792 | 3471 |
"Modified: / 04-07-2010 / 10:15:14 / cg" |
400 | 3472 |
! |
3473 |
||
2767 | 3474 |
imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
3475 |
"returns whether an image is loaded as value holder" |
|
3476 |
||
3477 |
^ [ |
|
2792 | 3478 |
self imageIsLoadedHolder value |
2767 | 3479 |
and:[ self allowedToChangeImageDimensionAndDepth ] |
3480 |
] |
|
2792 | 3481 |
|
3482 |
"Modified: / 04-07-2010 / 10:15:43 / cg" |
|
2767 | 3483 |
! |
3484 |
||
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3485 |
imageIsLoadedAndClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3486 |
"returns whether an image is loaded as value holder" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3487 |
|
2792 | 3488 |
^ [self hasClassAndSelectorDefinedHolder value |
3489 |
and:[self imageIsLoadedHolder value]] |
|
3490 |
||
3491 |
"Created: / 31-07-1998 / 02:04:18 / cg" |
|
3492 |
"Modified: / 04-07-2010 / 10:15:48 / cg" |
|
3493 |
! |
|
3494 |
||
3495 |
imageIsLoadedHolder |
|
3496 |
"returns whether an image is loaded as value holder" |
|
3497 |
||
3498 |
|holder| |
|
3499 |
||
3500 |
(holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[ |
|
3501 |
builder aspectAt:#imageIsLoaded put:(holder := false asValue). |
|
3502 |
]. |
|
3503 |
^ holder |
|
3504 |
||
3505 |
"Created: / 04-07-2010 / 10:15:38 / cg" |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3506 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3507 |
|
400 | 3508 |
listOfColors |
1896 | 3509 |
"returns the list of colors" |
3510 |
||
3511 |
|list| |
|
3512 |
||
3513 |
(list := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
3514 |
builder aspectAt:#listOfColors put:(list := List new). |
|
3515 |
list addDependent:self. |
|
400 | 3516 |
]. |
1896 | 3517 |
^ list |
400 | 3518 |
! |
3519 |
||
1987 | 3520 |
magnificationHolder |
3521 |
"returns current magnification of the image as an AspectAdaptor" |
|
3522 |
||
3523 |
|holder| |
|
3524 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
3525 |
builder aspectAt:#valueOfMagnification put:( |
|
3526 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
3527 |
]. |
|
3528 |
^ holder |
|
3529 |
! |
|
3530 |
||
2792 | 3531 |
previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3532 |
|holder| |
2792 | 3533 |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3534 |
(holder := builder bindingAt:#previewBackgroundColor) isNil ifTrue:[ |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3535 |
builder aspectAt:#previewBackgroundColor put:(holder := nil asValue). |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3536 |
holder addDependent:self. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3537 |
]. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3538 |
^ holder |
2792 | 3539 |
|
3540 |
"Created: / 04-07-2010 / 10:19:34 / cg" |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3541 |
! |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3542 |
|
400 | 3543 |
selectionOfColor |
1682 | 3544 |
"returns a valueHolder for the current selection of the edit color. |
3545 |
Here, an AspectAdaptor which accesses selectedColorIndex is returned." |
|
400 | 3546 |
|
3547 |
|holder| |
|
1682 | 3548 |
|
400 | 3549 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
3550 |
builder aspectAt:#selectionOfColor put:( |
|
1682 | 3551 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ). |
400 | 3552 |
]. |
3553 |
^ holder |
|
3554 |
! |
|
3555 |
||
1558 | 3556 |
tileModeHolder |
3557 |
|holder| |
|
2812 | 3558 |
|
1558 | 3559 |
(holder := builder bindingAt:#tileModeHolder) isNil ifTrue:[ |
3560 |
builder aspectAt:#tileModeHolder put:(holder := false asValue). |
|
3561 |
holder addDependent:self. |
|
3562 |
]. |
|
3563 |
^ holder |
|
2812 | 3564 |
|
3565 |
"Modified: / 21-10-2010 / 14:35:24 / cg" |
|
1558 | 3566 |
! |
3567 |
||
400 | 3568 |
valueOfMagnification |
2308 | 3569 |
<resource: #obsolete> |
767 | 3570 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 3571 |
|
1987 | 3572 |
self obsoleteMethodWarning:'stupid method name - use #magnificationHolder'. |
3573 |
^ self magnificationHolder |
|
400 | 3574 |
! ! |
3575 |
||
767 | 3576 |
!ImageEditor methodsFor:'change & update'! |
3577 |
||
3578 |
findColorMapMode |
|
899 | 3579 |
"finds the colorMapMode for a new image" |
767 | 3580 |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3581 |
|image newListOfColors colorMapModeKey drawColor1 drawColor2 someOrAllUsedColors| |
1054 | 3582 |
|
3583 |
image := self image. |
|
1975 | 3584 |
image isNil ifTrue:[^ self ]. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3585 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3586 |
image mask notNil ifTrue: [ |
1896 | 3587 |
colorMapModeKey := 'masked'. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3588 |
] ifFalse:[ |
1896 | 3589 |
colorMapModeKey := 'depth'. |
1054 | 3590 |
]. |
1896 | 3591 |
colorMapModeKey := colorMapModeKey , image depth printString. |
1967 | 3592 |
self colorMapMode setValue:colorMapModeKey. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3593 |
|
1928 | 3594 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3595 |
image depth > 12 ifTrue:[ |
2447 | 3596 |
newListOfColors := OrderedCollection new. |
1904 | 3597 |
image colorMap isEmptyOrNil ifTrue:[ |
1927 | 3598 |
someOrAllUsedColors := image usedColorsMax:10000. |
2054 | 3599 |
someOrAllUsedColors notNil ifTrue:[ |
3600 |
someOrAllUsedColors := someOrAllUsedColors asArray. |
|
3601 |
someOrAllUsedColors sort:self sortBlockForColors. |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3602 |
newListOfColors addAll:someOrAllUsedColors. |
2054 | 3603 |
"/ listOfColors add:Color black; add:Color white. |
3604 |
] |
|
1904 | 3605 |
] ifFalse:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3606 |
newListOfColors addAll:(image colorMap). |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3607 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3608 |
] ifFalse:[ |
2447 | 3609 |
newListOfColors := OrderedCollection withAll:(self listOfColors). |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3610 |
newListOfColors isEmpty ifTrue:[ |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3611 |
self colorMapMode: colorMapMode value. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3612 |
image := self image. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3613 |
]. |
2054 | 3614 |
]. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3615 |
newListOfColors notEmptyOrNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3616 |
drawColor1 := newListOfColors at:1. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3617 |
drawColor2 := newListOfColors at:2 ifAbsent:drawColor1. |
2054 | 3618 |
|
3619 |
self hasMask ifTrue: [ |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3620 |
(newListOfColors contains: [:clr| clr = (Color colorId:0)]) |
2054 | 3621 |
ifFalse:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3622 |
newListOfColors addFirst:(Color colorId:0). |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3623 |
drawColor1 := newListOfColors at:2. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3624 |
drawColor2 := newListOfColors at:3 ifAbsent:drawColor1. |
2054 | 3625 |
] |
3626 |
]. |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3627 |
"/ imageEditView drawingColors:(Array with: drawColor1 with: drawColor2). |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3628 |
"/ self selectionOfColor |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3629 |
"/ setValue: 0; |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3630 |
"/ value: (listOfColors indexOf: imageEditView selectedColor). |
767 | 3631 |
]. |
2447 | 3632 |
self listOfColors asOrderedCollection ~= newListOfColors ifTrue:[ |
3633 |
self listOfColors contents:newListOfColors. |
|
3634 |
]. |
|
2054 | 3635 |
"Modified: / 07-07-2006 / 12:27:43 / cg" |
767 | 3636 |
! |
3637 |
||
942 | 3638 |
update:something with:aParameter from:changedObject |
2042 | 3639 |
|clrIndex img imagePreView clr changedColor| |
1436 | 3640 |
|
3641 |
img := self image. |
|
2042 | 3642 |
imagePreView := self imagePreView. |
1558 | 3643 |
|
3644 |
changedObject == self tileModeHolder ifTrue:[ |
|
2042 | 3645 |
imagePreView |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3646 |
tileMode:(changedObject value) tileOffset:(img extent); |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3647 |
clear; |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3648 |
invalidate. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3649 |
^ self |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3650 |
]. |
2792 | 3651 |
changedObject == self previewBackgroundColorHolder ifTrue:[ |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3652 |
clr := changedObject value isNil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3653 |
ifTrue:[imageEditView viewBackground] |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3654 |
ifFalse:[Color perform:changedObject value]. |
2042 | 3655 |
imagePreView |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3656 |
viewBackground:clr; |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3657 |
clear; |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3658 |
invalidate. |
1558 | 3659 |
^ self |
3660 |
]. |
|
3661 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3662 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3663 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3664 |
"/ colormap entry changed at aParameter |
960 | 3665 |
|
3666 |
clrIndex := aParameter. |
|
3667 |
(self hasMask) ifTrue:[ |
|
3668 |
clrIndex := clrIndex - 1. |
|
3669 |
]. |
|
1928 | 3670 |
changedColor := changedObject at:aParameter. |
3671 |
img colorMap notNil ifTrue:[ |
|
3672 |
img colorMap at:clrIndex put:changedColor. |
|
3673 |
self colorMapChanged. |
|
3674 |
] ifFalse:[ |
|
3675 |
drawingColormap notNil ifTrue:[ |
|
3676 |
drawingColormap at:clrIndex put:changedColor. |
|
3677 |
]. |
|
3678 |
]. |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3679 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3680 |
]. |
1896 | 3681 |
^ self |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3682 |
]. |
1124 | 3683 |
|
3684 |
changedObject == imageEditView undoImages ifTrue:[ |
|
1987 | 3685 |
self canUndoHolder value:(changedObject notEmpty). |
1124 | 3686 |
^ self. |
3687 |
]. |
|
3688 |
||
1345 | 3689 |
changedObject == imageEditView ifTrue:[ |
3690 |
something == #imageColors ifTrue:[ |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3691 |
self updateListOfColorsAndColormapMode. |
1345 | 3692 |
^ self. |
3693 |
]. |
|
3694 |
something == #image ifTrue:[ |
|
2812 | 3695 |
self updateAfterImageChange. |
2728 | 3696 |
imagePreView image:img scroll:false. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3697 |
self updateListOfColorsAndColormapMode. |
1558 | 3698 |
self tileModeHolder value ifTrue:[ |
2042 | 3699 |
imagePreView tileMode:true tileOffset:(img extent). |
1558 | 3700 |
]. |
1345 | 3701 |
^ self. |
3702 |
]. |
|
3703 |
something == #subImageIn ifTrue:[ |
|
2042 | 3704 |
imagePreView image ~~ img ifTrue:[ |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
3705 |
self error:'internal error' mayProceed:true. |
1406 | 3706 |
]. |
1558 | 3707 |
self tileModeHolder value ifTrue:[ |
2042 | 3708 |
imagePreView invalidate. |
1558 | 3709 |
] ifFalse:[ |
2042 | 3710 |
imagePreView invalidate:aParameter. |
1558 | 3711 |
]. |
1345 | 3712 |
^ self. |
3713 |
]. |
|
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
3714 |
something == #selectedColor ifTrue:[ |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3715 |
(aParameter isNil or:[aParameter = (Color colorId:0)]) ifTrue:[ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3716 |
"/ no color/mask */ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3717 |
"/ self halt. |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3718 |
clrIndex := self hasMask ifTrue:[1] ifFalse:[0]. |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3719 |
] ifFalse:[ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
3720 |
clrIndex := self listOfColors indexOf:aParameter. |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
3721 |
]. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
3722 |
self selectionOfColor value:clrIndex. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
3723 |
^ self. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
3724 |
]. |
1345 | 3725 |
^ self. |
3726 |
]. |
|
3727 |
||
1880 | 3728 |
changedObject == imageEditView modifiedHolder ifTrue:[ |
3729 |
"/ self halt:'to be implemented'. |
|
3730 |
^ self |
|
3731 |
]. |
|
3732 |
||
1345 | 3733 |
changedObject == imageEditView image ifTrue:[ |
2042 | 3734 |
"/ self halt:'to be implemented'. |
2812 | 3735 |
self updateAfterImageChange. |
1345 | 3736 |
^ self. |
3737 |
]. |
|
3738 |
||
942 | 3739 |
super update:something with:aParameter from:changedObject |
3740 |
||
2812 | 3741 |
"Modified: / 21-10-2010 / 14:34:31 / cg" |
3742 |
! |
|
3743 |
||
3744 |
updateAfterImageChange |
|
3745 |
|img| |
|
3746 |
||
3747 |
(img := self image) notNil ifTrue:[ |
|
3748 |
img := img onDevice:device. |
|
3749 |
self updateColorsFromImage:img. |
|
3750 |
self findColorMapMode. |
|
3751 |
self updateLabelsAndHistory. |
|
3752 |
||
3753 |
imageSeqNr isNil ifTrue:[ |
|
3754 |
imageSeqNr := 1 |
|
3755 |
]. |
|
3756 |
self imageHasImageSequenceHolder value:(self imageHasImageSequence). |
|
3757 |
self imageHasNextImageHolder value:(self imageHasNextImage). |
|
3758 |
self imageHasPreviousImageHolder value:(self imageHasPreviousImage). |
|
3759 |
] ifFalse:[ |
|
3760 |
self updateForNoImage |
|
3761 |
] |
|
3762 |
||
3763 |
"Modified: / 21-10-2010 / 14:40:45 / cg" |
|
942 | 3764 |
! |
3765 |
||
1900 | 3766 |
updateColorsFromImage:image |
3767 |
|colors| |
|
3768 |
||
1904 | 3769 |
colors := image colorMap. |
3770 |
colors isNil ifTrue:[ |
|
1906 | 3771 |
Error handle:[:ex | |
3772 |
colors := OrderedCollection new. |
|
3773 |
] do:[ |
|
3774 |
colors := image usedColors asSet. |
|
3775 |
] |
|
1900 | 3776 |
]. |
1904 | 3777 |
self listOfColors contents:(colors asOrderedCollection). |
1900 | 3778 |
! |
3779 |
||
1054 | 3780 |
updateForNoImage |
767 | 3781 |
"updates channels and view, if image is loaded" |
3782 |
||
2792 | 3783 |
self imageIsLoadedHolder value: false. |
767 | 3784 |
self listOfColors removeAll. |
2812 | 3785 |
self imagePreView image: nil. |
3786 |
self imageHasImageSequenceHolder value:false. |
|
3787 |
||
3788 |
"Modified: / 21-10-2010 / 14:39:13 / cg" |
|
767 | 3789 |
! |
3790 |
||
3791 |
updateLabelsAndHistory |
|
3792 |
"updates labels and history, if something has changed" |
|
3793 |
||
1910 | 3794 |
|image| |
3795 |
||
3796 |
image := self image. |
|
3797 |
||
2792 | 3798 |
self imageIsLoadedHolder value: image notNil. |
1910 | 3799 |
image isNil ifTrue: [^nil]. |
767 | 3800 |
|
3801 |
self updateInfoLabel. |
|
3802 |
||
1975 | 3803 |
imageEditView resourceClass notNil ifTrue:[ |
3804 |
imageEditView resourceSelector notNil ifTrue:[ |
|
3805 |
self addHistoryEntryForClass:imageEditView resourceClass selector:imageEditView resourceSelector. |
|
3806 |
] |
|
3807 |
]. |
|
3808 |
||
3809 |
image fileName notNil ifTrue: [ |
|
3810 |
self addHistoryEntryForFile:image fileName. |
|
3811 |
]. |
|
2792 | 3812 |
|
3813 |
"Modified: / 04-07-2010 / 10:16:02 / cg" |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3814 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3815 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3816 |
updateListOfColorsAndColormapMode |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3817 |
|selectedColor colorMap image| |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3818 |
|
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3819 |
selectedColor := self selectedColorOrNil. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3820 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3821 |
image := self image. |
1975 | 3822 |
image isNil ifTrue:[ |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3823 |
self listOfColors removeAll. |
1975 | 3824 |
] ifFalse:[ |
3825 |
colorMap := image colorMap. |
|
2447 | 3826 |
colorMap notNil ifTrue:[ |
3827 |
(colorMap size <= 4096) ifTrue:[ |
|
3828 |
image mask notNil ifTrue:[ |
|
3829 |
colorMap := (Array with:(Color noColor)),colorMap. |
|
3830 |
]. |
|
3831 |
self listOfColors contents:colorMap. |
|
3832 |
] ifFalse:[ |
|
3833 |
self listOfColors removeAll. |
|
3834 |
colorMap isFixedPalette ifTrue:[ |
|
3835 |
image colorMap:nil. |
|
3836 |
image photometric:#rgb. |
|
3837 |
image samplesPerPixel:3. |
|
3838 |
||
3839 |
image bitsPerSample:(Array |
|
3840 |
with:(colorMap bitsRed) |
|
3841 |
with:(colorMap bitsGreen) |
|
3842 |
with:(colorMap bitsBlue)). |
|
3843 |
]. |
|
3844 |
] |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3845 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3846 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
3847 |
self findColorMapMode. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3848 |
selectedColor notNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3849 |
self selectColor:selectedColor. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
3850 |
]. |
767 | 3851 |
! ! |
3852 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3853 |
!ImageEditor methodsFor:'data access'! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3854 |
|
1951 | 3855 |
atColor:anOldColor put:newColor |
1952 | 3856 |
"a color changed to a new color" |
3857 |
||
1930 | 3858 |
|index list oldColor image newImage oldSel| |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3859 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3860 |
list := self listOfColors. |
1951 | 3861 |
index := list identityIndexOf:anOldColor. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3862 |
|
1930 | 3863 |
oldSel := self selectionOfColor value. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3864 |
index ~~ 0 ifTrue:[ |
1928 | 3865 |
oldColor := list at:index. |
3866 |
list at:index put:newColor |
|
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3867 |
] ifFalse:[ |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
3868 |
self error:'internal error' mayProceed:true. |
1928 | 3869 |
list add:newColor |
3870 |
]. |
|
3871 |
||
3872 |
image := self image. |
|
3873 |
(image colorMap isNil |
|
3874 |
and:[drawingColormap isNil]) ifTrue:[ |
|
3875 |
oldColor notNil ifTrue:[ |
|
3876 |
imageEditView makeUndo. |
|
3877 |
newImage := image copy. |
|
3878 |
newImage |
|
3879 |
colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) |
|
3880 |
do:[:x :y :clr | |
|
3881 |
|newClr| |
|
3882 |
||
1951 | 3883 |
newClr := (clr = oldColor) ifTrue:[newColor] ifFalse:[clr]. |
1928 | 3884 |
newImage colorAtX:x y:y put:newClr |
3885 |
]. |
|
3886 |
imageEditView image:newImage. |
|
3887 |
imageEditView setModified. |
|
3888 |
self updateImage. |
|
3889 |
self updateImagePreView. |
|
1930 | 3890 |
|
3891 |
self selectionOfColor value:oldSel. |
|
3892 |
imageEditView selectedColorIndex:oldSel. |
|
3893 |
imageEditView selectedColor:(self listOfColors at:oldSel). |
|
1928 | 3894 |
] |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3895 |
]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3896 |
! |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3897 |
|
942 | 3898 |
blueAtColor:aColor put:newBlue |
3899 |
"helper used to return a new row element, when blue is changed" |
|
3900 |
||
3901 |
|byte| |
|
3902 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3903 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 3904 |
byte := newBlue clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3905 |
byte = aColor blueByte ifTrue:[^ self ]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3906 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3907 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3908 |
put:(Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte). |
942 | 3909 |
! |
3910 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3911 |
blueFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3912 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3913 |
|
930 | 3914 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3915 |
^ aColor blueByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3916 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3917 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 3918 |
"Modified: / 31.7.1998 / 01:11:18 / cg" |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3919 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3920 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3921 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3922 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3923 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3924 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3925 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3926 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3927 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3928 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3929 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3930 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3931 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3932 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3933 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3934 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3935 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3936 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3937 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3938 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3939 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3940 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3941 |
|
942 | 3942 |
greenAtColor:aColor put:newGreen |
3943 |
"helper used to return a new row element, when green is changed" |
|
3944 |
||
3945 |
|byte| |
|
3946 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3947 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 3948 |
byte := newGreen clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3949 |
byte = aColor greenByte ifTrue:[^ self]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3950 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3951 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3952 |
put:(Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)). |
942 | 3953 |
! |
3954 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3955 |
greenFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3956 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3957 |
|
930 | 3958 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3959 |
^ aColor greenByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3960 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3961 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 3962 |
"Modified: / 31.7.1998 / 01:11:31 / cg" |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3963 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3964 |
|
942 | 3965 |
redAtColor:aColor put:newRed |
3966 |
"helper used to return a new row element, when red is changed" |
|
3967 |
||
3968 |
|byte| |
|
3969 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3970 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 3971 |
byte := newRed clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3972 |
byte = aColor redByte ifTrue:[^ self]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3973 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3974 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
3975 |
put:(Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)). |
942 | 3976 |
! |
3977 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3978 |
redFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3979 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3980 |
|
930 | 3981 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3982 |
^ aColor redByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3983 |
|
930 | 3984 |
"Modified: / 31.7.1998 / 01:11:35 / cg" |
1449
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
3985 |
! |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
3986 |
|
2712 | 3987 |
theColorItself:aColor |
3988 |
"an accessor for the table-column" |
|
3989 |
||
1449
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
3990 |
^ aColor |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3991 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3992 |
|
2663 | 3993 |
!ImageEditor methodsFor:'defaults'! |
3994 |
||
3995 |
aboutIcon |
|
3996 |
^ self class defaultIcon |
|
3997 |
! ! |
|
3998 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
3999 |
!ImageEditor methodsFor:'drag & drop'! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4000 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4001 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4002 |
^ (aCollectionOfDropObjects size == 1) |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4003 |
and:[ aCollectionOfDropObjects |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4004 |
contains:[:dropObject | dropObject isFileObject]] |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4005 |
! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4006 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4007 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4008 |
|dropObject| |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4009 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4010 |
dropObject := aCollectionOfDropObjects first. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4011 |
dropObject isFileObject ifTrue:[ |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4012 |
self loadFromFile:dropObject asFilename. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4013 |
] |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4014 |
! ! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4015 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4016 |
!ImageEditor methodsFor:'event handling'! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4017 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4018 |
processEvent:anEvent |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4019 |
"Return true, if I have eaten the event" |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4020 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4021 |
|p| |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4022 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4023 |
anEvent view == self imagePreView ifTrue:[ |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4024 |
((anEvent isButtonPressEvent and:[ anEvent button == 1 ]) |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4025 |
or:[ anEvent isButtonMotionEvent and:[ anEvent hasButton1 ]]) ifTrue:[ |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4026 |
p := anEvent x @ anEvent y. |
2546 | 4027 |
anEvent view transformation notNil ifTrue:[ |
4028 |
p := anEvent view transformation applyInverseTo:p. |
|
4029 |
]. |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4030 |
self imageEditView scrollToMakeVisible:p. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4031 |
^ true. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4032 |
]. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4033 |
]. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4034 |
^ false. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4035 |
! ! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4036 |
|
672 | 4037 |
!ImageEditor methodsFor:'help'! |
4038 |
||
4039 |
defaultInfoLabel |
|
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4040 |
"returns the text shown in the info label, when the mouse is NOT over |
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4041 |
some widget with a help text." |
672 | 4042 |
|
1966 | 4043 |
|resourceClass resourceSelector| |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4044 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4045 |
resourceClass := imageEditView resourceClass. |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4046 |
resourceClass notNil ifTrue:[ |
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4047 |
resourceSelector := imageEditView resourceSelector. |
1966 | 4048 |
resourceSelector notNil ifTrue:[ |
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4049 |
^ resourceClass name, ' >> ', resourceSelector |
1966 | 4050 |
]. |
672 | 4051 |
]. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4052 |
^ 'No class and selector defined.' |
674 | 4053 |
! |
4054 |
||
702 | 4055 |
openDocumentation |
767 | 4056 |
"opens the documentation file of the Image Editor" |
674 | 4057 |
|
763 | 4058 |
self openHTMLDocument: 'tools/uipainter/ImageEditor.html' |
4059 |
||
672 | 4060 |
! ! |
4061 |
||
767 | 4062 |
!ImageEditor methodsFor:'loading'! |
4063 |
||
1975 | 4064 |
loadFromClass:aClass andSelector:aSelector |
4065 |
"loads an image from the method specified by class and selector" |
|
4066 |
||
4067 |
self assert:(aClass isNil or:[aClass isClass]). |
|
4068 |
||
4069 |
(aClass isNil or:[aSelector]) isNil ifTrue:[ |
|
4070 |
imageEditView resourceClass:aClass. |
|
4071 |
imageEditView resourceSelector:aSelector. |
|
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4072 |
imageEditView image:nil. |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4073 |
self clearModified. |
1966 | 4074 |
^ self. |
4075 |
]. |
|
4076 |
||
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4077 |
"/ (imageEditView resourceClass == aClass |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4078 |
"/ and:[ imageEditView resourceSelector == aSelector ]) ifTrue:[ |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4079 |
"/ imageEditView modified ifFalse:[ |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4080 |
"/ ^ self. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4081 |
"/ ]. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4082 |
"/ ]. |
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
4083 |
|
1975 | 4084 |
(imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue:[ |
1966 | 4085 |
self updateAfterImageChange. |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4086 |
self clearModified. |
1966 | 4087 |
] |
1975 | 4088 |
|
4089 |
"Modified: / 16.3.1999 / 21:44:41 / cg" |
|
1966 | 4090 |
! |
4091 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4092 |
loadFromFile:aFileName |
767 | 4093 |
"loads an image from aFileName and sets up color map list and other info labels" |
4094 |
||
980
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
4095 |
self withCursor:Cursor wait do:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
4096 |
(imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
1966 | 4097 |
self updateAfterImageChange |
767 | 4098 |
] |
4099 |
] |
|
960 | 4100 |
|
1057 | 4101 |
"Modified: / 16.3.1999 / 21:44:26 / cg" |
767 | 4102 |
! |
4103 |
||
960 | 4104 |
loadFromImage:anImage |
767 | 4105 |
"loads an image from anImage and sets up color map list and other info labels" |
4106 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4107 |
|img| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4108 |
|
1057 | 4109 |
anImage notNil ifTrue:[ |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4110 |
img := anImage onDevice:device. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4111 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4112 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4113 |
imageEditView image:img. |
1799
e605f0af928a
clear modified flag when an image is loaded
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
4114 |
imageEditView clearModified. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4115 |
|
1966 | 4116 |
self updateAfterImageChange. |
4117 |
"/ img notNil ifTrue:[ |
|
4118 |
"/ self updateColorsFromImage:img. |
|
4119 |
"/ self findColorMapMode. |
|
4120 |
"/ self updateLabelsAndHistory. |
|
4121 |
"/ ] ifFalse:[ |
|
4122 |
"/ self updateForNoImage |
|
4123 |
"/ ] |
|
960 | 4124 |
|
1057 | 4125 |
"Modified: / 16.3.1999 / 21:43:56 / cg" |
767 | 4126 |
! |
4127 |
||
1975 | 4128 |
loadFromOrPrepareForClass: aClass andSelector: aSelector |
767 | 4129 |
"loads an image by evaluating aMessage; |
4130 |
if no image could extract from aMessage; do set the class and the selector from |
|
4131 |
the aMessage for a saving at the end of editing" |
|
4132 |
||
1975 | 4133 |
(imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue: [ |
1900 | 4134 |
self updateColorsFromImage:self image. |
767 | 4135 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4136 |
] ifFalse: [ |
1975 | 4137 |
imageEditView resourceClass: aClass. |
4138 |
imageEditView resourceSelector:aSelector. |
|
767 | 4139 |
]. |
4140 |
self updateLabelsAndHistory. |
|
1057 | 4141 |
|
4142 |
"Modified: / 16.3.1999 / 21:45:07 / cg" |
|
767 | 4143 |
! ! |
4144 |
||
400 | 4145 |
!ImageEditor methodsFor:'menu modes'! |
4146 |
||
975 | 4147 |
colorMapMode |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4148 |
"returns the colorMapMode" |
400 | 4149 |
|
975 | 4150 |
colorMapMode isNil ifTrue: [colorMapMode := '' asValue]. |
400 | 4151 |
|
975 | 4152 |
^colorMapMode |
400 | 4153 |
! |
4154 |
||
975 | 4155 |
editMode |
4156 |
"returns editMode" |
|
400 | 4157 |
|
1054 | 4158 |
editMode isNil ifTrue: [ |
975 | 4159 |
editMode := #point asValue. |
1329 | 4160 |
editMode onChangeEvaluate:[imageEditView editMode:(editMode value)] |
975 | 4161 |
]. |
4162 |
||
4163 |
^editMode |
|
400 | 4164 |
! |
4165 |
||
975 | 4166 |
mouseKeyColorMode |
4167 |
"returns mouseKeyColorMode" |
|
400 | 4168 |
|
1345 | 4169 |
mouseKeyColorMode isNil ifTrue:[ |
975 | 4170 |
mouseKeyColorMode := 1 asValue. |
1345 | 4171 |
mouseKeyColorMode onChangeEvaluate: [ |
4172 |
imageEditView mouseKeyColorMode:mouseKeyColorMode value. |
|
4173 |
self selectionOfColor value: (self listOfColors indexOf:imageEditView selectedColor). |
|
4174 |
] |
|
956 | 4175 |
]. |
400 | 4176 |
|
975 | 4177 |
^mouseKeyColorMode |
1345 | 4178 |
|
4179 |
"Modified: / 10.2.2000 / 23:16:42 / cg" |
|
400 | 4180 |
! ! |
4181 |
||
1558 | 4182 |
!ImageEditor methodsFor:'private'! |
4183 |
||
1975 | 4184 |
checkModified |
4185 |
imageEditView modified value ifTrue:[ |
|
4186 |
(Dialog |
|
4187 |
confirm:(resources string:'Image was not saved. Proceed anyway ?') |
|
4188 |
yesLabel:(resources string:'Proceed') |
|
4189 |
noLabel:(resources string:'Cancel') |
|
4190 |
initialAnswer:false |
|
4191 |
) ifFalse: [^false]. |
|
4192 |
||
4193 |
imageEditView clearModified. |
|
4194 |
]. |
|
4195 |
^ true |
|
4196 |
||
4197 |
"Modified: / 29.7.1998 / 18:55:24 / cg" |
|
4198 |
! |
|
4199 |
||
1960 | 4200 |
pointFromString:aString |
4201 |
|p s x y| |
|
4202 |
||
4203 |
p := Object readFromString:aString onError:nil. |
|
1962 | 4204 |
p isPoint ifTrue:[^ p]. |
1960 | 4205 |
|
4206 |
s := aString readStream. |
|
4207 |
x := Number readFrom:s onError:nil. |
|
4208 |
x notNil ifTrue:[ |
|
4209 |
s skipSeparators. |
|
1962 | 4210 |
[s atEnd not and:[s peek isDigit not]] whileTrue:[s next]. |
1960 | 4211 |
y := Number readFrom:s onError:nil. |
1961 | 4212 |
^ x @ (y ? x) |
1960 | 4213 |
]. |
1962 | 4214 |
^ nil |
1960 | 4215 |
! |
4216 |
||
1939 | 4217 |
sortBlockForColors |
4218 |
^ [:a :b | |
|
4219 |
a redByte == b redByte ifTrue:[ |
|
4220 |
a greenByte == b greenByte ifTrue:[ |
|
4221 |
a blueByte < b blueByte |
|
4222 |
] ifFalse:[ |
|
4223 |
a greenByte < b greenByte |
|
4224 |
] |
|
4225 |
] ifFalse:[ |
|
4226 |
a redByte < b redByte |
|
4227 |
] |
|
4228 |
] |
|
4229 |
! |
|
4230 |
||
1598 | 4231 |
updateImage |
4232 |
|img| |
|
4233 |
||
4234 |
img := imageEditView image. |
|
4235 |
imageEditView image:img. |
|
4236 |
self fetchImageData. |
|
4237 |
! |
|
4238 |
||
1558 | 4239 |
updateImagePreView |
4240 |
self tileModeHolder value ifTrue:[ |
|
4241 |
self imagePreView tileMode:true tileOffset:(self image extent). |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4242 |
]. |
2546 | 4243 |
self imagePreView setImage:(self image) scroll:false invalidate:true. |
1558 | 4244 |
! ! |
4245 |
||
535 | 4246 |
!ImageEditor methodsFor:'queries'! |
4247 |
||
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
4248 |
hasLastGrabScreenArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
4249 |
^ [ lastGrabbedScreenArea notNil ] |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
4250 |
! |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
4251 |
|
960 | 4252 |
hasMask |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4253 |
^ colorMapMode value notNil and:[colorMapMode value startsWith:'mask'] |
960 | 4254 |
|
4255 |
"Created: / 18.8.1998 / 17:17:38 / cg" |
|
4256 |
! |
|
4257 |
||
1975 | 4258 |
modified |
4259 |
^ imageEditView modified |
|
4260 |
! |
|
4261 |
||
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4262 |
modified:aBoolean |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4263 |
super modified:aBoolean. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4264 |
imageEditView modified:aBoolean |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4265 |
! |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
4266 |
|
535 | 4267 |
preferredExtent |
767 | 4268 |
"returns the preferred extent" |
535 | 4269 |
|
2423
0c5ac1daf0e4
changed #preferredExtent - formating
Stefan Vogel <sv@exept.de>
parents:
2420
diff
changeset
|
4270 |
^ super preferredExtent max: (Screen current width//3)@(Screen current height//3.5) |
535 | 4271 |
! ! |
4272 |
||
400 | 4273 |
!ImageEditor methodsFor:'selection'! |
4274 |
||
4275 |
magnification |
|
767 | 4276 |
"returns the magnification of the image" |
400 | 4277 |
|
911 | 4278 |
self imageEditView isNil ifTrue: [^1]. |
4279 |
^imageEditView magnification x |
|
400 | 4280 |
! |
4281 |
||
4282 |
magnification: aValue |
|
767 | 4283 |
"sets the magnification of the image" |
400 | 4284 |
|
905 | 4285 |
|magnification| |
4286 |
magnification := (aValue ? 1) asPoint. |
|
911 | 4287 |
(magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil]. |
4288 |
imageEditView magnification: magnification |
|
400 | 4289 |
! |
4290 |
||
4291 |
selectedColorIndex |
|
767 | 4292 |
"returns the index of the selected color" |
400 | 4293 |
|
4294 |
^selectedColorIndex |
|
4295 |
! |
|
4296 |
||
4297 |
selectedColorIndex: anIndex |
|
767 | 4298 |
"sets the index of the selected color" |
400 | 4299 |
|
1054 | 4300 |
|clr pixel| |
4301 |
||
4302 |
selectedColorIndex := anIndex. |
|
2447 | 4303 |
anIndex isNil ifTrue:[^ self]. |
1054 | 4304 |
clr := self listOfColors at:anIndex ifAbsent:nil. |
4305 |
clr isNil ifTrue:[^ self]. |
|
4306 |
||
1075 | 4307 |
pixel := anIndex - 1. |
1054 | 4308 |
(self listOfColors at:1) = Color noColor ifTrue:[ |
4309 |
anIndex == 1 ifTrue:[ |
|
4310 |
pixel := nil. "/ mask |
|
4311 |
] ifFalse:[ |
|
1075 | 4312 |
pixel := pixel - 1 |
1054 | 4313 |
] |
4314 |
]. |
|
4315 |
imageEditView selectedColorIndex:pixel. |
|
4316 |
imageEditView selectedColor:clr. |
|
400 | 4317 |
! ! |
4318 |
||
1716 | 4319 |
!ImageEditor methodsFor:'startup & release'! |
400 | 4320 |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4321 |
closeDownViews |
1644 | 4322 |
builder notNil ifTrue:[ |
4323 |
DefaultRelativeSizes := |
|
4324 |
Array |
|
1998 | 4325 |
with:(builder componentAt:#mainPanel) relativeCorners |
1644 | 4326 |
with:(builder componentAt:#verticalPanel) relativeCorners. |
4327 |
]. |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4328 |
super closeDownViews |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4329 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4330 |
|
400 | 4331 |
closeRequest |
2016 | 4332 |
"asks for permission before closing" |
4333 |
||
4334 |
imageEditView checkModified ifTrue:[ |
|
4335 |
super closeRequest |
|
4336 |
] |
|
400 | 4337 |
! |
4338 |
||
1980 | 4339 |
commonPostBuild |
1975 | 4340 |
imageEditView undoImages addDependent:self. |
4341 |
imageEditView imageInfoHolder:(self imageInfoHolder). |
|
4342 |
imageEditView activityInfoHolder:(self activityInfoHolder). |
|
4343 |
||
4344 |
imageEditView clickInfoCallBack:[:button :point | |
|
4345 |
|mouseButtonColorToolBar| |
|
4346 |
||
4347 |
mouseButtonColorToolBar := self componentAt:#MouseButtonColorToolBar. |
|
4348 |
(mouseButtonColorToolBar itemAt:button) toggleIndication. |
|
4349 |
mouseButtonColorToolBar do: [:i| i updateIndicators]. |
|
4350 |
]. |
|
4351 |
||
4352 |
imageEditView addDependent:self. |
|
4353 |
imageEditView modifiedHolder addDependent:self. |
|
4354 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4355 |
DefaultRelativeSizes notNil ifTrue:[ |
1998 | 4356 |
(builder componentAt:#mainPanel) relativeCorners:DefaultRelativeSizes first. |
1980 | 4357 |
(builder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second. |
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4358 |
]. |
1995 | 4359 |
|
1996 | 4360 |
"/ using masters infoHolder ? |
4361 |
(builder aspectAt:#useAlienInfoLabelHolder) == true ifTrue:[ |
|
1998 | 4362 |
(builder componentAt:#mainPanel) layout bottomOffset:0. |
1995 | 4363 |
(builder componentAt:#infoBarSubSpec) beInvisible |
4364 |
] |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4365 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
4366 |
|
1980 | 4367 |
open |
4368 |
"after opening, sets the masterApplication of the imageEditView to self" |
|
4369 |
||
4370 |
super open. |
|
4371 |
||
4372 |
imageEditView := (self componentAt: #imageEditView) subViews first. |
|
4373 |
! |
|
4374 |
||
400 | 4375 |
postOpenWith:aBuilder |
767 | 4376 |
"after opening, sets the masterApplication of the imageEditView to self; |
4377 |
evaluate the postOpenAction" |
|
400 | 4378 |
|
1921 | 4379 |
postOpenAction value. |
400 | 4380 |
|
1250 | 4381 |
super postOpenWith:aBuilder. |
4382 |
||
4383 |
aBuilder keyboardProcessor menuBar:nil. |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4384 |
self windowGroup addPreEventHook:self. |
400 | 4385 |
! ! |
4386 |
||
1715 | 4387 |
!ImageEditor methodsFor:'user actions-colormap'! |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4388 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4389 |
addColorToColormap |
1682 | 4390 |
self addColorToColormap:(Color black) |
4391 |
! |
|
4392 |
||
4393 |
addColorToColormap:newColor |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4394 |
|depth img cMap newColorMap newImage oldCListSize newMode listOfColors| |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4395 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4396 |
img := self image. |
1499
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
4397 |
img isNil ifTrue:[ |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
4398 |
self warn:'No Image.'. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
4399 |
^ self |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
4400 |
]. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
4401 |
|
1054 | 4402 |
depth := img depth. |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4403 |
cMap := img colorMap. |
1054 | 4404 |
cMap isNil ifTrue:[ |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4405 |
drawingColormap isNil ifTrue:[ |
1916 | 4406 |
self information:(resources stringWithCRs:'Image has no colormap.\The shown colorMap is for drawing only.'). |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4407 |
drawingColormap := OrderedCollection new. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4408 |
]. |
1682 | 4409 |
drawingColormap add:newColor. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4410 |
self listOfColors contents:drawingColormap. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4411 |
self selectionOfColor value:(drawingColormap size). |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4412 |
|
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4413 |
"/ self warn:'Image has no colormap.\Change colorMap mode first.' withCRs. |
1054 | 4414 |
^ self |
4415 |
]. |
|
4416 |
||
1583 | 4417 |
("(depth == 1)" false |
1054 | 4418 |
or:[cMap size == (1 bitShift:depth)]) ifTrue:[ |
4419 |
depth >= 8 ifTrue:[ |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4420 |
self warn:'No space for more colors in colormap.'. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4421 |
^ self |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4422 |
]. |
1916 | 4423 |
(self confirm:(resources stringWithCRs:'No space for more colors in colormap.\Change depth ?')) |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4424 |
ifFalse:[ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4425 |
^ self |
1057 | 4426 |
]. |
4427 |
||
4428 |
imageEditView makeUndo. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4429 |
img mask notNil ifTrue:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4430 |
newMode := 'masked' , (depth*2) printString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4431 |
] ifFalse:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4432 |
newMode := 'depth' , (depth*2) printString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4433 |
]. |
1057 | 4434 |
self colorMapMode:newMode. |
4435 |
] ifFalse:[ |
|
4436 |
imageEditView makeUndo. |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4437 |
]. |
1054 | 4438 |
|
4439 |
cMap := cMap asArray. |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4440 |
listOfColors := self listOfColors. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4441 |
oldCListSize := listOfColors size. |
1054 | 4442 |
|
1682 | 4443 |
newColorMap := cMap copyWith:newColor. |
1054 | 4444 |
|
4445 |
newImage := img species new |
|
4446 |
width:img width |
|
4447 |
height:img height |
|
4448 |
depth:depth |
|
4449 |
fromArray:img bits. |
|
4450 |
||
4451 |
newImage colorMap:newColorMap. |
|
4452 |
newImage fileName:img fileName. |
|
4453 |
newImage mask:(img mask copy). |
|
4454 |
||
4455 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4456 |
listOfColors contents: newImage colorMap. |
1054 | 4457 |
self findColorMapMode. |
4458 |
"/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...) |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4459 |
listOfColors size > (oldCListSize + 1) ifTrue:[ |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4460 |
listOfColors removeLast |
1054 | 4461 |
]. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
4462 |
self selectionOfColor value:(listOfColors size). |
1054 | 4463 |
self updateLabelsAndHistory. |
4464 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4465 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4466 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
1057 | 4467 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4468 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4469 |
|
1650 | 4470 |
changeHLS |
4471 |
"interactive Hue/Light/Saturation editing" |
|
4472 |
||
4473 |
|bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4474 |
shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema |
2438 | 4475 |
originalPixels p previewImage previewImageHolder originalPreviewColormap originalPreviewPixels |
4476 |
anyChange | |
|
1652 | 4477 |
|
1741 | 4478 |
"/ compute the averageColor in the background (while asking user) |
2438 | 4479 |
avgColorHolder := nil asValue. |
4480 |
previewImageHolder := nil asValue. |
|
4481 |
||
1652 | 4482 |
readySema := Semaphore new. |
4483 |
[ |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4484 |
|image| |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4485 |
|
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4486 |
image := imageEditView image. |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4487 |
originalColormap := image colorMap copy. |
2438 | 4488 |
originalPixels := image bits. |
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4489 |
avgColor := image averageColor. |
2438 | 4490 |
avgColorHolder value:avgColor. |
4491 |
||
4492 |
previewImage := self image magnifiedPreservingRatioTo:100@100. |
|
4493 |
previewImageHolder value: previewImage. |
|
4494 |
originalPreviewColormap := previewImage colorMap copy. |
|
4495 |
originalPreviewPixels := previewImage bits. |
|
4496 |
||
1652 | 4497 |
readySema signal. |
4498 |
] forkAt:7. |
|
1649 | 4499 |
|
4500 |
acceptChannel := TriggerValue new. |
|
4501 |
||
4502 |
firstChange := true. |
|
2438 | 4503 |
anyChange := false. |
1649 | 4504 |
|
1651 | 4505 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
4506 |
Color |
|
4507 |
hue:((clr hue) ? 0 + hShift) |
|
1925 | 4508 |
light:((clr light * lFactor / 100) "min:100") |
4509 |
saturation:((clr saturation * sFactor / 100) "min:100")]. |
|
1652 | 4510 |
|
1649 | 4511 |
shiftAction := |
4512 |
[ |
|
1650 | 4513 |
|hShift lFactor sFactor| |
4514 |
||
1649 | 4515 |
acceptChannel value:true. |
4516 |
||
4517 |
firstChange ifTrue:[ |
|
4518 |
imageEditView makeUndo. |
|
4519 |
firstChange := false. |
|
2438 | 4520 |
anyChange := true. |
1649 | 4521 |
]. |
1652 | 4522 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
1650 | 4523 |
|
4524 |
hShift := hueShift value. |
|
4525 |
lFactor := lightValue value. |
|
4526 |
sFactor := saturationValue value. |
|
4527 |
||
1652 | 4528 |
avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor). |
4529 |
||
2438 | 4530 |
previewImage |
4531 |
colorMap:originalPreviewColormap copy; |
|
4532 |
bits:originalPreviewPixels copy; |
|
4533 |
release; |
|
4534 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
|
4535 |
previewImageHolder value:nil; value:previewImage. |
|
4536 |
||
1652 | 4537 |
shiftProcess notNil ifTrue:[ |
4538 |
shiftProcess terminate. |
|
4539 |
shiftProcess waitUntilTerminated. |
|
4540 |
shiftProcess := nil. |
|
4541 |
]. |
|
4542 |
shiftProcess := |
|
4543 |
[ |
|
4544 |
[ |
|
1656 | 4545 |
imageEditView image |
4546 |
colorMap:originalColormap copy; |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4547 |
bits:originalPixels copy; |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4548 |
release; |
1656 | 4549 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
1652 | 4550 |
self updateImage. |
4551 |
self updateInfoLabel. |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4552 |
self updateImagePreView. |
1652 | 4553 |
] ensure:[ shiftProcess := nil ]. |
4554 |
] forkAt:7. |
|
1649 | 4555 |
]. |
4556 |
||
4557 |
bindings := IdentityDictionary new. |
|
1650 | 4558 |
bindings at:#hueShiftAmount put:(hueShift := 0 asValue). |
1656 | 4559 |
hueShift onChangeEvaluate:shiftAction. |
1650 | 4560 |
|
4561 |
bindings at:#lightAmount put:(lightValue := 100 asValue). |
|
1656 | 4562 |
lightValue onChangeEvaluate:shiftAction. |
1650 | 4563 |
|
4564 |
bindings at:#saturationAmount put:(saturationValue := 100 asValue). |
|
1656 | 4565 |
saturationValue onChangeEvaluate:shiftAction. |
1650 | 4566 |
|
1649 | 4567 |
bindings at:#acceptChannel put:acceptChannel. |
1652 | 4568 |
bindings at:#hlsColor put:avgColorHolder. |
2438 | 4569 |
bindings at:#previewImageHolder put:previewImageHolder. |
1650 | 4570 |
|
4571 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
|
1649 | 4572 |
ifFalse:[ |
2438 | 4573 |
anyChange ifTrue:[ |
1649 | 4574 |
imageEditView undo |
4575 |
] |
|
4576 |
]. |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4577 |
|
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4578 |
(p := shiftProcess) notNil ifTrue:[ |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4579 |
p waitUntilTerminated. |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
4580 |
]. |
2438 | 4581 |
|
4582 |
anyChange ifTrue:[ |
|
4583 |
self updateImage. |
|
4584 |
self updateImagePreView. |
|
4585 |
]. |
|
1649 | 4586 |
! |
4587 |
||
2652 | 4588 |
clearColormapEntry0AndMaskedPixels |
4589 |
"ensure that there is a colorMap entry with 0/0/0 at position |
|
4590 |
0 and then clear all masked pixels (to pixelValue 0). |
|
4591 |
This is required for windows icons to be really transparent" |
|
4592 |
||
4593 |
|index colorMap| |
|
4594 |
||
4595 |
self compressColorMap. |
|
4596 |
colorMap := self image colorMap. |
|
4597 |
(colorMap includes:(Color black)) ifFalse:[ |
|
4598 |
self addColorToColormap:(Color black). |
|
4599 |
colorMap := self image colorMap. |
|
4600 |
]. |
|
4601 |
index := colorMap indexOf:(Color black). |
|
4602 |
index == 1 ifFalse:[ |
|
4603 |
self sortColorMap. |
|
4604 |
colorMap := self image colorMap. |
|
4605 |
]. |
|
4606 |
self clearMaskedPixels |
|
4607 |
! |
|
4608 |
||
1403 | 4609 |
clearMaskedPixels |
4610 |
"clear all masked pixels (to pixelValue 0)" |
|
4611 |
||
2652 | 4612 |
|newImage| |
4613 |
||
4614 |
newImage := self image clearMaskedPixels. |
|
4615 |
0 to:newImage height - 1 do:[:y | |
|
4616 |
0 to:newImage width - 1 do:[:x | |
|
4617 |
(newImage maskAtX:x y:y) == 0 ifTrue:[ |
|
4618 |
newImage pixelAtX:x y:y put:0 |
|
1460 | 4619 |
] |
1403 | 4620 |
] |
2652 | 4621 |
]. |
4622 |
||
4623 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
4624 |
self fetchImageData. |
|
1403 | 4625 |
] |
4626 |
! |
|
4627 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4628 |
colorMapChanged |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4629 |
|img| |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4630 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4631 |
img := self image. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4632 |
img release. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4633 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4634 |
self imageEditView invalidate. |
960 | 4635 |
self imagePreView invalidate. |
4636 |
||
4637 |
"/ (imageEditView image:img) notNil ifTrue:[ |
|
4638 |
"/ self updateLabelsAndHistory. |
|
4639 |
"/ self imagePreView image:img |
|
4640 |
"/ ] |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4641 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4642 |
"Created: / 7.8.1998 / 22:26:10 / cg" |
960 | 4643 |
"Modified: / 18.8.1998 / 17:08:55 / cg" |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4644 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
4645 |
|
975 | 4646 |
colorMapMode:aMode |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4647 |
"calculates a new color map for the image from aMode" |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4648 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4649 |
|depth numColors newColorMap newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4650 |
oldImage image newColors realColorMap oldFileName |
1008 | 4651 |
usedColors useNearest usageCounts tmpBits tmpMap quest |
4652 |
prevMode maskThreshold maskImage| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4653 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4654 |
self withExecuteCursorDo:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4655 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4656 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
4657 |
prevMode := colorMapMode value. |
1008 | 4658 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4659 |
newColorMap := self class listOfColorMaps at:aMode. |
2572 | 4660 |
aMode == #depth32 ifTrue:[ |
4661 |
depth := 32. |
|
4662 |
] ifFalse:[ |
|
4663 |
depth := (newColorMap size log:2) asInteger. |
|
4664 |
]. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4665 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4666 |
useNearest := false. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4667 |
depth == 1 ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4668 |
quest := 'Keep colormap (or use standard B&W)' |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4669 |
] ifFalse:[ |
1008 | 4670 |
prevMode isNil ifTrue:[ |
4671 |
quest := 'Compute colormap (or use standard)' |
|
4672 |
] ifFalse:[ |
|
4673 |
quest := 'Keep colormap (or use standard)' |
|
4674 |
] |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4675 |
]. |
1008 | 4676 |
((prevMode = aMode) |
1057 | 4677 |
or:[depth > oldImage depth |
4678 |
or:[self confirm:(resources string:quest)]]) ifTrue:[ |
|
1937 | 4679 |
(newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[ |
1935 | 4680 |
|
4681 |
"/ keep the colormap |
|
4682 |
newColorMap atAllPut:Color black. |
|
4683 |
depth > oldImage depth ifTrue:[ |
|
4684 |
"/ easy - simply copy the part |
|
4685 |
numColors := 1 bitShift:oldImage depth. |
|
4686 |
0 to:numColors-1 do:[:pixel | |
|
4687 |
newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel) |
|
1008 | 4688 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4689 |
] ifFalse:[ |
1935 | 4690 |
"/ see if all used color fit the new colormap |
4691 |
usedColors := oldImage usedColorsMax:(1 bitShift:depth). |
|
4692 |
(usedColors notNil and:[usedColors size > (1 bitShift:depth)]) ifTrue:[ |
|
4693 |
usedColors := oldImage realUsedColors |
|
4694 |
]. |
|
4695 |
(usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[ |
|
4696 |
"/ yea - just install them |
|
4697 |
usedColors asArray keysAndValuesDo:[:idx :clr | |
|
4698 |
newColorMap at:idx put:clr |
|
4699 |
]. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4700 |
] ifFalse:[ |
1935 | 4701 |
"/ copy over those that are most often used. |
4702 |
oldImage depth < 8 ifTrue:[ |
|
4703 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
4704 |
oldImage bits |
|
4705 |
expandPixels:(oldImage depth) |
|
4706 |
width:oldImage width |
|
4707 |
height:oldImage height |
|
4708 |
into:tmpBits |
|
4709 |
mapping:nil. |
|
986 | 4710 |
] ifFalse:[ |
1935 | 4711 |
oldImage depth == 8 ifTrue:[ |
4712 |
tmpBits := oldImage bits |
|
4713 |
] ifFalse:[ |
|
4714 |
colorMapMode value:prevMode. |
|
4715 |
self findColorMapMode. |
|
4716 |
self warn:('Too many used colors in image (', oldImage usedColors size printString , ').'). |
|
4717 |
^ self |
|
4718 |
"/ (self confirm:('Too many used colors in image (', oldImage usedColors size printString , ').\\Dither ?' withCRs)) |
|
4719 |
"/ ifFalse:[. |
|
4720 |
"/ ^ self |
|
4721 |
"/ ]. |
|
4722 |
"/ self image: (Image newForDepth:depth) fromImage:oldImage. |
|
4723 |
"/ ^ self. |
|
4724 |
] |
|
4725 |
]. |
|
4726 |
usageCounts := tmpBits usageCounts. |
|
4727 |
tmpMap := Array new:usageCounts size. |
|
4728 |
oldImage colorMap asArray keysAndValuesDo:[:i :clr | |
|
4729 |
tmpMap at:i put:clr |
|
4730 |
]. |
|
4731 |
usageCounts sort:[:a :b | a > b] with:tmpMap. |
|
4732 |
||
4733 |
1 to:(1 bitShift:depth) do:[:idx | |
|
4734 |
newColorMap at:idx put:(tmpMap at:idx) |
|
4735 |
]. |
|
4736 |
||
4737 |
useNearest := Dialog |
|
4738 |
confirmWithCancel:(resources |
|
4739 |
stringWithCRs:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
|
4740 |
with:usedColors size |
|
4741 |
with:(1 bitShift:depth)) |
|
4742 |
labels:(resources array:#('Cancel' 'First' 'Nearest')). |
|
4743 |
useNearest isNil ifTrue:[ |
|
1124 | 4744 |
colorMapMode value:prevMode. |
1935 | 4745 |
^ self "/ cancel |
4746 |
]. |
|
4747 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4748 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4749 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4750 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4751 |
"/ standard colormap |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4752 |
usedColors := oldImage usedColors. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4753 |
(usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[ |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4754 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4755 |
confirmWithCancel:(resources |
1916 | 4756 |
stringWithCRs:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
4757 |
) |
|
1542 | 4758 |
labels:(resources string:#('Cancel' 'First' 'Nearest')). |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4759 |
useNearest isNil ifTrue:[ |
1542 | 4760 |
colorMapMode value:prevMode. |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4761 |
^ self "/ cancel |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4762 |
]. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
4763 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4764 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4765 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4766 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4767 |
|
2260 | 4768 |
newImage := Image newForDepth:depth. |
1424
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
4769 |
newImage depth:depth. |
2260 | 4770 |
newImage photometric:oldImage photometric. |
4771 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4772 |
oldFileName := oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4773 |
|
1008 | 4774 |
Image imageErrorSignal handle:[:ex| |
4775 |
Color colorErrorSignal handle:[:ex| |
|
1542 | 4776 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4777 |
imageEditView undo. |
1008 | 4778 |
^ self warn:(resources string:'Conversion failed !!') |
4779 |
] do:[ |
|
1393 | 4780 |
newImage := Image newForDepth:depth. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4781 |
newImage width:oldImage width height:oldImage height depth:depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4782 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4783 |
newImage photometric:#palette. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4784 |
newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)). |
2260 | 4785 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4786 |
oldImage colorsFromX:0 y:0 toX:(oldImage width-1) y:(oldImage height-1) do: |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4787 |
[:x :y :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4788 |
|newColor| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4789 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4790 |
(newColorMap includes:clr) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4791 |
ifTrue: [newColor := clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4792 |
ifFalse: [ |
1008 | 4793 |
newColor := clr nearestIn:newColorMap. |
4794 |
useNearest ifFalse:[ |
|
4795 |
(newColor deltaFrom:clr) > 0.5 ifTrue:[ |
|
4796 |
newColor := oldImage colorFromValue:0 |
|
4797 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4798 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4799 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4800 |
newImage colorAtX:x y:y put:newColor. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4801 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4802 |
image := newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4803 |
]. |
1008 | 4804 |
] do:[ |
2260 | 4805 |
image := newImage fromImage:oldImage. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4806 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4807 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
4808 |
(aMode asString startsWith:'mask') ifTrue:[ |
1008 | 4809 |
image mask isNil ifTrue:[ |
1949 | 4810 |
false "(Dialog confirm:'Generate mask from black ?' default:false)" ifTrue:[ |
1008 | 4811 |
maskThreshold := 0.1. |
4812 |
maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). |
|
4813 |
] ifFalse:[ |
|
4814 |
maskImage := Depth1Image extent:image extent. |
|
1770 | 4815 |
maskImage bits:(ByteArray |
1008 | 4816 |
new:(maskImage bytesPerRow * maskImage height) |
4817 |
withAll:16rFF). |
|
4818 |
||
4819 |
"/ maskImage fillRectangle:(image bounds) withColor:(Color colorId:1). |
|
4820 |
]. |
|
4821 |
image mask:maskImage. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4822 |
]. |
1008 | 4823 |
] ifFalse:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4824 |
image mask: nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4825 |
]. |
1935 | 4826 |
|
1937 | 4827 |
(newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[ |
1935 | 4828 |
realColorMap := OrderedCollection new. |
4829 |
image realColorMap do:[:clr| |
|
4830 |
(realColorMap includes: clr) ifFalse: [realColorMap add: clr] |
|
4831 |
]. |
|
4832 |
newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size). |
|
4833 |
newColorMap do:[:clr| |
|
4834 |
((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
|
4835 |
ifTrue:[ |
|
4836 |
newColors add: clr |
|
4837 |
] |
|
4838 |
]. |
|
4839 |
image colorMap: newColors. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4840 |
]. |
1446 | 4841 |
image fileName: oldFileName. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4842 |
|
1054 | 4843 |
(imageEditView image: image) notNil ifTrue:[ |
1446 | 4844 |
self fetchImageData. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4845 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4846 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4847 |
|
2174 | 4848 |
"Modified: / 20-07-2007 / 09:18:59 / cg" |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4849 |
! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4850 |
|
2192 | 4851 |
colorize |
4852 |
"interactive Hue editing" |
|
4853 |
||
4854 |
|bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
|
4855 |
shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema |
|
4856 |
originalPixels p| |
|
4857 |
||
4858 |
"/ compute the averageColor in the background (while asking user) |
|
4859 |
readySema := Semaphore new. |
|
4860 |
[ |
|
4861 |
|image| |
|
4862 |
||
4863 |
image := imageEditView image. |
|
4864 |
originalColormap := image colorMap copy. |
|
4865 |
avgColor := image averageColor. |
|
4866 |
originalPixels := image bits. |
|
4867 |
readySema signal. |
|
4868 |
] forkAt:7. |
|
4869 |
||
4870 |
acceptChannel := TriggerValue new. |
|
4871 |
avgColorHolder := avgColor asValue. |
|
4872 |
||
4873 |
firstChange := true. |
|
4874 |
||
4875 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
|
4876 |
Color |
|
4877 |
hue:((clr hue) ? 0 + hShift) |
|
4878 |
light:((clr light * lFactor / 100) "min:100") |
|
4879 |
saturation:(((clr saturation max:20) * sFactor / 100) "min:100")]. |
|
4880 |
||
4881 |
||
4882 |
shiftAction := |
|
4883 |
[ |
|
4884 |
|hShift lFactor sFactor| |
|
4885 |
||
4886 |
acceptChannel value:true. |
|
4887 |
||
4888 |
firstChange ifTrue:[ |
|
4889 |
imageEditView makeUndo. |
|
4890 |
firstChange := false. |
|
4891 |
]. |
|
4892 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
|
4893 |
||
4894 |
hShift := hueShift value. |
|
4895 |
lFactor := lightValue value. |
|
4896 |
sFactor := saturationValue value. |
|
4897 |
||
4898 |
avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor). |
|
4899 |
||
4900 |
shiftProcess notNil ifTrue:[ |
|
4901 |
shiftProcess terminate. |
|
4902 |
shiftProcess waitUntilTerminated. |
|
4903 |
shiftProcess := nil. |
|
4904 |
]. |
|
4905 |
shiftProcess := |
|
4906 |
[ |
|
4907 |
[ |
|
4908 |
imageEditView image |
|
4909 |
colorMap:originalColormap copy; |
|
4910 |
bits:originalPixels copy; |
|
4911 |
release; |
|
4912 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
|
4913 |
self updateImage. |
|
4914 |
self updateInfoLabel. |
|
4915 |
self updateImagePreView. |
|
4916 |
] ensure:[ shiftProcess := nil ]. |
|
4917 |
] forkAt:7. |
|
4918 |
]. |
|
4919 |
||
4920 |
bindings := IdentityDictionary new. |
|
4921 |
bindings at:#hueShiftAmount put:(hueShift := 0 asValue). |
|
4922 |
hueShift onChangeEvaluate:shiftAction. |
|
4923 |
||
4924 |
bindings at:#lightAmount put:(lightValue := 100 asValue). |
|
4925 |
lightValue onChangeEvaluate:shiftAction. |
|
4926 |
||
4927 |
bindings at:#saturationAmount put:(saturationValue := 100 asValue). |
|
4928 |
saturationValue onChangeEvaluate:shiftAction. |
|
4929 |
||
4930 |
bindings at:#acceptChannel put:acceptChannel. |
|
4931 |
bindings at:#hlsColor put:avgColorHolder. |
|
4932 |
||
4933 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
|
4934 |
ifFalse:[ |
|
4935 |
firstChange ~~ true ifTrue:[ |
|
4936 |
imageEditView undo |
|
4937 |
] |
|
4938 |
]. |
|
4939 |
||
4940 |
(p := shiftProcess) notNil ifTrue:[ |
|
4941 |
p waitUntilTerminated. |
|
4942 |
]. |
|
4943 |
self updateImage. |
|
4944 |
self updateImagePreView. |
|
4945 |
||
4946 |
"Created: / 01-11-2007 / 23:27:37 / cg" |
|
4947 |
! |
|
4948 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4949 |
compressColorMap |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4950 |
"calculates a new color map for the image, using only used colors" |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4951 |
|
927 | 4952 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4953 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4954 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4955 |
depth := oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4956 |
|
1403 | 4957 |
usedColors := oldImage realUsedColors. |
2652 | 4958 |
|
4959 |
"/ translation table |
|
4960 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
4961 |
newColorMap := usedColors asArray. |
|
4962 |
newColorMap sort:self sortBlockForColors. |
|
2718 | 4963 |
oldImage colorMap notNil ifTrue:[ |
4964 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
4965 |
|newPixel| |
|
4966 |
||
4967 |
(usedColors includes:clr) ifTrue:[ |
|
4968 |
newPixel := newColorMap indexOf:clr. |
|
4969 |
oldToNew at:oldIdx put:newPixel-1. |
|
4970 |
] |
|
4971 |
]. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4972 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4973 |
|
2652 | 4974 |
oldBits := oldImage bits. |
4975 |
newBits := ByteArray new:(oldBits size). |
|
4976 |
depth ~~ 8 ifTrue:[ |
|
4977 |
"/ expand/compress can only handle 8bits |
|
4978 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
4979 |
oldBits |
|
4980 |
expandPixels:depth |
|
4981 |
width:oldImage width |
|
4982 |
height:oldImage height |
|
4983 |
into:tmpBits |
|
4984 |
mapping:oldToNew. |
|
4985 |
tmpBits |
|
4986 |
compressPixels:depth |
|
4987 |
width:oldImage width |
|
4988 |
height:oldImage height |
|
4989 |
into:newBits |
|
4990 |
mapping:nil |
|
4991 |
] ifFalse:[ |
|
4992 |
oldBits |
|
4993 |
expandPixels:depth |
|
4994 |
width:oldImage width |
|
4995 |
height:oldImage height |
|
4996 |
into:newBits |
|
4997 |
mapping:oldToNew. |
|
4998 |
]. |
|
4999 |
||
5000 |
newImage := oldImage species new |
|
5001 |
width:oldImage width |
|
5002 |
height:oldImage height |
|
5003 |
depth:depth |
|
5004 |
fromArray:newBits. |
|
5005 |
||
5006 |
newImage colorMap:newColorMap. |
|
5007 |
newImage fileName:oldImage fileName. |
|
5008 |
newImage mask:(oldImage mask copy). |
|
5009 |
||
5010 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
5011 |
self fetchImageData. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
5012 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
5013 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
5014 |
"Created: / 28.7.1998 / 20:03:11 / cg" |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
5015 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
1008 | 5016 |
! |
5017 |
||
1852 | 5018 |
copyColorFromColormap |
1871 | 5019 |
imageEditView setClipboardObject:(self selectedColorOrNil) |
1852 | 5020 |
! |
5021 |
||
2054 | 5022 |
ditherToDepth |
5023 |
|depth| |
|
5024 |
||
5025 |
depth := Dialog request:'New depth ?'. |
|
5026 |
depth isEmptyOrNil ifTrue:[^ self]. |
|
5027 |
depth := Number readFrom:depth onError:nil. |
|
5028 |
depth isNil ifTrue:[^ self]. |
|
5029 |
||
5030 |
self ditherToDepth:depth |
|
5031 |
||
5032 |
"Created: / 07-07-2006 / 13:22:10 / cg" |
|
5033 |
! |
|
5034 |
||
5035 |
ditherToDepth:depth |
|
2576
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5036 |
|ditherColors newImage useStandardColors nGrey greyColorsAlready additionalGreyColors moreColors d| |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5037 |
|
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5038 |
useStandardColors := true. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5039 |
"/ useStandardColors := Dialog confirmWithCancel:'Dither in standard colors or use a new (optimized) colormap ?'. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5040 |
"/ useStandardColors isNil ifTrue:[^ self]. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5041 |
|
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5042 |
useStandardColors ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5043 |
depth = 1 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5044 |
ditherColors := Array with:(Color black) with:(Color white). |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5045 |
] ifFalse:[ depth = 2 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5046 |
ditherColors := Array |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5047 |
with:(Color black) |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5048 |
with:(Color darkGrey) |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5049 |
with:(Color lightGrey) |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5050 |
with:(Color white). |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5051 |
] ifFalse:[ depth = 3 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5052 |
ditherColors := Color colorCubeWithRed:2 green:2 blue:2. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5053 |
] ifFalse:[ depth = 4 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5054 |
ditherColors := Color vgaColors. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5055 |
] ifFalse:[ depth = 5 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5056 |
ditherColors := Color colorCubeWithRed:4 green:4 blue:2. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5057 |
] ifFalse:[ depth = 6 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5058 |
ditherColors := Color colorCubeWithRed:4 green:4 blue:3. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5059 |
] ifFalse:[ depth <= 8 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5060 |
ditherColors := Color colorCubeWithRed:6 green:6 blue:5. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5061 |
] ifFalse:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5062 |
self error:'unsupported depth'. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5063 |
]]]]]]]. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5064 |
|
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5065 |
nGrey := (2 raisedTo:depth) - ditherColors size. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5066 |
nGrey > 0 ifTrue:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5067 |
nGrey := nGrey min:128. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5068 |
greyColorsAlready := ditherColors select:[:clr | clr isGreyColor]. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5069 |
d := 1 / nGrey. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5070 |
moreColors := (1 to:nGrey-1) |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5071 |
collect:[:i | Color brightness:(d * i)] |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5072 |
thenReject:[:clr | greyColorsAlready includes:clr ]. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5073 |
|
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5074 |
ditherColors := ditherColors , moreColors. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5075 |
]. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5076 |
] ifFalse:[ |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5077 |
self halt. |
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5078 |
]. |
2054 | 5079 |
|
5080 |
self withExecuteCursorDo:[ |
|
2576
9e8d63aadb11
more grey values used when dithering
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
5081 |
"/ newImage := self image asDitheredImageUsing:ditherColors depth:depth. |
2054 | 5082 |
newImage := self image asDitheredImageUsing:ditherColors depth:8. |
5083 |
||
5084 |
imageEditView makeUndo. |
|
5085 |
imageEditView image:newImage. |
|
5086 |
imageEditView setModified. |
|
5087 |
self updateImage. |
|
5088 |
self updateImagePreView. |
|
5089 |
||
5090 |
self fetchImageData. |
|
5091 |
]. |
|
5092 |
||
5093 |
"Created: / 07-07-2006 / 13:20:56 / cg" |
|
2073 | 5094 |
"Modified: / 05-09-2006 / 16:13:25 / cg" |
2054 | 5095 |
! |
5096 |
||
2174 | 5097 |
doubleClickOnColor:aColorIndex |
5098 |
self editSelectedColor. |
|
5099 |
||
5100 |
"Created: / 22-07-2007 / 13:14:37 / cg" |
|
5101 |
! |
|
5102 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5103 |
editSelectedColor |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5104 |
self processSelectedColorWith:[:clr | |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5105 |
|editor| |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5106 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5107 |
editor := ColorEditDialog new. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5108 |
editor color:clr. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5109 |
editor open. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5110 |
editor accepted ifFalse:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5111 |
AbortOperationRequest raise. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5112 |
]. |
2575
43e98f6d71d2
ColorEditDialog was grazy - adapted to changed protocol
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5113 |
editor colorNameOrColor |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5114 |
] |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5115 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5116 |
|
1446 | 5117 |
fetchImageData |
1460 | 5118 |
|image| |
5119 |
||
5120 |
(image := imageEditView image) notNil ifTrue:[ |
|
5121 |
self findColorMapMode. |
|
5122 |
self updateLabelsAndHistory. |
|
5123 |
] |
|
1446 | 5124 |
! |
5125 |
||
1544 | 5126 |
inspectColor |
2573 | 5127 |
|clrIndex clr| |
5128 |
||
5129 |
self hasColormap ifFalse:[ |
|
5130 |
clr := self selectedColorOrNil |
|
5131 |
] ifTrue:[ |
|
5132 |
clrIndex := self selectedColorIndexOrNil. |
|
5133 |
clrIndex isNil ifTrue:[ |
|
5134 |
^ self |
|
5135 |
]. |
|
5136 |
clr := self image colorFromValue:clrIndex-1 |
|
1544 | 5137 |
]. |
2573 | 5138 |
clr inspect |
1544 | 5139 |
! |
5140 |
||
2651 | 5141 |
inspectColormap |
5142 |
self hasColormap ifTrue:[ |
|
5143 |
self image colorMap inspect |
|
5144 |
]. |
|
5145 |
! |
|
5146 |
||
1598 | 5147 |
makeBrighter |
5148 |
| anyChange| |
|
5149 |
||
5150 |
self withExecuteCursorDo:[ |
|
5151 |
anyChange := imageEditView makeBrighter. |
|
5152 |
anyChange ifFalse:[ |
|
5153 |
Dialog warn:'Image unchanged'. |
|
5154 |
] ifTrue:[ |
|
5155 |
self updateImage. |
|
5156 |
] |
|
5157 |
]. |
|
5158 |
! |
|
5159 |
||
5160 |
makeDarker |
|
5161 |
| anyChange| |
|
5162 |
||
5163 |
self withExecuteCursorDo:[ |
|
5164 |
anyChange := imageEditView makeDarker. |
|
5165 |
anyChange ifFalse:[ |
|
5166 |
Dialog warn:'Image unchanged'. |
|
5167 |
] ifTrue:[ |
|
5168 |
self updateImage. |
|
5169 |
] |
|
5170 |
]. |
|
5171 |
! |
|
5172 |
||
1926 | 5173 |
makeGrayScaleImage |
1598 | 5174 |
|anyChange| |
1436 | 5175 |
|
5176 |
self withExecuteCursorDo:[ |
|
1926 | 5177 |
anyChange := imageEditView makeGrayScaleImage. |
1436 | 5178 |
anyChange ifFalse:[ |
5179 |
Dialog warn:'Image unchanged'. |
|
5180 |
] ifTrue:[ |
|
1598 | 5181 |
self updateImage. |
5182 |
] |
|
5183 |
]. |
|
5184 |
! |
|
5185 |
||
5186 |
makeInverse |
|
5187 |
| anyChange| |
|
5188 |
||
5189 |
self withExecuteCursorDo:[ |
|
5190 |
anyChange := imageEditView makeInverse. |
|
5191 |
anyChange ifFalse:[ |
|
5192 |
Dialog warn:'Image unchanged'. |
|
5193 |
] ifTrue:[ |
|
5194 |
self updateImage. |
|
1436 | 5195 |
] |
5196 |
]. |
|
5197 |
! |
|
5198 |
||
1446 | 5199 |
makeSelectedColorBrighter |
1682 | 5200 |
self processSelectedColorWith:[:clr | clr lightened] |
1446 | 5201 |
! |
5202 |
||
5203 |
makeSelectedColorDarker |
|
1682 | 5204 |
self processSelectedColorWith:[:clr | clr darkened] |
1446 | 5205 |
! |
5206 |
||
1884 | 5207 |
makeSelectedColorGray |
5208 |
self processSelectedColorWith:[:clr | Color brightness:(clr brightness)] |
|
5209 |
! |
|
5210 |
||
2826 | 5211 |
makeSlightlyBrighter |
5212 |
| anyChange| |
|
5213 |
||
5214 |
self withExecuteCursorDo:[ |
|
5215 |
anyChange := imageEditView makeSlightlyBrighter. |
|
5216 |
anyChange ifFalse:[ |
|
5217 |
Dialog warn:'Image unchanged'. |
|
5218 |
] ifTrue:[ |
|
5219 |
self updateImage. |
|
5220 |
] |
|
5221 |
]. |
|
5222 |
||
5223 |
"Created: / 24-11-2010 / 11:06:11 / cg" |
|
5224 |
! |
|
5225 |
||
5226 |
makeSlightlyDarker |
|
5227 |
| anyChange| |
|
5228 |
||
5229 |
self withExecuteCursorDo:[ |
|
5230 |
anyChange := imageEditView makeSlightlyDarker. |
|
5231 |
anyChange ifFalse:[ |
|
5232 |
Dialog warn:'Image unchanged'. |
|
5233 |
] ifTrue:[ |
|
5234 |
self updateImage. |
|
5235 |
] |
|
5236 |
]. |
|
5237 |
||
5238 |
"Created: / 24-11-2010 / 11:06:23 / cg" |
|
5239 |
! |
|
5240 |
||
2652 | 5241 |
menu_clearColormapEntry0AndMaskedPixels |
5242 |
"ensure that there is a colorMap entry with 0/0/0 at position |
|
5243 |
0 and then clear all masked pixels (to pixelValue 0)" |
|
5244 |
||
5245 |
imageEditView makeUndo. |
|
5246 |
self withExecuteCursorDo:[ |
|
5247 |
self clearColormapEntry0AndMaskedPixels |
|
5248 |
] |
|
5249 |
! |
|
5250 |
||
5251 |
menu_clearMaskedPixels |
|
5252 |
"clear all masked pixels (to pixelValue 0)" |
|
5253 |
||
5254 |
imageEditView makeUndo. |
|
5255 |
||
5256 |
self withExecuteCursorDo:[ |
|
5257 |
self clearMaskedPixels |
|
5258 |
] |
|
5259 |
! |
|
5260 |
||
5261 |
menu_compressColorMap |
|
5262 |
"calculates a new color map for the image, using only used colors" |
|
5263 |
||
5264 |
|depth oldImage usedColors| |
|
5265 |
||
5266 |
oldImage := self image. |
|
5267 |
depth := oldImage depth. |
|
5268 |
||
5269 |
oldImage photometric ~~ #palette ifTrue:[ |
|
5270 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
1852 | 5271 |
^ self |
5272 |
]. |
|
2652 | 5273 |
usedColors := oldImage realUsedColors. |
5274 |
usedColors size == (1 bitShift:depth) ifTrue:[ |
|
5275 |
self information:'Compress colorMap: All colors are used - no compression.'. |
|
5276 |
^ self |
|
5277 |
]. |
|
5278 |
usedColors size == oldImage colorMap size ifTrue:[ |
|
5279 |
self information:'Compress colorMap: Colormap already compressed - no compression.'. |
|
5280 |
^ self |
|
5281 |
]. |
|
5282 |
||
5283 |
imageEditView makeUndo. |
|
5284 |
||
5285 |
self withExecuteCursorDo:[ |
|
5286 |
self compressColorMap |
|
1852 | 5287 |
] |
5288 |
! |
|
5289 |
||
2652 | 5290 |
menu_copyMask |
5291 |
|mask| |
|
5292 |
||
5293 |
mask := self image mask. |
|
5294 |
MaskClipboard := mask subImageIn: (0@0 extent:mask extent). |
|
5295 |
! |
|
5296 |
||
5297 |
menu_pasteMask |
|
1480 | 5298 |
|img mask| |
5299 |
||
5300 |
imageEditView makeUndo. |
|
5301 |
||
5302 |
img := self image. |
|
5303 |
mask := img mask. |
|
5304 |
||
5305 |
mask |
|
5306 |
copyFrom:MaskClipboard |
|
5307 |
x:0 y:0 |
|
5308 |
toX:0 y:0 |
|
5309 |
width:(mask width min:MaskClipboard width) |
|
5310 |
height:(mask height min:MaskClipboard height). |
|
5311 |
img mask:mask. |
|
5312 |
(imageEditView image:img copy) notNil ifTrue:[ |
|
5313 |
self fetchImageData. |
|
5314 |
] |
|
5315 |
! |
|
5316 |
||
2652 | 5317 |
menu_sortColorMap |
5318 |
"calculates a new color map for the image, sorting colors" |
|
5319 |
||
5320 |
self menu_sortColorMapWith:self sortBlockForColors |
|
5321 |
! |
|
5322 |
||
5323 |
menu_sortColorMapWith:sortBlock |
|
5324 |
"calculates a new color map for the image, sorting colors" |
|
5325 |
||
5326 |
self image photometric ~~ #palette ifTrue:[ |
|
5327 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
5328 |
^ self |
|
5329 |
]. |
|
5330 |
||
5331 |
imageEditView makeUndo. |
|
5332 |
||
5333 |
self withExecuteCursorDo:[ |
|
5334 |
self sortColorMapWith:sortBlock |
|
5335 |
] |
|
5336 |
||
5337 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
|
5338 |
"Created: / 30.9.1998 / 23:51:23 / cg" |
|
5339 |
! |
|
5340 |
||
5341 |
pasteColorIntoColormap |
|
5342 |
|copyBufferColor| |
|
5343 |
||
5344 |
copyBufferColor := imageEditView getClipboardObject. |
|
5345 |
copyBufferColor isColor ifFalse:[ |
|
5346 |
UserPreferences current beepInEditor ifTrue:[ |
|
5347 |
self window beep. |
|
5348 |
]. |
|
5349 |
^ self |
|
5350 |
]. |
|
5351 |
||
5352 |
self processSelectedColorWith:[:clr | |
|
5353 |
copyBufferColor |
|
5354 |
] |
|
5355 |
! |
|
5356 |
||
1682 | 5357 |
pickAndAddColorToColormap |
5358 |
self addColorToColormap:(Color fromUser) |
|
5359 |
! |
|
5360 |
||
1933 | 5361 |
pickAndPasteColor |
5362 |
self pickColor. |
|
5363 |
self pasteColorIntoColormap. |
|
5364 |
! |
|
5365 |
||
1852 | 5366 |
pickColor |
1871 | 5367 |
imageEditView setClipboardObject:(Color fromUser) |
1852 | 5368 |
! |
5369 |
||
1682 | 5370 |
processSelectedColorWith:aBlock |
1852 | 5371 |
"undoable color processing: the selected color will be replaced by the |
5372 |
value of aBlock" |
|
5373 |
||
5374 |
|img cMap modifiedColormap oldColor newImage selectedColorIndex oldSelection newColor| |
|
1682 | 5375 |
|
5376 |
selectedColorIndex := self selectedColorIndexOrNil. |
|
5377 |
selectedColorIndex isNil ifTrue:[^ self]. |
|
5378 |
||
5379 |
img := self image. |
|
5380 |
cMap := img colorMap. |
|
5381 |
cMap isNil ifTrue:[ |
|
1916 | 5382 |
self warn:(resources stringWithCRs:'Image has no colormap.\Please change the colorMap mode first.'). |
1682 | 5383 |
^ self |
5384 |
]. |
|
1852 | 5385 |
|
5386 |
oldColor := cMap at:selectedColorIndex. |
|
1682 | 5387 |
imageEditView makeUndo. |
5388 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5389 |
modifiedColormap := cMap asArray copy. |
1852 | 5390 |
|
5391 |
newColor := aBlock value:oldColor. |
|
1859 | 5392 |
modifiedColormap at:selectedColorIndex put:newColor. |
1682 | 5393 |
|
5394 |
newImage := img species new |
|
5395 |
width:img width |
|
5396 |
height:img height |
|
1843 | 5397 |
depth:img depth |
1682 | 5398 |
fromArray:img bits. |
5399 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5400 |
newImage colorMap:modifiedColormap. |
1682 | 5401 |
newImage fileName:img fileName. |
5402 |
newImage mask:(img mask copy). |
|
5403 |
||
5404 |
oldSelection := self selectionOfColor value. |
|
5405 |
||
5406 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
5407 |
self fetchImageData. |
|
5408 |
]. |
|
5409 |
self selectionOfColor value:oldSelection. |
|
5410 |
||
5411 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
|
5412 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
|
5413 |
! |
|
5414 |
||
1124 | 5415 |
reduceNumberOfColors |
1727
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5416 |
|s n anyChange img usedColors| |
1124 | 5417 |
|
2817 | 5418 |
s := Dialog request:'Number of color bits to strip (1-7) ?' initialAnswer:3. |
1435 | 5419 |
s size == 0 ifTrue:[^ self]. |
1934 | 5420 |
|
1124 | 5421 |
n := Integer readFrom:s onError:0. |
5422 |
(n between:1 and:7) ifFalse:[ |
|
5423 |
Dialog warn:'Image unchanged'. |
|
5424 |
^ self |
|
5425 |
]. |
|
5426 |
||
5427 |
self withExecuteCursorDo:[ |
|
5428 |
anyChange := imageEditView reduceColorResolutionBy:n. |
|
5429 |
anyChange ifFalse:[ |
|
5430 |
Dialog warn:'Image unchanged'. |
|
5431 |
] ifTrue:[ |
|
5432 |
img := imageEditView image. |
|
5433 |
imageEditView image:img. |
|
1446 | 5434 |
|
5435 |
self fetchImageData. |
|
1727
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5436 |
usedColors := img usedColorsMax:10000. |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5437 |
usedColors size == 10000 ifTrue:[ |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5438 |
Dialog information:('>= ' , usedColors size printString , ' colors used.') |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5439 |
] ifFalse:[ |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5440 |
Dialog information:(usedColors size printString , ' colors used.') |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
5441 |
] |
1124 | 5442 |
] |
5443 |
]. |
|
2817 | 5444 |
|
5445 |
"Modified: / 29-10-2010 / 18:08:01 / cg" |
|
1124 | 5446 |
! |
5447 |
||
1930 | 5448 |
reduceNumberOfColors2 |
1938 | 5449 |
|s rndR rndG rndB usedColors image newImage| |
5450 |
||
5451 |
s := Dialog request:'Rounding Interval red (2..) ?' initialAnswer:4. |
|
1934 | 5452 |
s size == 0 ifTrue:[^ self]. |
1938 | 5453 |
rndR := Integer readFrom:s onError:0. |
1939 | 5454 |
|
1938 | 5455 |
s := Dialog request:'Rounding Interval green (2..) ?' initialAnswer:2. |
5456 |
s size == 0 ifTrue:[^ self]. |
|
5457 |
rndG := Integer readFrom:s onError:0. |
|
1939 | 5458 |
|
1938 | 5459 |
s := Dialog request:'Rounding Interval blue (2..) ?' initialAnswer:10. |
5460 |
s size == 0 ifTrue:[^ self]. |
|
5461 |
rndB := Integer readFrom:s onError:0. |
|
1939 | 5462 |
|
5463 |
((rndR > 1) or:[(rndG > 1) or:[(rndB > 1)]]) ifFalse:[ |
|
1930 | 5464 |
Dialog warn:'Image unchanged'. |
5465 |
^ self |
|
5466 |
]. |
|
5467 |
||
5468 |
self withExecuteCursorDo:[ |
|
1934 | 5469 |
image := self image. |
2054 | 5470 |
"/ usedColors := image usedColorsMax:4096. |
1934 | 5471 |
imageEditView makeUndo. |
5472 |
||
5473 |
newImage := image copy. |
|
2260 | 5474 |
newImage photometric == #palette ifTrue:[ |
5475 |
newImage colorMap:(OrderedCollection new). |
|
5476 |
]. |
|
5477 |
||
1934 | 5478 |
image |
5479 |
colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) |
|
5480 |
do:[:x :y :clr | |
|
5481 |
|r g b nr ng nb newClr| |
|
5482 |
||
5483 |
r := clr redByte. |
|
5484 |
g := clr greenByte. |
|
5485 |
b := clr blueByte. |
|
1938 | 5486 |
nr := (r roundTo:rndR) min:255. |
5487 |
ng := (g roundTo:rndG) min:255. |
|
5488 |
nb := (b roundTo:rndB) min:255. |
|
1934 | 5489 |
|
5490 |
newClr := Color redByte:nr greenByte:ng blueByte:nb. |
|
2260 | 5491 |
newImage photometric == #palette ifTrue:[ |
5492 |
(newImage colorMap includes:newClr) ifFalse:[ |
|
5493 |
newImage colorMap add:newClr |
|
5494 |
]. |
|
5495 |
]. |
|
1934 | 5496 |
newImage colorAtX:x y:y put:newClr |
5497 |
]. |
|
5498 |
||
5499 |
imageEditView image:newImage. |
|
5500 |
imageEditView setModified. |
|
5501 |
self updateImage. |
|
5502 |
self updateImagePreView. |
|
5503 |
||
5504 |
self fetchImageData. |
|
5505 |
usedColors := newImage usedColorsMax:10000. |
|
5506 |
usedColors size == 10000 ifTrue:[ |
|
5507 |
Dialog information:('>= ' , usedColors size printString , ' colors used.') |
|
5508 |
] ifFalse:[ |
|
5509 |
Dialog information:(usedColors size printString , ' colors used.') |
|
5510 |
] |
|
1930 | 5511 |
]. |
2054 | 5512 |
|
5513 |
"Modified: / 07-07-2006 / 13:10:42 / cg" |
|
1930 | 5514 |
! |
5515 |
||
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5516 |
selectColor:aColor |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5517 |
|idx img cMap| |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5518 |
|
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5519 |
aColor isNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5520 |
idx := nil. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5521 |
] ifFalse:[ |
2791 | 5522 |
img := self image. |
5523 |
img notNil ifTrue: [ |
|
5524 |
aColor == Color noColor ifTrue:[ |
|
5525 |
(img mask notNil) ifTrue:[ |
|
5526 |
idx := 1. |
|
5527 |
] |
|
5528 |
] ifFalse:[ |
|
2447 | 5529 |
(cMap := self listOfColors) notNil ifTrue:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5530 |
idx := cMap indexOf:aColor ifAbsent:nil. |
2447 | 5531 |
]. |
5532 |
idx isNil ifTrue:[ |
|
5533 |
"/ should not happen... |
|
5534 |
(cMap := img colorMap) notNil ifTrue:[ |
|
5535 |
idx := cMap indexOf:aColor ifAbsent:nil. |
|
5536 |
idx notNil ifTrue:[ |
|
5537 |
img mask notNil ifTrue:[ |
|
5538 |
idx := idx + 1. |
|
5539 |
]. |
|
5540 |
] |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5541 |
]. |
2447 | 5542 |
]. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5543 |
]. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5544 |
]. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5545 |
]. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5546 |
self selectionOfColor value:idx. |
2790 | 5547 |
|
2791 | 5548 |
"Modified: / 02-07-2010 / 12:06:07 / cg" |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5549 |
! |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5550 |
|
1682 | 5551 |
selectedColorIndexOrNil |
2651 | 5552 |
|img clrIndex| |
1682 | 5553 |
|
5554 |
img := self image. |
|
5555 |
img isNil ifTrue:[ |
|
2764 | 5556 |
"/ self warn:'No Image.'. |
1682 | 5557 |
^ nil |
5558 |
]. |
|
5559 |
clrIndex := self selectionOfColor value. |
|
1896 | 5560 |
self hasMask "img mask notNil" ifTrue: [ |
2449
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
5561 |
(clrIndex isInteger and:[clrIndex > 1]) ifTrue:[ |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
5562 |
^ clrIndex - 1 |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
5563 |
]. |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
5564 |
^ nil |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5565 |
]. |
1682 | 5566 |
^ clrIndex |
5567 |
! |
|
5568 |
||
1852 | 5569 |
selectedColorOrNil |
2447 | 5570 |
|cmapIndex img cMap colorList| |
1896 | 5571 |
|
5572 |
cmapIndex := self selectedColorIndexOrNil. |
|
1900 | 5573 |
cmapIndex isNil ifTrue:[^ nil]. |
2556 | 5574 |
cmapIndex == 0 ifTrue:[^ nil]. |
1852 | 5575 |
|
5576 |
img := self image. |
|
5577 |
cMap := img colorMap. |
|
5578 |
cMap isNil ifTrue:[ |
|
2447 | 5579 |
"/ self warn:(resources stringWithCRs:'Image has no colormap.\Please change the colorMap mode first.'). |
5580 |
colorList := self listOfColors. |
|
5581 |
colorList notNil ifTrue:[ |
|
5582 |
^ colorList at:cmapIndex ifAbsent:nil |
|
5583 |
]. |
|
1900 | 5584 |
^ nil |
1852 | 5585 |
]. |
1896 | 5586 |
^ cMap at:cmapIndex. |
1852 | 5587 |
! |
5588 |
||
1008 | 5589 |
sortColorMap |
5590 |
"calculates a new color map for the image, sorting colors" |
|
5591 |
||
2652 | 5592 |
self sortColorMapWith:self sortBlockForColors |
1939 | 5593 |
! |
5594 |
||
5595 |
sortColorMapWith:sortBlock |
|
5596 |
"calculates a new color map for the image, sorting colors" |
|
5597 |
||
1008 | 5598 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
5599 |
||
5600 |
oldImage := self image. |
|
5601 |
depth := oldImage depth. |
|
5602 |
||
2652 | 5603 |
usedColors := oldImage realColorMap. |
5604 |
||
5605 |
||
5606 |
"/ translation table |
|
5607 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
5608 |
newColorMap := usedColors asArray. |
|
5609 |
newColorMap sort:sortBlock. |
|
5610 |
||
5611 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
5612 |
|newPixel| |
|
5613 |
||
5614 |
(usedColors includes:clr) ifTrue:[ |
|
5615 |
newPixel := newColorMap indexOf:clr. |
|
5616 |
oldToNew at:oldIdx put:newPixel-1. |
|
5617 |
] |
|
1008 | 5618 |
]. |
5619 |
||
2652 | 5620 |
oldBits := oldImage bits. |
5621 |
newBits := ByteArray new:(oldBits size). |
|
5622 |
depth ~~ 8 ifTrue:[ |
|
5623 |
"/ expand/compress can only handle 8bits |
|
5624 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
5625 |
oldBits |
|
5626 |
expandPixels:depth |
|
5627 |
width:oldImage width |
|
5628 |
height:oldImage height |
|
5629 |
into:tmpBits |
|
5630 |
mapping:oldToNew. |
|
5631 |
tmpBits |
|
5632 |
compressPixels:depth |
|
5633 |
width:oldImage width |
|
5634 |
height:oldImage height |
|
5635 |
into:newBits |
|
5636 |
mapping:nil |
|
5637 |
] ifFalse:[ |
|
5638 |
oldBits |
|
5639 |
expandPixels:depth |
|
5640 |
width:oldImage width |
|
5641 |
height:oldImage height |
|
5642 |
into:newBits |
|
5643 |
mapping:oldToNew. |
|
5644 |
]. |
|
5645 |
||
5646 |
newImage := oldImage species new |
|
5647 |
width:oldImage width |
|
5648 |
height:oldImage height |
|
5649 |
depth:depth |
|
5650 |
fromArray:newBits. |
|
5651 |
||
5652 |
newImage colorMap:newColorMap. |
|
5653 |
newImage fileName:oldImage fileName. |
|
5654 |
newImage mask:(oldImage mask copy). |
|
5655 |
||
5656 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
5657 |
self fetchImageData. |
|
1008 | 5658 |
] |
5659 |
||
5660 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
|
5661 |
"Created: / 30.9.1998 / 23:51:23 / cg" |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
5662 |
! ! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
5663 |
|
1715 | 5664 |
!ImageEditor methodsFor:'user actions-editing'! |
400 | 5665 |
|
2354
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5666 |
do3DProjection |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5667 |
|box dx1 dx2 image| |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5668 |
|
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5669 |
image := imageEditView image. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5670 |
|
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5671 |
box := EnterBox new. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5672 |
box title:(resources string:'dX1 (0 < dx < 0.5):'). |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5673 |
box okText:(resources string:'OK'). |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5674 |
box abortText:(resources string:'Cancel'). |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5675 |
box initialText:'0.1'. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5676 |
box showAtPointer. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5677 |
|
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5678 |
(box accepted |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5679 |
and: [(dx1 := Number readFrom:(box contents) onError:nil) notNil]) |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5680 |
ifTrue:[ |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5681 |
box title:(resources string:'dX2 (0 < dx < 0.5):'). |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5682 |
box initialText:(dx1 printString). |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5683 |
box showAtPointer. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5684 |
(box accepted |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5685 |
and: [(dx2 := Number readFrom:(box contents) onError:nil) notNil]) |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5686 |
ifTrue:[ |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5687 |
imageEditView threeDProjection:dx1 and:dx2. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5688 |
] |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5689 |
]. |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5690 |
|
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5691 |
self updateInfoLabel |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5692 |
! |
15be12f5e320
3d projection (first attempt)
Claus Gittinger <cg@exept.de>
parents:
2339
diff
changeset
|
5693 |
|
1882 | 5694 |
doBrightenImage |
5695 |
imageEditView brightenImage. |
|
5696 |
self listOfColors removeAll. |
|
5697 |
self findColorMapMode. |
|
2585 | 5698 |
"/ imageEditView removelastUndo |
1882 | 5699 |
! |
5700 |
||
767 | 5701 |
doBrowseClass |
5702 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
400 | 5703 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5704 |
|cls| |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5705 |
|
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
5706 |
cls := imageEditView resourceClass. |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5707 |
cls isNil ifTrue:[^ self warn:'No Class specified']. |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
5708 |
|
1488 | 5709 |
UserPreferences systemBrowserClass |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5710 |
openInClass:cls class |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5711 |
selector:(imageEditView resourceSelector) |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5712 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
5713 |
"Modified: / 31.7.1998 / 02:01:15 / cg" |
400 | 5714 |
! |
5715 |
||
1703 | 5716 |
doCopyImageToClipboard |
5717 |
imageEditView copyImageToClipboard. |
|
5718 |
! |
|
5719 |
||
1045 | 5720 |
doCropAll |
986 | 5721 |
"find all borders and cut them off" |
5722 |
||
1045 | 5723 |
imageEditView cropLeft:true right:true top:true bottom:true. |
986 | 5724 |
self updateInfoLabel |
5725 |
||
5726 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
5727 |
"Created: / 7.9.1998 / 16:33:43 / cg" |
|
5728 |
! |
|
5729 |
||
1045 | 5730 |
doCropBottom |
986 | 5731 |
"find a bottom border and cut it off" |
5732 |
||
1045 | 5733 |
imageEditView cropLeft:false right:false top:false bottom:true. |
986 | 5734 |
self updateInfoLabel |
5735 |
||
5736 |
"Created: / 7.9.1998 / 13:00:20 / cg" |
|
5737 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
5738 |
! |
|
5739 |
||
1045 | 5740 |
doCropLeft |
986 | 5741 |
"find a left border and cut it off" |
5742 |
||
1045 | 5743 |
imageEditView cropLeft:true right:false top:false bottom:false. |
986 | 5744 |
self updateInfoLabel |
5745 |
||
5746 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
5747 |
"Modified: / 7.9.1998 / 14:26:34 / cg" |
|
5748 |
! |
|
5749 |
||
1045 | 5750 |
doCropManual |
986 | 5751 |
"let user specify borders and cut them off" |
5752 |
||
1502 | 5753 |
|bindings left top right bottom img firstChange gropAction acceptChannel| |
5754 |
||
5755 |
acceptChannel := TriggerValue new. |
|
1490 | 5756 |
|
5757 |
firstChange := true. |
|
5758 |
||
1502 | 5759 |
gropAction := |
5760 |
[:lV :rV :tV :bV | |l r t b| |
|
5761 |
acceptChannel value:true. |
|
5762 |
||
5763 |
l := lV value. |
|
5764 |
r := rV value. |
|
5765 |
t := tV value. |
|
5766 |
b := bV value. |
|
5767 |
(l + r + t + b) == 0 ifTrue:[ |
|
2520 | 5768 |
UserPreferences current beepInEditor ifTrue:[ |
5769 |
self window beep |
|
5770 |
] |
|
1502 | 5771 |
] ifFalse:[ |
5772 |
img := imageEditView image. |
|
5773 |
firstChange ifTrue:[ |
|
5774 |
imageEditView makeUndo. |
|
5775 |
firstChange := false. |
|
5776 |
]. |
|
5777 |
imageEditView |
|
5778 |
makeSubImageX:l y:t |
|
5779 |
width:(img width - l - r) |
|
5780 |
height:(img height - t - b). |
|
2546 | 5781 |
|
5782 |
self updateImagePreView. |
|
1502 | 5783 |
self updateInfoLabel |
5784 |
]. |
|
1490 | 5785 |
]. |
986 | 5786 |
|
5787 |
bindings := IdentityDictionary new. |
|
1507 | 5788 |
bindings at:#left put:(left := 1 asValue). |
5789 |
bindings at:#right put:(right := 1 asValue). |
|
5790 |
bindings at:#top put:(top := 1 asValue). |
|
5791 |
bindings at:#bottom put:(bottom := 1 asValue). |
|
1502 | 5792 |
bindings at:#acceptChannel put:acceptChannel. |
5793 |
||
5794 |
bindings at:#gropLeftNow put:[ gropAction value:left value:0 value:0 value:0 ]. |
|
5795 |
bindings at:#gropRightNow put:[ gropAction value:0 value:right value:0 value:0 ]. |
|
5796 |
bindings at:#gropTopNow put:[ gropAction value:0 value:0 value:top value:0 ]. |
|
5797 |
bindings at:#gropBottomNow put:[ gropAction value:0 value:0 value:0 value:bottom ]. |
|
5798 |
||
5799 |
bindings at:#applyAction put:[ gropAction value:left value:right value:top value:bottom ]. |
|
1490 | 5800 |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
5801 |
(self openDialogInterface:#cropDialogSpec withBindings:bindings) |
1507 | 5802 |
ifFalse:[ |
5803 |
firstChange ~~ true ifTrue:[ |
|
1558 | 5804 |
imageEditView undo. |
5805 |
self updateImagePreView. |
|
1507 | 5806 |
] |
5807 |
]. |
|
986 | 5808 |
|
5809 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
5810 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
5811 |
! |
|
5812 |
||
1045 | 5813 |
doCropRight |
986 | 5814 |
"find a right border and cut it off" |
5815 |
||
1045 | 5816 |
imageEditView cropLeft:false right:true top:false bottom:false. |
986 | 5817 |
self updateInfoLabel |
5818 |
||
5819 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
5820 |
"Modified: / 7.9.1998 / 14:26:44 / cg" |
|
5821 |
! |
|
5822 |
||
1045 | 5823 |
doCropTop |
986 | 5824 |
"find a top border and cut it off" |
5825 |
||
1045 | 5826 |
imageEditView cropLeft:false right:false top:true bottom:false. |
986 | 5827 |
self updateInfoLabel |
5828 |
||
5829 |
"Created: / 7.9.1998 / 13:00:19 / cg" |
|
5830 |
"Modified: / 7.9.1998 / 14:26:52 / cg" |
|
5831 |
! |
|
5832 |
||
1882 | 5833 |
doDarkenImage |
5834 |
imageEditView darkenImage. |
|
5835 |
self listOfColors removeAll. |
|
5836 |
self findColorMapMode. |
|
2585 | 5837 |
"/ imageEditView removelastUndo |
1882 | 5838 |
! |
5839 |
||
1433 | 5840 |
doEditMask |
5841 |
self image mask edit |
|
5842 |
! |
|
5843 |
||
767 | 5844 |
doFlipHorizontal |
5845 |
"flips horizontally current image" |
|
400 | 5846 |
|
911 | 5847 |
imageEditView flipHorizontal |
400 | 5848 |
! |
5849 |
||
767 | 5850 |
doFlipVertical |
5851 |
"flips vertically current image" |
|
400 | 5852 |
|
911 | 5853 |
imageEditView flipVertical |
400 | 5854 |
! |
5855 |
||
2196 | 5856 |
doInsertTextFromUser |
5857 |
|text tempForm tempImage maskImage font w h| |
|
5858 |
||
2424 | 5859 |
text := Dialog request:'Text to be inserted (placed as bitmap into clipboard for paste):'. |
5860 |
text isEmptyOrNil ifTrue:[^ self ]. |
|
2196 | 5861 |
|
5862 |
font := Font family:'arial' size:20. |
|
5863 |
font := font onDevice:Screen current. |
|
5864 |
w := font widthOf:text. |
|
5865 |
h := font heightOf:text. |
|
5866 |
||
5867 |
tempForm := Form extent:(w@h) depth:1 onDevice:(Screen current). |
|
5868 |
tempForm clear. |
|
5869 |
tempForm font:font. |
|
5870 |
tempForm paint:(Color colorId:1). |
|
5871 |
tempForm displayString:text at:(0@font ascent). |
|
5872 |
||
5873 |
tempImage := tempForm asImage. |
|
5874 |
maskImage := tempForm asImage. |
|
5875 |
tempImage |
|
5876 |
photometric:#palette; |
|
5877 |
colorMap:(Array with:Color white with:imageEditView selectedColor); |
|
5878 |
mask:maskImage. |
|
5879 |
||
5880 |
ImageEditView copyImageToClipboard:tempImage. |
|
5881 |
self editMode value:#paste. |
|
5882 |
||
5883 |
"Modified: / 11-11-2007 / 12:32:55 / cg" |
|
5884 |
! |
|
5885 |
||
1896 | 5886 |
doInspectImage |
5887 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
5888 |
||
5889 |
self image inspect |
|
5890 |
! |
|
5891 |
||
767 | 5892 |
doMagnifyDown |
1987 | 5893 |
"magnifies the current image one step down" |
400 | 5894 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5895 |
|magHolder mag| |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5896 |
|
1987 | 5897 |
magHolder := self magnificationHolder. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5898 |
(mag := magHolder value) > 1 ifTrue: [ |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5899 |
magHolder value: mag - 1 |
400 | 5900 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5901 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5902 |
"Modified: / 26.7.1998 / 20:24:08 / cg" |
400 | 5903 |
! |
5904 |
||
767 | 5905 |
doMagnifyImage |
1479 | 5906 |
"magnifies the current image to a new size" |
400 | 5907 |
|
1353 | 5908 |
|box newSize image| |
5909 |
||
5910 |
image := imageEditView image. |
|
5911 |
||
5912 |
box := EnterBox new. |
|
5913 |
box title:(resources string:'Images new size:'). |
|
5914 |
box okText:(resources string:'OK'). |
|
5915 |
box abortText:(resources string:'Cancel'). |
|
5916 |
box initialText:image extent printString. |
|
5917 |
box showAtPointer. |
|
5918 |
(box accepted |
|
1960 | 5919 |
and: [(newSize := self pointFromString:(box contents)) notNil]) |
1353 | 5920 |
ifTrue:[ |
1479 | 5921 |
newSize isPoint ifFalse:[ |
5922 |
self warn:'please enter the new size as ''x @ y''.'. |
|
5923 |
^ self. |
|
5924 |
]. |
|
5925 |
imageEditView magnifyImageTo:newSize. |
|
5926 |
]. |
|
5927 |
||
5928 |
self updateInfoLabel |
|
5929 |
! |
|
5930 |
||
5931 |
doMagnifyImageBy |
|
5932 |
"magnifies the current image (by a scale)" |
|
5933 |
||
2260 | 5934 |
|box oldSize newSize scaleString scale image| |
1479 | 5935 |
|
5936 |
image := imageEditView image. |
|
5937 |
oldSize := image extent. |
|
5938 |
||
2260 | 5939 |
scaleString := Dialog |
5940 |
request:(resources string:'Scale factor (<1 to shrink; >1 to magnify):') |
|
5941 |
initialAnswer:'1' |
|
5942 |
list:#('0.25' '0.5' '2' '4'). |
|
5943 |
||
5944 |
"/ box := EnterBox new. |
|
5945 |
"/ box title:(resources string:'Scale factor (<1 to shrink; >1 to magnify):'). |
|
5946 |
"/ box okText:(resources string:'OK'). |
|
5947 |
"/ box abortText:(resources string:'Cancel'). |
|
5948 |
"/ box initialText:1 printString. |
|
5949 |
"/ box showAtPointer. |
|
5950 |
"/ box accepted ifTrue:[ |
|
5951 |
"/ scaleString := box contents. |
|
5952 |
"/ ]. |
|
5953 |
||
5954 |
scale := Object readFromString:scaleString onError:nil. |
|
5955 |
||
5956 |
scale notNil ifTrue:[ |
|
1479 | 5957 |
scale isNumber ifFalse:[ |
5958 |
self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'. |
|
5959 |
^ self. |
|
5960 |
]. |
|
5961 |
newSize := oldSize * scale. |
|
1353 | 5962 |
imageEditView magnifyImageTo:newSize. |
5963 |
]. |
|
5964 |
||
400 | 5965 |
self updateInfoLabel |
5966 |
! |
|
5967 |
||
767 | 5968 |
doMagnifyUp |
1987 | 5969 |
"magnifies the current image one step up" |
400 | 5970 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5971 |
|magHolder mag| |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5972 |
|
1987 | 5973 |
magHolder := self magnificationHolder. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5974 |
(mag := magHolder value) < 99 ifTrue: [ |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5975 |
magHolder value: mag + 1 |
400 | 5976 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5977 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5978 |
"Modified: / 26.7.1998 / 20:23:52 / cg" |
400 | 5979 |
! |
5980 |
||
767 | 5981 |
doNegativeImage |
5982 |
"negates current image by negating the color map" |
|
400 | 5983 |
|
1598 | 5984 |
self image depth ~~ 1 ifTrue:[ |
5985 |
Dialog warn:'Only useful for depth 1 images'. |
|
5986 |
^ self |
|
5987 |
]. |
|
911 | 5988 |
imageEditView negativeImage. |
400 | 5989 |
self listOfColors removeAll. |
901 | 5990 |
self findColorMapMode. |
2585 | 5991 |
"/ imageEditView removelastUndo |
400 | 5992 |
! |
5993 |
||
767 | 5994 |
doResizeImage |
1353 | 5995 |
"resizes the current image" |
5996 |
||
5997 |
|box newSize image| |
|
5998 |
||
5999 |
image := imageEditView image. |
|
6000 |
||
6001 |
box := EnterBox new. |
|
6002 |
box title:(resources string:'Images new size:'). |
|
6003 |
box okText:(resources string:'OK'). |
|
6004 |
box abortText:(resources string:'Cancel'). |
|
6005 |
box initialText:image extent printString. |
|
6006 |
box showAtPointer. |
|
6007 |
(box accepted |
|
1960 | 6008 |
and: [(newSize := self pointFromString:(box contents)) notNil]) |
1353 | 6009 |
ifTrue:[ |
6010 |
imageEditView resizeImageTo:newSize. |
|
6011 |
]. |
|
400 | 6012 |
! |
6013 |
||
767 | 6014 |
doRotateImage |
6015 |
"rotates current image" |
|
400 | 6016 |
|
1353 | 6017 |
|box rotation| |
6018 |
||
6019 |
box := EnterBox new. |
|
6020 |
box title:(resources string:'Rotate by (degrees, clockwise):'). |
|
6021 |
box okText:(resources string:'OK'). |
|
6022 |
box abortText:(resources string:'Cancel'). |
|
6023 |
box initialText: '0'. |
|
6024 |
box showAtPointer. |
|
2196 | 6025 |
(box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil]) |
1353 | 6026 |
ifTrue:[ |
6027 |
imageEditView rotateImageBy:rotation. |
|
1558 | 6028 |
self updateInfoLabel. |
1353 | 6029 |
]. |
2196 | 6030 |
|
6031 |
"Modified: / 11-11-2007 / 13:21:11 / cg" |
|
400 | 6032 |
! |
6033 |
||
1557 | 6034 |
doShiftManual |
6035 |
"let user specify amount and shift" |
|
6036 |
||
1713 | 6037 |
|bindings amount img firstChange shiftAction acceptChannel wrapHolder| |
1557 | 6038 |
|
6039 |
acceptChannel := TriggerValue new. |
|
1960 | 6040 |
wrapHolder := (lastShiftUsedWrap ? true) asValue. |
1557 | 6041 |
|
6042 |
firstChange := true. |
|
6043 |
||
6044 |
shiftAction := |
|
6045 |
[:shiftH :shiftV | |
|
6046 |
acceptChannel value:true. |
|
6047 |
||
6048 |
img := imageEditView image. |
|
6049 |
firstChange ifTrue:[ |
|
6050 |
imageEditView makeUndo. |
|
6051 |
firstChange := false. |
|
6052 |
]. |
|
1713 | 6053 |
imageEditView shiftImageHorizontal:(shiftH value) vertical:(shiftV value) wrap:(wrapHolder value). |
1557 | 6054 |
self updateInfoLabel |
6055 |
]. |
|
6056 |
||
6057 |
bindings := IdentityDictionary new. |
|
6058 |
bindings at:#shiftAmount put:(amount := 1 asValue). |
|
1713 | 6059 |
bindings at:#wrap put:wrapHolder. |
1557 | 6060 |
bindings at:#acceptChannel put:acceptChannel. |
6061 |
||
6062 |
bindings at:#shiftLeftNow put:[ shiftAction value:(-1*amount value) value:0 ]. |
|
6063 |
bindings at:#shiftRightNow put:[ shiftAction value:amount value value:0 ]. |
|
6064 |
bindings at:#shiftUpNow put:[ shiftAction value:0 value:(-1*amount value) ]. |
|
6065 |
bindings at:#shiftDownNow put:[ shiftAction value:0 value:amount value ]. |
|
6066 |
||
6067 |
(self openDialogInterface:#shiftDialogSpec withBindings:bindings) |
|
6068 |
ifFalse:[ |
|
6069 |
firstChange ~~ true ifTrue:[ |
|
6070 |
imageEditView undo |
|
6071 |
] |
|
6072 |
]. |
|
1960 | 6073 |
lastShiftUsedWrap := wrapHolder value. |
1557 | 6074 |
|
6075 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
6076 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
6077 |
! |
|
6078 |
||
1480 | 6079 |
doUnCropManual |
6080 |
"let user specify borders and add them" |
|
6081 |
||
6082 |
|bindings left top right bottom img| |
|
6083 |
||
6084 |
bindings := IdentityDictionary new. |
|
1704 | 6085 |
bindings at:#left put:(left := 1 asValue). |
6086 |
bindings at:#right put:(right := 1 asValue). |
|
6087 |
bindings at:#top put:(top := 1 asValue). |
|
6088 |
bindings at:#bottom put:(bottom := 1 asValue). |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
6089 |
(self openDialogInterface:#uncropDialogSpec withBindings:bindings) |
1480 | 6090 |
ifTrue:[ |
6091 |
left := left value. |
|
6092 |
right := right value. |
|
6093 |
top := top value. |
|
6094 |
bottom := bottom value. |
|
6095 |
img := imageEditView image. |
|
6096 |
||
6097 |
imageEditView |
|
6098 |
makeBorderedImageX:left y:top |
|
6099 |
width:(img width + left + right) |
|
6100 |
height:(img height + top + bottom). |
|
6101 |
self updateInfoLabel |
|
6102 |
]. |
|
6103 |
||
6104 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
6105 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
6106 |
! |
|
6107 |
||
767 | 6108 |
doUndo |
6109 |
"reverses last edit action" |
|
400 | 6110 |
|
1436 | 6111 |
imageEditView undo. |
400 | 6112 |
! ! |
6113 |
||
2812 | 6114 |
!ImageEditor methodsFor:'user actions-image sequences'! |
6115 |
||
6116 |
editEachImageFromSequence |
|
6117 |
|seq| |
|
6118 |
||
6119 |
self checkModified ifFalse:[ ^ self ]. |
|
6120 |
||
6121 |
imageEditView releaseUndos. |
|
6122 |
||
6123 |
seq := self image imageSequence. |
|
6124 |
seq size > 10 ifTrue:[ |
|
6125 |
(Dialog confirm:(resources string:'Ok to open %1 image editor windows?' with:seq size)) |
|
6126 |
ifFalse:[^ self]. |
|
6127 |
]. |
|
6128 |
||
6129 |
seq do:[:eachFrame | |
|
6130 |
ImageEditor openOnImage:eachFrame image |
|
6131 |
]. |
|
6132 |
||
6133 |
"Modified: / 21-10-2010 / 15:01:25 / cg" |
|
6134 |
! |
|
6135 |
||
6136 |
gotoImageInSequence:index |
|
6137 |
"display the next image in the image sequence" |
|
6138 |
||
6139 |
|img seq frame listOfColors| |
|
6140 |
||
6141 |
imageEditView releaseUndos. |
|
6142 |
||
6143 |
seq := self image imageSequence. |
|
6144 |
||
6145 |
imageSeqNr := index. |
|
6146 |
frame := seq at:imageSeqNr. |
|
6147 |
imageEditView image:(frame image). |
|
6148 |
||
6149 |
(img := self image) notNil ifTrue:[ |
|
6150 |
listOfColors := self listOfColors. |
|
6151 |
img colorMap notNil ifTrue:[ |
|
6152 |
listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
6153 |
] ifFalse:[ |
|
6154 |
listOfColors removeAll. |
|
6155 |
]. |
|
6156 |
self findColorMapMode. |
|
6157 |
self updateLabelsAndHistory. |
|
6158 |
img := img onDevice:device. |
|
6159 |
imageEditView image:img. |
|
6160 |
] ifFalse:[ |
|
6161 |
self updateForNoImage |
|
6162 |
]. |
|
6163 |
||
6164 |
"Created: / 21-10-2010 / 14:22:11 / cg" |
|
6165 |
! |
|
6166 |
||
6167 |
nextImageInSequence |
|
6168 |
"display the next image in the image sequence" |
|
6169 |
||
6170 |
|seq index| |
|
6171 |
||
6172 |
seq := self image imageSequence. |
|
6173 |
(index := imageSeqNr) isNil ifTrue:[ |
|
6174 |
index := 1. |
|
6175 |
]. |
|
6176 |
index := index + 1. |
|
6177 |
index > seq size ifTrue:[ |
|
6178 |
self information:'Back to first image in sequence'. |
|
6179 |
index := 1. |
|
6180 |
]. |
|
6181 |
self gotoImageInSequence:index. |
|
6182 |
||
6183 |
"Modified: / 21-10-2010 / 14:24:11 / cg" |
|
6184 |
! |
|
6185 |
||
6186 |
previousImageInSequence |
|
6187 |
"display the previous image in the image sequence" |
|
6188 |
||
6189 |
|seq index| |
|
6190 |
||
6191 |
seq := self image imageSequence. |
|
6192 |
(index := imageSeqNr) isNil ifTrue:[ |
|
6193 |
index := 1. |
|
6194 |
]. |
|
6195 |
index := index - 1. |
|
6196 |
index < 1 ifTrue:[ |
|
6197 |
self information:'Wrap to last image in sequence'. |
|
6198 |
index := seq size. |
|
6199 |
]. |
|
6200 |
self gotoImageInSequence:index. |
|
6201 |
||
6202 |
"Created: / 21-10-2010 / 14:25:03 / cg" |
|
6203 |
! ! |
|
6204 |
||
1715 | 6205 |
!ImageEditor methodsFor:'user actions-loading'! |
400 | 6206 |
|
767 | 6207 |
doLoadFromClass |
6208 |
"opens a dialog for loading an image from class and a (resource-) selector" |
|
400 | 6209 |
|
1122 | 6210 |
|img| |
6211 |
||
1975 | 6212 |
self checkModified ifFalse:[ ^ self ]. |
6213 |
||
1054 | 6214 |
(imageEditView loadFromClass) notNil ifTrue:[ |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
6215 |
imageSeqNr := nil. |
1122 | 6216 |
(img := self image) notNil ifTrue: [ |
1900 | 6217 |
self updateColorsFromImage:img. |
574 | 6218 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
6219 |
self updateLabelsAndHistory. |
1054 | 6220 |
] ifFalse: [ |
6221 |
self updateForNoImage |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
6222 |
]. |
449 | 6223 |
] |
400 | 6224 |
! |
6225 |
||
767 | 6226 |
doLoadFromFile |
6227 |
"opens a dialog for loading an image from a file" |
|
400 | 6228 |
|
2820 | 6229 |
|img file filters title| |
1353 | 6230 |
|
1975 | 6231 |
self checkModified ifFalse:[ ^ self ]. |
6232 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
6233 |
imageSeqNr := nil. |
1353 | 6234 |
img := self image. |
6235 |
img notNil ifTrue: [ |
|
6236 |
file := img fileName |
|
6237 |
]. |
|
6238 |
||
2820 | 6239 |
title := (resources string:'Load Image From'). |
6240 |
||
6241 |
UserPreferences current useNativeFileDialog ifTrue:[ |
|
6242 |
self withWaitCursorDo:[ |
|
6243 |
file := Display |
|
6244 |
nativeFileDialogFor:(self window topView id) |
|
6245 |
save:false |
|
6246 |
title:title |
|
6247 |
inDirectory:(file notNil ifTrue:[file asFilename directory pathName] ifFalse:[LastDirectory]) |
|
6248 |
initialAnswer:(file notNil ifTrue:[file asFilename baseName] ifFalse:['image.png']) |
|
2827 | 6249 |
"/ flags:#( ENABLESIZING "HIDEREADONLY" EXPLORER NOCHANGEDIR) |
2820 | 6250 |
filter: |
6251 |
{ |
|
6252 |
{ (resources string:'Image Files') . '*.tif;*.png;*.gif;*.bmp;*.jpg' } . |
|
6253 |
{ (resources string:'All Files') . '*.*' } |
|
6254 |
} |
|
2821 | 6255 |
extension:nil |
2827 | 6256 |
"blocking:false". |
2820 | 6257 |
]. |
6258 |
] ifFalse:[ |
|
6259 |
filters := FileSelectionBrowser loadImageFileNameFilters. |
|
6260 |
file notNil ifTrue:[ |
|
6261 |
file := FileSelectionBrowser |
|
6262 |
request:title |
|
6263 |
fileName:file |
|
6264 |
withFileFilters:filters. |
|
6265 |
] ifFalse:[ |
|
6266 |
file := FileSelectionBrowser |
|
6267 |
request:title |
|
6268 |
inDirectory:LastDirectory |
|
6269 |
withFileFilters:filters. |
|
6270 |
]. |
|
1353 | 6271 |
]. |
2820 | 6272 |
|
1353 | 6273 |
file notNil ifTrue:[ |
6274 |
LastDirectory := file asFilename directoryName. |
|
6275 |
self loadFromFile:file |
|
6276 |
] |
|
2820 | 6277 |
|
2827 | 6278 |
"Modified: / 14-12-2010 / 13:52:11 / cg" |
400 | 6279 |
! |
6280 |
||
2796 | 6281 |
doLoadFromURL |
6282 |
"opens a dialog for loading an image from a URL" |
|
6283 |
||
6284 |
|tempFile url| |
|
6285 |
||
6286 |
self checkModified ifFalse:[ ^ self ]. |
|
6287 |
||
6288 |
url := Dialog |
|
6289 |
request:'Load Image from URL' |
|
6290 |
initialAnswer:LastURL. |
|
6291 |
||
6292 |
url notEmptyOrNil ifTrue:[ |
|
6293 |
LastURL := url. |
|
6294 |
tempFile := Filename newTemporary. |
|
6295 |
HTTPInterface get:url destinationFile:tempFile. |
|
6296 |
self loadFromFile:tempFile. |
|
6297 |
tempFile delete |
|
6298 |
] |
|
6299 |
||
6300 |
"Created: / 20-09-2010 / 11:30:59 / cg" |
|
6301 |
! |
|
6302 |
||
767 | 6303 |
doNewImage |
6304 |
"opens a dialog with choices of size and color map for creating a new image" |
|
400 | 6305 |
|
1975 | 6306 |
|dialogAspects width height cMapString cMapMode cMap imageClass image szString defaultSize ext| |
6307 |
||
6308 |
self checkModified ifFalse:[ ^ self ]. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6309 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6310 |
defaultSize := (self class listOfDefaultSizes includes:'32x32') |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6311 |
ifTrue:['32x32'] |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6312 |
ifFalse:[self class listOfDefaultSizes first]. |
767 | 6313 |
|
1975 | 6314 |
dialogAspects := IdentityDictionary new |
767 | 6315 |
at:#listOfSizes put: self class listOfDefaultSizes asValue; |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6316 |
at:#listOfColorMaps put: self class namesOfColorMaps values asSortedCollection asValue; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6317 |
at:#selectionOfSize put: (LastSizeString ? defaultSize) asValue; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6318 |
at:#selectionOfColorMap put: (LastColormapMode ? self class namesOfColorMaps values asSortedCollection first) asValue; |
400 | 6319 |
yourself. |
6320 |
||
1975 | 6321 |
(self openDialogInterface:#dialogSpecForNewImage withBindings:dialogAspects) |
1383 | 6322 |
ifTrue:[ |
1975 | 6323 |
szString := (dialogAspects at:#selectionOfSize) value. |
1960 | 6324 |
ext := self pointFromString:szString. |
1962 | 6325 |
ext isNil ifTrue:[ |
6326 |
width := height := 32 |
|
6327 |
] ifFalse:[ |
|
6328 |
width := ext x. |
|
6329 |
height := ext y. |
|
6330 |
]. |
|
1960 | 6331 |
"/ width := "128 min: "(Integer readFromString: (szString upTo: $x) onError:[32]). |
6332 |
"/ height := "128 min: " (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[32]). |
|
400 | 6333 |
|
1975 | 6334 |
cMapString := (dialogAspects at:#selectionOfColorMap) value. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6335 |
cMapMode := self class namesOfColorMaps keyAtEqualValue:cMapString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6336 |
cMap := self class listOfColorMaps at:cMapMode. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6337 |
imageClass := Image implementorForDepth:(cMap size highBit-1). |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6338 |
image := imageClass width: width height: height. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6339 |
image bits:(ByteArray new:(image bytesPerRow*height)). |
400 | 6340 |
|
1637 | 6341 |
LastSizeString := szString. |
6342 |
LastColormapMode := cMapString. |
|
6343 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6344 |
(cMapMode startsWith: 'mask') ifTrue:[ |
767 | 6345 |
image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels |
400 | 6346 |
]. |
6347 |
image colorMap: cMap. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6348 |
(imageEditView image: image) notNil ifTrue:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6349 |
self updateListOfColorsAndColormapMode. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6350 |
self updateLabelsAndHistory. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6351 |
]. |
400 | 6352 |
image fillRectangleX:0 y:0 width:width height:height with:Color white. |
767 | 6353 |
] |
929 | 6354 |
! |
6355 |
||
2058 | 6356 |
doNewImageEditor |
6357 |
"opens a new image editor" |
|
6358 |
||
6359 |
ImageEditor open |
|
6360 |
||
6361 |
"Created: / 17-08-2006 / 09:03:14 / cg" |
|
6362 |
! |
|
6363 |
||
1682 | 6364 |
doNewImageFromClipboard |
6365 |
|image| |
|
6366 |
||
1975 | 6367 |
self checkModified ifFalse:[ ^ self ]. |
6368 |
||
1682 | 6369 |
image := imageEditView clipBoard. |
1975 | 6370 |
imageEditView image:image. |
6371 |
||
6372 |
image notNil ifTrue:[ |
|
1900 | 6373 |
self updateColorsFromImage:image. |
1682 | 6374 |
self findColorMapMode. |
6375 |
self updateLabelsAndHistory. |
|
6376 |
] |
|
6377 |
! |
|
6378 |
||
929 | 6379 |
grabScreenImage |
6380 |
"let user choose an area and grab that are for editing" |
|
6381 |
||
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6382 |
self grabScreenImageUsing:[ |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6383 |
|r| |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6384 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6385 |
[Screen current leftButtonPressed] whileTrue:[Delay waitForSeconds:0.05]. |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6386 |
r := Rectangle fromUser. |
2708 | 6387 |
(r width == 0 or:[r height == 0]) ifTrue:[ |
6388 |
nil |
|
6389 |
] ifFalse:[ |
|
6390 |
lastGrabbedScreenArea := r. |
|
6391 |
Image fromScreen:r |
|
6392 |
] |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6393 |
]. |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6394 |
! |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6395 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6396 |
grabScreenImageFromLastArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6397 |
"grab again from the previous area for editing" |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6398 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6399 |
self grabScreenImageUsing:[ |
2708 | 6400 |
Image fromScreen:lastGrabbedScreenArea |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6401 |
]. |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6402 |
! |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6403 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6404 |
grabScreenImageUsing:aBlock |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6405 |
"let user choose an area and grab that are for editing" |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6406 |
|
1975 | 6407 |
self checkModified ifFalse:[ ^ self ]. |
6408 |
||
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6409 |
Processor |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6410 |
addTimedBlock:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6411 |
|image d8image img| |
929 | 6412 |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
6413 |
imageSeqNr := nil. |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6414 |
image := aBlock value. |
2708 | 6415 |
image notNil ifTrue:[ |
1121 | 6416 |
image depth > 8 ifTrue:[ |
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
6417 |
false ifTrue:[ |
1687
f4543a556b89
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1682
diff
changeset
|
6418 |
Error handle:[:ex | |sig| |
1537
e86a686eeba2
class based exceptions - no longer need to send #haltSÃgnal
Claus Gittinger <cg@exept.de>
parents:
1507
diff
changeset
|
6419 |
(sig := ex signal) == HaltInterrupt ifTrue:[ex reject]. |
1122 | 6420 |
sig == Signal noHandlerSignal ifTrue:[ex reject]. |
1121 | 6421 |
|
6422 |
self warn:'Could not convert to depth8 image (too many colors)'. |
|
6423 |
d8image := nil. |
|
6424 |
] do:[ |
|
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
6425 |
d8image := Depth8Image fromImage:image photometric:#palette. |
1121 | 6426 |
]. |
6427 |
d8image notNil ifTrue:[ |
|
6428 |
image := d8image |
|
6429 |
] |
|
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
6430 |
]. |
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6431 |
]. |
1121 | 6432 |
(imageEditView image:image) notNil ifTrue:[ |
6433 |
self listOfColors contents:(image colorMap). |
|
6434 |
self findColorMapMode. |
|
6435 |
self updateLabelsAndHistory. |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6436 |
] |
1121 | 6437 |
] |
6438 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
6439 |
afterSeconds:1 |
929 | 6440 |
|
6441 |
"Created: / 29.7.1998 / 21:24:42 / cg" |
|
1537
e86a686eeba2
class based exceptions - no longer need to send #haltSÃgnal
Claus Gittinger <cg@exept.de>
parents:
1507
diff
changeset
|
6442 |
"Modified: / 16.11.2001 / 16:21:19 / cg" |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
6443 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
6444 |
|
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6445 |
grabWindowImage |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6446 |
"let user choose an area and grab that are for editing" |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6447 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6448 |
self grabScreenImageUsing:[ |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6449 |
|v| |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6450 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6451 |
(v := Screen current viewFromUser) notNil ifTrue:[ |
2704 | 6452 |
v topView raise. |
6453 |
v topView makeFullyVisible. |
|
6454 |
Delay waitForSeconds:0.5. "/ give view a chance to redraw itself. |
|
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6455 |
Image fromView:(v topView) |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6456 |
]. |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
6457 |
]. |
400 | 6458 |
! ! |
6459 |
||
1715 | 6460 |
!ImageEditor methodsFor:'user actions-saving'! |
400 | 6461 |
|
767 | 6462 |
doPrint |
6463 |
"prints current image on the current printer" |
|
400 | 6464 |
|
1734 | 6465 |
self withWaitCursorDo:[ |
6466 |
imageEditView print |
|
6467 |
] |
|
400 | 6468 |
! |
6469 |
||
1613 | 6470 |
doSaveButtonImageToFileAs |
6471 |
"opens a dialog for saving current image to a file" |
|
6472 |
||
6473 |
imageEditView saveButtonImageToFileAs. |
|
6474 |
self updateLabelsAndHistory. |
|
6475 |
! |
|
6476 |
||
767 | 6477 |
doSaveImageFile |
6478 |
"saves current image to current file" |
|
400 | 6479 |
|
1481 | 6480 |
imageEditView save. |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6481 |
self clearModified. |
400 | 6482 |
! |
6483 |
||
767 | 6484 |
doSaveImageFileAs |
1922 | 6485 |
"opens a dialog for saving an image to a file" |
6486 |
||
6487 |
|img file filters| |
|
6488 |
||
6489 |
img := self image. |
|
6490 |
img notNil ifTrue: [ |
|
6491 |
file := img fileName |
|
6492 |
]. |
|
6493 |
||
2595 | 6494 |
filters := FileSelectionBrowser saveImageFileNameFilters. |
1922 | 6495 |
|
2820 | 6496 |
UserPreferences current useNativeFileDialog ifTrue:[ |
6497 |
self withWaitCursorDo:[ |
|
6498 |
file := Display |
|
6499 |
nativeFileDialogFor:(self window topView id) |
|
6500 |
save:true |
|
6501 |
title:(resources string:'Save Image To') |
|
6502 |
inDirectory:(file notNil ifTrue:[file asFilename directory pathName] ifFalse:[LastDirectory]) |
|
6503 |
initialAnswer:(file notNil ifTrue:[file asFilename baseName] ifFalse:['image.png']) |
|
2827 | 6504 |
"/ flags:#( ENABLESIZING "HIDEREADONLY" EXPLORER NOCHANGEDIR) |
2820 | 6505 |
filter: |
6506 |
{ |
|
6507 |
{ (resources string:'Image Files') . '*.tif;*.png;*.gif;*.bmp' } . |
|
6508 |
{ (resources string:'All Files') . '*.*' } |
|
6509 |
} |
|
2821 | 6510 |
extension:nil |
2827 | 6511 |
"blocking:false". |
2807 | 6512 |
]. |
2820 | 6513 |
] ifFalse:[ |
6514 |
(FileSelectionBrowser isNil or:[DirectoryView isNil]) ifTrue:[ |
|
6515 |
file notNil ifTrue:[ |
|
6516 |
file := Dialog requestFileName:'Save Image To' |
|
6517 |
default:file |
|
6518 |
pattern:(filters first). |
|
6519 |
] ifFalse:[ |
|
6520 |
file := Dialog |
|
6521 |
requestFileName:'Save Image To' |
|
6522 |
default:'image.png' |
|
6523 |
pattern:(filters first) |
|
6524 |
fromDirectory:LastDirectory. |
|
6525 |
]. |
|
2807 | 6526 |
] ifFalse:[ |
2820 | 6527 |
file notNil ifTrue:[ |
6528 |
file := FileSelectionBrowser |
|
6529 |
request:'Save Image To' |
|
6530 |
fileName:file |
|
6531 |
withFileFilters:filters. |
|
6532 |
] ifFalse:[ |
|
6533 |
file := FileSelectionBrowser |
|
6534 |
request:'Save Image To' |
|
6535 |
inDirectory:LastDirectory |
|
6536 |
withFileFilters:filters. |
|
6537 |
]. |
|
2807 | 6538 |
]. |
1922 | 6539 |
]. |
6540 |
file notNil ifTrue:[ |
|
6541 |
imageEditView saveImageFileAs:file. |
|
6542 |
LastDirectory := file asFilename directoryName. |
|
6543 |
self updateLabelsAndHistory. |
|
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6544 |
self clearModified. |
1922 | 6545 |
] |
2807 | 6546 |
|
2827 | 6547 |
"Modified: / 14-12-2010 / 13:51:47 / cg" |
400 | 6548 |
! |
6549 |
||
767 | 6550 |
doSaveImageMaskFileAs |
6551 |
"opens a dialog for saving mask of current image to a file" |
|
400 | 6552 |
|
1481 | 6553 |
imageEditView saveImageMaskFileAs. |
400 | 6554 |
! |
6555 |
||
767 | 6556 |
doSaveMethod |
1975 | 6557 |
"saves the image in current class and selector" |
6558 |
||
6559 |
imageEditView saveMethod ifTrue:[ |
|
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6560 |
self updateLabelsAndHistory. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6561 |
self clearModified. |
400 | 6562 |
] |
6563 |
! |
|
6564 |
||
767 | 6565 |
doSaveMethodAs |
6566 |
"opens a dialog for saving current image on a class and a selector" |
|
400 | 6567 |
|
1975 | 6568 |
imageEditView saveMethodAs ifTrue:[ |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6569 |
self updateLabelsAndHistory. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6570 |
self clearModified. |
400 | 6571 |
] |
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6572 |
! |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6573 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6574 |
doShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6575 |
"opens a dialog showing the storeString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6576 |
(sometimes useful to embed an image into source code)" |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6577 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6578 |
|img| |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6579 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6580 |
img := imageEditView image. |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
6581 |
TextBox openOn:img storeString |
1975 | 6582 |
! |
6583 |
||
6584 |
save |
|
6585 |
"saves current image on current class and selector" |
|
6586 |
||
6587 |
self doSaveMethod |
|
400 | 6588 |
! ! |
6589 |
||
1715 | 6590 |
!ImageEditor methodsFor:'user actions-settings'! |
1353 | 6591 |
|
6592 |
doChangeGridMagnification |
|
6593 |
"change grid magnification" |
|
6594 |
||
6595 |
|box oldGridLimit newGridLimit| |
|
6596 |
||
6597 |
oldGridLimit := imageEditView class gridMagnificationLimit asPoint. |
|
6598 |
||
6599 |
box := EnterBox new. |
|
6600 |
box title:(resources string:'Grid Magnification Limit:'). |
|
6601 |
box okText:(resources string:'OK'). |
|
6602 |
box abortText:(resources string:'Cancel'). |
|
6603 |
box initialText:(oldGridLimit x printString). |
|
6604 |
box showAtPointer. |
|
6605 |
||
6606 |
(box accepted |
|
6607 |
and: [(newGridLimit := Number readFromString:(box contents) onError:[2]) notNil] |
|
6608 |
) ifTrue:[ |
|
6609 |
newGridLimit := (99 min: (2 max:newGridLimit)) asPoint. |
|
6610 |
imageEditView class gridMagnificationLimit:newGridLimit. |
|
6611 |
imageEditView invalidate |
|
6612 |
] |
|
6613 |
||
2192 | 6614 |
! |
6615 |
||
6616 |
penWidth:n |
|
6617 |
imageEditView penWidth:n |
|
6618 |
||
6619 |
"Created: / 01-11-2007 / 23:47:48 / cg" |
|
2375 | 6620 |
! |
6621 |
||
6622 |
spraySpot:n |
|
6623 |
imageEditView spraySpot:n |
|
6624 |
||
6625 |
"Created: / 01-11-2007 / 23:47:48 / cg" |
|
1353 | 6626 |
! ! |
6627 |
||
400 | 6628 |
!ImageEditor class methodsFor:'documentation'! |
6629 |
||
6630 |
version |
|
6631 |
^ '$Header$' |
|
2590 | 6632 |
! |
6633 |
||
6634 |
version_CVS |
|
6635 |
^ '$Header$' |
|
400 | 6636 |
! ! |