author | Claus Gittinger <cg@exept.de> |
Thu, 31 Oct 2002 17:32:36 +0100 | |
changeset 1642 | 8119edd52cf8 |
parent 1640 | 87ce36f48fbc |
child 1643 | 91b7ea254a3b |
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 |
" |
|
12 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
13 |
"{ Package: 'stx:libtool2' }" |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
14 |
|
400 | 15 |
ToolApplicationModel subclass:#ImageEditor |
975 | 16 |
instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
17 |
selectedColorIndex postOpenAction imageSeqNr' |
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
18 |
classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
19 |
DefaultRelativeSizes' |
929 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-UIPainter' |
|
400 | 22 |
! |
23 |
||
24 |
!ImageEditor class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
767 | 28 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 29 |
All Rights Reserved |
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
405 | 33 |
inclusion of the above copyright notice. This software may not |
400 | 34 |
be provided or otherwise made available to, or used by, any |
405 | 35 |
other person. No title to or ownership of the software is |
400 | 36 |
hereby transferred. |
37 |
" |
|
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
737 | 42 |
Image Editor allows you to create, design, modify or just inspect images. |
400 | 43 |
|
44 |
[start with:] |
|
45 |
ImageEditor open |
|
941 | 46 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
400 | 47 |
|
48 |
[see also:] |
|
49 |
ImageEditView Image |
|
50 |
||
51 |
[author:] |
|
544 | 52 |
Thomas Zwick, eXept Software AG |
400 | 53 |
" |
54 |
! ! |
|
55 |
||
56 |
!ImageEditor class methodsFor:'instance creation'! |
|
57 |
||
58 |
openModalOnClass: aClass andSelector: aSelector |
|
900 | 59 |
"opens modal a Image Editor on aClass and aSelector" |
767 | 60 |
" |
61 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
62 |
" |
|
400 | 63 |
|
767 | 64 |
|imageEditor imageEditView className resourceClassName resourceSelector| |
65 |
||
400 | 66 |
imageEditor := self new. |
767 | 67 |
|
900 | 68 |
aClass isClass ifTrue: [className := aClass name]. |
69 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 70 |
aClass isNil ifTrue: [className := '']. |
400 | 71 |
|
688 | 72 |
imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. imageEditor loadFromOrPrepareForMessage: className, ' ', aSelector]. |
400 | 73 |
imageEditor openModal. |
74 |
||
688 | 75 |
resourceClassName := imageEditView resourceClass. |
767 | 76 |
resourceSelector := imageEditView resourceSelector. |
415 | 77 |
|
815 | 78 |
((className asString ~= resourceClassName) |
79 |
or:[aSelector asString ~= resourceSelector]) |
|
415 | 80 |
ifTrue: [^resourceClassName, ' ', resourceSelector] |
81 |
ifFalse:[^nil] |
|
400 | 82 |
! |
83 |
||
84 |
openOnClass: aClass andSelector: aSelector |
|
900 | 85 |
"opens a Image Editor on aClass and aSelector" |
767 | 86 |
" |
87 |
self openOnClass: self andSelector: #leftMouseKeyIcon |
|
88 |
" |
|
400 | 89 |
|
1057 | 90 |
|editor| |
91 |
||
92 |
editor := self new. |
|
93 |
editor allButOpen. |
|
1381 | 94 |
aSelector notNil ifTrue:[ |
95 |
editor loadFromMessage: aClass name, ' ', aSelector. |
|
96 |
] ifFalse:[ |
|
97 |
editor resourceClass:aClass |
|
98 |
]. |
|
1057 | 99 |
editor openWindow |
100 |
||
101 |
"Modified: / 16.3.1999 / 21:33:49 / cg" |
|
400 | 102 |
! |
103 |
||
767 | 104 |
openOnFile: aFileName |
900 | 105 |
"opens a Image Editor on aFileName" |
767 | 106 |
" |
107 |
self openOnFile: 'bitmaps/SmalltalkX.xbm' |
|
108 |
" |
|
400 | 109 |
|
1057 | 110 |
|editor| |
111 |
||
112 |
editor := self new. |
|
113 |
editor allButOpen. |
|
114 |
editor loadFromFile: aFileName. |
|
115 |
editor openWindow |
|
116 |
||
117 |
"Modified: / 16.3.1999 / 21:33:25 / cg" |
|
400 | 118 |
! |
119 |
||
767 | 120 |
openOnImage: anImage |
900 | 121 |
"opens a Image Editor on anImage" |
767 | 122 |
" |
895 | 123 |
self openOnImage: Icon startIcon |
767 | 124 |
" |
400 | 125 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
126 |
|editor| |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
127 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
128 |
editor := self new. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
129 |
editor allButOpen. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
130 |
editor loadFromImage: anImage. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
131 |
editor openWindow |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
132 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
133 |
"Modified: / 11.3.1999 / 16:18:33 / cg" |
400 | 134 |
! ! |
135 |
||
136 |
!ImageEditor class methodsFor:'accessing'! |
|
137 |
||
138 |
listOfColorMaps |
|
767 | 139 |
"returns the list of default color maps for a new image" |
400 | 140 |
|
141 |
|colorMap| |
|
898 | 142 |
|
400 | 143 |
(colorMap := OrderedCollection new) |
144 |
add: Color black; |
|
145 |
add: Color white; |
|
146 |
add: Color red; |
|
147 |
add: Color green; |
|
148 |
add: Color blue; |
|
149 |
add: Color cyan; |
|
150 |
add: Color yellow; |
|
151 |
add: Color magenta; |
|
898 | 152 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
153 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
154 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
155 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
156 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
157 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
158 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
159 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
160 |
||
400 | 161 |
0 to: 5 do: |
162 |
[:r| |
|
163 |
0 to: 5 do: |
|
164 |
[:g| |
|
165 |
0 to: 5 do: |
|
166 |
[:b| |
|
898 | 167 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 168 |
] |
169 |
] |
|
170 |
]. |
|
171 |
||
172 |
1 to: 25 do: |
|
173 |
[:g| |
|
898 | 174 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 175 |
]. |
176 |
||
177 |
^Dictionary new |
|
178 |
at: '8-plane' put: colorMap; |
|
179 |
at: '8-plane + mask' put: colorMap; |
|
180 |
at: '4-plane' put: (colorMap copyFrom: 1 to: 16); |
|
181 |
at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16); |
|
182 |
at: '2-plane' put: (colorMap copyFrom: 1 to: 4); |
|
183 |
at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4); |
|
184 |
at: '1-plane' put: (colorMap copyFrom: 1 to: 2); |
|
185 |
at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2); |
|
186 |
yourself |
|
187 |
! |
|
188 |
||
189 |
listOfDefaultSizes |
|
767 | 190 |
"returns the list of default sizes for a new image" |
400 | 191 |
|
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
192 |
^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
193 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
194 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
400 | 195 |
! ! |
196 |
||
460 | 197 |
!ImageEditor class methodsFor:'help specs'! |
198 |
||
1545 | 199 |
flyByHelpSpec |
200 |
<resource: #help> |
|
201 |
||
202 |
^super flyByHelpSpec addPairsFrom:#( |
|
203 |
||
204 |
#drawModeBox |
|
205 |
'Rectangle' |
|
206 |
||
207 |
#drawModeCopy |
|
208 |
'Copy' |
|
209 |
||
210 |
#drawModeFill |
|
1637 | 211 |
'Flood-Fill' |
1545 | 212 |
|
213 |
#drawModeFilledBox |
|
1637 | 214 |
'Filled Rectangle' |
1545 | 215 |
|
216 |
#drawModePaste |
|
217 |
'Paste' |
|
218 |
||
219 |
#drawModePasteUnder |
|
1637 | 220 |
'Paste Under' |
221 |
||
222 |
#drawModePasteWithMask |
|
223 |
'Paste With Mask' |
|
1545 | 224 |
|
225 |
#drawModePoint |
|
226 |
'Point' |
|
227 |
||
1639 | 228 |
#drawModeSpecial |
229 |
'Special Operations' |
|
230 |
||
1545 | 231 |
#fileGrabImage |
1637 | 232 |
'Pick from Screen.' |
1545 | 233 |
|
234 |
#fileLoadFromClass |
|
235 |
'Load from Method' |
|
236 |
||
237 |
#fileLoadFromFile |
|
238 |
'Load from File.' |
|
239 |
||
240 |
#fileNewImage |
|
1637 | 241 |
'New Image' |
1545 | 242 |
|
243 |
#filePrint |
|
244 |
'Print' |
|
245 |
||
246 |
#fileSaveAs |
|
1637 | 247 |
'Save to File.' |
1545 | 248 |
|
249 |
#fileSaveMaskAs |
|
1637 | 250 |
'Save to File.' |
1545 | 251 |
|
252 |
#fileSaveMethod |
|
1637 | 253 |
'Save as Method' |
1545 | 254 |
|
255 |
#fileSaveMethodAs |
|
1637 | 256 |
'Save as Method' |
1545 | 257 |
|
258 |
) |
|
259 |
! |
|
260 |
||
460 | 261 |
helpSpec |
737 | 262 |
"This resource specification was automatically generated |
263 |
by the UIHelpTool of ST/X." |
|
264 |
||
265 |
"Do not manually edit this!! If it is corrupted, |
|
266 |
the UIHelpTool may not be able to read the specification." |
|
460 | 267 |
|
268 |
" |
|
737 | 269 |
UIHelpTool openOnClass:ImageEditor |
460 | 270 |
" |
271 |
||
737 | 272 |
<resource: #help> |
273 |
||
274 |
^super helpSpec addPairsFrom:#( |
|
460 | 275 |
|
276 |
#colorMap |
|
929 | 277 |
'ColorMap functions.' |
278 |
||
279 |
#colorMap1 |
|
280 |
'Convert to depth-1 image.' |
|
281 |
||
986 | 282 |
#colorMap1M |
283 |
'Convert to depth-1 image plus mask.' |
|
284 |
||
929 | 285 |
#colorMap2 |
286 |
'Convert to depth-2 image.' |
|
287 |
||
986 | 288 |
#colorMap2M |
289 |
'Convert to depth-2 image plus mask.' |
|
290 |
||
929 | 291 |
#colorMap4 |
292 |
'Convert to depth-4 image.' |
|
293 |
||
986 | 294 |
#colorMap4M |
295 |
'Convert to depth-4 image plus mask.' |
|
296 |
||
929 | 297 |
#colorMap8 |
298 |
'Convert to depth-8 image.' |
|
299 |
||
300 |
#colorMap8M |
|
301 |
'Convert to depth-8 image plus mask.' |
|
302 |
||
986 | 303 |
#colorMapTable |
304 |
'Shows a list of used colors of the image.' |
|
305 |
||
929 | 306 |
#compressColormap |
307 |
'Remove unneeded entries from the colorMap.' |
|
460 | 308 |
|
1045 | 309 |
#cropAll |
986 | 310 |
'Find and remove all borders.' |
311 |
||
1045 | 312 |
#cropBottom |
986 | 313 |
'Find and remove bottom border.' |
314 |
||
1045 | 315 |
#cropLeft |
986 | 316 |
'Find and remove left border.' |
317 |
||
1045 | 318 |
#cropManual |
986 | 319 |
'Specify border(s) to remove.' |
320 |
||
1045 | 321 |
#cropRight |
986 | 322 |
'Find and remove right border.' |
323 |
||
1045 | 324 |
#cropTop |
986 | 325 |
'Find and remove top border.' |
487 | 326 |
|
460 | 327 |
#drawModeBox |
1637 | 328 |
'Rectangle Drawing Mode.' |
460 | 329 |
|
330 |
#drawModeCopy |
|
1637 | 331 |
'Area Copy Mode.' |
460 | 332 |
|
333 |
#drawModeFill |
|
1637 | 334 |
'Flood Fill Mode.' |
460 | 335 |
|
336 |
#drawModeFilledBox |
|
1637 | 337 |
'Filled Rectangle Drawing Mode.' |
460 | 338 |
|
339 |
#drawModePaste |
|
1637 | 340 |
'Paste Mode.' |
914 | 341 |
|
342 |
#drawModePasteUnder |
|
1637 | 343 |
'Paste-Under Mode.' |
344 |
||
345 |
#drawModePasteWithMask |
|
346 |
'Paste-with-Mask Mode.' |
|
460 | 347 |
|
348 |
#drawModePoint |
|
1637 | 349 |
'Point Drawing Mode.' |
460 | 350 |
|
1639 | 351 |
#drawModeSpecial |
352 |
'Special Operations' |
|
353 |
||
460 | 354 |
#editFlipHorizontal |
1637 | 355 |
'Flip the image horizontally.' |
460 | 356 |
|
357 |
#editFlipVertical |
|
1637 | 358 |
'Flip the image vertically.' |
460 | 359 |
|
360 |
#editMagnifyImage |
|
914 | 361 |
'Magnify the image.' |
460 | 362 |
|
363 |
#editNegate |
|
914 | 364 |
'Invert the images colors.' |
460 | 365 |
|
366 |
#editResize |
|
914 | 367 |
'Resize the image (preserving the old image).' |
460 | 368 |
|
369 |
#editRotate |
|
914 | 370 |
'Rotate the image.' |
460 | 371 |
|
929 | 372 |
#fileGrabImage |
373 |
'Pick an image from the screen.' |
|
374 |
||
460 | 375 |
#fileLoadFromClass |
929 | 376 |
'Select and load an image from a resource method.' |
460 | 377 |
|
378 |
#fileLoadFromFile |
|
929 | 379 |
'Select and load an image from a file.' |
460 | 380 |
|
381 |
#fileNewImage |
|
914 | 382 |
'Create a new image' |
460 | 383 |
|
384 |
#filePrint |
|
385 |
'Print the image on a postscript printer.' |
|
386 |
||
387 |
#fileSaveAs |
|
914 | 388 |
'Save the image to a file.' |
460 | 389 |
|
390 |
#fileSaveMaskAs |
|
914 | 391 |
'Save the mask of the image to a file.' |
460 | 392 |
|
1613 | 393 |
#fileSaveButtonImageAs |
394 |
'Save an image of a button with the image to a file (for html use).' |
|
395 |
||
460 | 396 |
#fileSaveMethod |
914 | 397 |
'Save the image as resource method in the current class and selector.' |
460 | 398 |
|
399 |
#fileSaveMethodAs |
|
914 | 400 |
'Save the image as resource method in a class.' |
460 | 401 |
|
487 | 402 |
#magnificationNumber |
914 | 403 |
'Shows the current magnification.' |
487 | 404 |
|
405 |
#magnifyImageDown |
|
914 | 406 |
'Decrease magnification.' |
487 | 407 |
|
408 |
#magnifyImageUp |
|
914 | 409 |
'Increase magnification.' |
487 | 410 |
|
411 |
#mouseKeyColorMode |
|
1637 | 412 |
'Toggle between left and right mouse button color.' |
487 | 413 |
|
414 |
#previewView |
|
914 | 415 |
'Shows a preview of the image.' |
487 | 416 |
|
905 | 417 |
#settingsGridMagnification |
914 | 418 |
'Change the grid magnification of the edit view.' |
905 | 419 |
|
460 | 420 |
) |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
421 |
|
986 | 422 |
"Modified: / 7.9.1998 / 18:20:26 / cg" |
460 | 423 |
! ! |
424 |
||
737 | 425 |
!ImageEditor class methodsFor:'image specs'! |
426 |
||
1637 | 427 |
copyIcon |
428 |
"This resource specification was automatically generated |
|
429 |
by the ImageEditor of ST/X." |
|
430 |
||
431 |
"Do not manually edit this!! If it is corrupted, |
|
432 |
the ImageEditor may not be able to read the specification." |
|
433 |
||
434 |
" |
|
435 |
self copyIcon inspect |
|
436 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
437 |
Icon flushCachedIcons |
|
438 |
" |
|
439 |
||
440 |
<resource: #image> |
|
441 |
||
442 |
^Icon |
|
443 |
constantNamed:#'ImageEditor class copyIcon' |
|
444 |
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] |
|
445 |
! |
|
446 |
||
447 |
fillIcon |
|
448 |
"This resource specification was automatically generated |
|
449 |
by the ImageEditor of ST/X." |
|
450 |
||
451 |
"Do not manually edit this!! If it is corrupted, |
|
452 |
the ImageEditor may not be able to read the specification." |
|
453 |
||
454 |
" |
|
455 |
self fillIcon inspect |
|
456 |
ImageEditor openOnClass:self andSelector:#fillIcon |
|
457 |
Icon flushCachedIcons |
|
458 |
" |
|
459 |
||
460 |
<resource: #image> |
|
461 |
||
462 |
^Icon |
|
463 |
constantNamed:#'ImageEditor class fillIcon' |
|
464 |
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] |
|
465 |
! |
|
466 |
||
467 |
fillRectIcon |
|
468 |
"This resource specification was automatically generated |
|
469 |
by the ImageEditor of ST/X." |
|
470 |
||
471 |
"Do not manually edit this!! If it is corrupted, |
|
472 |
the ImageEditor may not be able to read the specification." |
|
473 |
||
474 |
" |
|
475 |
self fillRectIcon inspect |
|
476 |
ImageEditor openOnClass:self andSelector:#fillRectIcon |
|
477 |
Icon flushCachedIcons |
|
478 |
" |
|
479 |
||
480 |
<resource: #image> |
|
481 |
||
482 |
^Icon |
|
483 |
constantNamed:#'ImageEditor class fillRectIcon' |
|
484 |
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] |
|
485 |
! |
|
486 |
||
737 | 487 |
leftMouseKeyIcon |
488 |
"This resource specification was automatically generated |
|
489 |
by the ImageEditor of ST/X." |
|
490 |
||
491 |
"Do not manually edit this!! If it is corrupted, |
|
492 |
the ImageEditor may not be able to read the specification." |
|
493 |
||
494 |
" |
|
1405 | 495 |
self leftMouseKeyIcon inspect |
737 | 496 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
497 |
" |
|
498 |
||
499 |
<resource: #image> |
|
500 |
||
501 |
^Icon |
|
502 |
constantNamed:#'ImageEditor leftMouseKeyIcon' |
|
1433 | 503 |
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] |
504 |
! |
|
737 | 505 |
|
1637 | 506 |
pasteIcon |
507 |
"This resource specification was automatically generated |
|
508 |
by the ImageEditor of ST/X." |
|
509 |
||
510 |
"Do not manually edit this!! If it is corrupted, |
|
511 |
the ImageEditor may not be able to read the specification." |
|
512 |
||
513 |
" |
|
514 |
self pasteIcon inspect |
|
515 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
516 |
Icon flushCachedIcons |
|
517 |
" |
|
518 |
||
519 |
<resource: #image> |
|
520 |
||
521 |
^Icon |
|
522 |
constantNamed:#'ImageEditor class pasteIcon' |
|
523 |
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@@SL0L0A&@@D3LC@@A @AL3@3@FX@@QDPY&Y& |
|
524 |
@@@@@@@@@@@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] |
|
525 |
! |
|
526 |
||
527 |
pasteUnderIcon |
|
528 |
"This resource specification was automatically generated |
|
529 |
by the ImageEditor of ST/X." |
|
530 |
||
531 |
"Do not manually edit this!! If it is corrupted, |
|
532 |
the ImageEditor may not be able to read the specification." |
|
533 |
||
534 |
" |
|
535 |
self pasteUnderIcon inspect |
|
536 |
ImageEditor openOnClass:self andSelector:#pasteUnderIcon |
|
537 |
Icon flushCachedIcons |
|
538 |
" |
|
539 |
||
540 |
<resource: #image> |
|
541 |
||
542 |
^Icon |
|
543 |
constantNamed:#'ImageEditor class pasteUnderIcon' |
|
544 |
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@@SL0L0A&@@D3LC@@A @AL3@3@FX@@QDPY&Y& |
|
545 |
@@@@@@@@@@@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] |
|
546 |
! |
|
547 |
||
548 |
pasteWithMaskIcon |
|
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 pasteWithMaskIcon inspect |
|
557 |
ImageEditor openOnClass:self andSelector:#pasteWithMaskIcon |
|
558 |
Icon flushCachedIcons |
|
559 |
" |
|
560 |
||
561 |
<resource: #image> |
|
562 |
||
563 |
^Icon |
|
564 |
constantNamed:#'ImageEditor class pasteWithMaskIcon' |
|
565 |
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& |
|
566 |
@@@@@@@@@@@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] |
|
567 |
! |
|
568 |
||
569 |
pointIcon |
|
570 |
"This resource specification was automatically generated |
|
571 |
by the ImageEditor of ST/X." |
|
572 |
||
573 |
"Do not manually edit this!! If it is corrupted, |
|
574 |
the ImageEditor may not be able to read the specification." |
|
575 |
||
576 |
" |
|
577 |
self pointIcon inspect |
|
578 |
ImageEditor openOnClass:self andSelector:#pointIcon |
|
579 |
Icon flushCachedIcons |
|
580 |
" |
|
581 |
||
582 |
<resource: #image> |
|
583 |
||
584 |
^Icon |
|
585 |
constantNamed:#'ImageEditor class pointIcon' |
|
586 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@B@@@@@@@@@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@B@@@@@@@@@a') ; yourself); yourself] |
|
587 |
! |
|
588 |
||
589 |
rectIcon |
|
590 |
"This resource specification was automatically generated |
|
591 |
by the ImageEditor of ST/X." |
|
592 |
||
593 |
"Do not manually edit this!! If it is corrupted, |
|
594 |
the ImageEditor may not be able to read the specification." |
|
595 |
||
596 |
" |
|
597 |
self rectIcon inspect |
|
598 |
ImageEditor openOnClass:self andSelector:#rectIcon |
|
599 |
Icon flushCachedIcons |
|
600 |
" |
|
601 |
||
602 |
<resource: #image> |
|
603 |
||
604 |
^Icon |
|
605 |
constantNamed:#'ImageEditor class rectIcon' |
|
606 |
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] |
|
607 |
! |
|
608 |
||
737 | 609 |
rightMouseKeyIcon |
610 |
"This resource specification was automatically generated |
|
611 |
by the ImageEditor of ST/X." |
|
612 |
||
613 |
"Do not manually edit this!! If it is corrupted, |
|
614 |
the ImageEditor may not be able to read the specification." |
|
615 |
||
616 |
" |
|
1405 | 617 |
self rightMouseKeyIcon inspect |
737 | 618 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
619 |
" |
|
620 |
||
621 |
<resource: #image> |
|
622 |
||
623 |
^Icon |
|
624 |
constantNamed:#'ImageEditor rightMouseKeyIcon' |
|
1433 | 625 |
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 | 626 |
! |
627 |
||
628 |
specialIcon |
|
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 |
" |
|
636 |
self specialIcon inspect |
|
637 |
ImageEditor openOnClass:self andSelector:#specialIcon |
|
638 |
Icon flushCachedIcons |
|
639 |
" |
|
640 |
||
641 |
<resource: #image> |
|
642 |
||
643 |
^Icon |
|
644 |
constantNamed:#'ImageEditor class specialIcon' |
|
645 |
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] |
|
1433 | 646 |
! ! |
737 | 647 |
|
400 | 648 |
!ImageEditor class methodsFor:'interface specs'! |
649 |
||
767 | 650 |
dialogSpecForNewImage |
737 | 651 |
"This resource specification was automatically generated |
652 |
by the UIPainter of ST/X." |
|
519 | 653 |
|
737 | 654 |
"Do not manually edit this!! If it is corrupted, |
655 |
the UIPainter may not be able to read the specification." |
|
519 | 656 |
|
657 |
" |
|
767 | 658 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
659 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 660 |
" |
661 |
||
662 |
<resource: #canvas> |
|
663 |
||
664 |
^ |
|
665 |
||
666 |
#(#FullSpec |
|
672 | 667 |
#window: |
519 | 668 |
#(#WindowSpec |
672 | 669 |
#name: 'New Image' |
975 | 670 |
#layout: #(#LayoutFrame 81 0 288 0 381 0 406 0) |
672 | 671 |
#label: 'New Image' |
672 |
#min: #(#Point 10 10) |
|
673 |
#max: #(#Point 1152 900) |
|
975 | 674 |
#bounds: #(#Rectangle 81 288 382 407) |
672 | 675 |
#usePreferredExtent: false |
519 | 676 |
) |
672 | 677 |
#component: |
519 | 678 |
#(#SpecCollection |
672 | 679 |
#collection: |
519 | 680 |
#( |
681 |
#(#ViewSpec |
|
672 | 682 |
#name: 'View' |
737 | 683 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
672 | 684 |
#component: |
519 | 685 |
#(#SpecCollection |
672 | 686 |
#collection: |
519 | 687 |
#( |
688 |
#(#FramedBoxSpec |
|
672 | 689 |
#name: 'framedBox1' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
690 |
#layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0) |
672 | 691 |
#component: |
519 | 692 |
#(#SpecCollection |
672 | 693 |
#collection: |
519 | 694 |
#( |
695 |
#(#ComboBoxSpec |
|
672 | 696 |
#name: 'defaultSizesComboBox' |
975 | 697 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 698 |
#model: #selectionOfSize |
699 |
#type: #string |
|
700 |
#comboList: #listOfDefaultSizes |
|
519 | 701 |
) |
702 |
) |
|
703 |
) |
|
672 | 704 |
#label: 'Size' |
705 |
#labelPosition: #topLeft |
|
706 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 707 |
) |
708 |
#(#FramedBoxSpec |
|
672 | 709 |
#name: 'framedBox2' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
710 |
#layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0) |
672 | 711 |
#component: |
519 | 712 |
#(#SpecCollection |
672 | 713 |
#collection: |
519 | 714 |
#( |
715 |
#(#ComboListSpec |
|
672 | 716 |
#name: 'colorMapComboBox' |
975 | 717 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 718 |
#model: #selectionOfColorMap |
719 |
#comboList: #listOfColorMaps |
|
720 |
#useIndex: false |
|
519 | 721 |
) |
722 |
) |
|
723 |
) |
|
672 | 724 |
#label: 'Color Map' |
725 |
#labelPosition: #topLeft |
|
726 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 727 |
) |
728 |
) |
|
729 |
) |
|
672 | 730 |
#level: 1 |
519 | 731 |
) |
672 | 732 |
#(#UISubSpecification |
975 | 733 |
#name: 'windowSpecForCommitWithoutChannels' |
737 | 734 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
672 | 735 |
#minorKey: #windowSpecForCommitWithoutChannels |
519 | 736 |
) |
737 |
) |
|
738 |
) |
|
739 |
) |
|
767 | 740 |
! |
741 |
||
1045 | 742 |
gropDialogSpec |
986 | 743 |
"This resource specification was automatically generated |
744 |
by the UIPainter of ST/X." |
|
745 |
||
746 |
"Do not manually edit this!! If it is corrupted, |
|
747 |
the UIPainter may not be able to read the specification." |
|
748 |
||
749 |
" |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
750 |
UIPainter new openOnClass:ImageEditor andSelector:#gropDialogSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
751 |
ImageEditor new openInterface:#gropDialogSpec |
986 | 752 |
" |
753 |
||
754 |
<resource: #canvas> |
|
755 |
||
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
756 |
^ |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
757 |
#(#FullSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
758 |
#name: #gropDialogSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
759 |
#window: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
760 |
#(#WindowSpec |
1480 | 761 |
#label: 'Crop Border(s)' |
1490 | 762 |
#name: 'Crop Border(s)' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
763 |
#min: #(#Point 10 10) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
764 |
#max: #(#Point 800 478) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
765 |
#bounds: #(#Rectangle 16 46 261 229) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
766 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
767 |
#component: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
768 |
#(#SpecCollection |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
769 |
#collection: #( |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
770 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
771 |
#label: 'Left:' |
1502 | 772 |
#name: 'GropLeftLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
773 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
774 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
775 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
776 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
777 |
#(#InputFieldSpec |
1502 | 778 |
#name: 'GropLeftEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
779 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
1507 | 780 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
781 |
#model: #left |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
782 |
#type: #number |
1502 | 783 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
784 |
#acceptOnPointerLeave: false |
1502 | 785 |
) |
786 |
#(#ActionButtonSpec |
|
787 |
#label: 'Now' |
|
788 |
#name: 'GropLeftNowButton' |
|
789 |
#layout: #(#LayoutFrame 148 0 21 0 221 0 43 0) |
|
790 |
#translateLabel: true |
|
1507 | 791 |
#tabable: true |
1502 | 792 |
#model: #gropLeftNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
793 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
794 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
795 |
#label: 'Right:' |
1502 | 796 |
#name: 'GropRightLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
797 |
#layout: #(#LayoutFrame 14 0 51 0 90 0 73 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
798 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
799 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
800 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
801 |
#(#InputFieldSpec |
1502 | 802 |
#name: 'GropRightEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
803 |
#layout: #(#LayoutFrame 95 0 51 0 132 0 73 0) |
1507 | 804 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
805 |
#model: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
806 |
#type: #number |
1502 | 807 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
808 |
#acceptOnPointerLeave: false |
1502 | 809 |
) |
810 |
#(#ActionButtonSpec |
|
811 |
#label: 'Now' |
|
812 |
#name: 'GropRightButton' |
|
813 |
#layout: #(#LayoutFrame 148 0 51 0 221 0 73 0) |
|
814 |
#translateLabel: true |
|
1507 | 815 |
#tabable: true |
1502 | 816 |
#model: #gropRightNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
817 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
818 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
819 |
#label: 'Top:' |
1502 | 820 |
#name: 'GropTopLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
821 |
#layout: #(#LayoutFrame 14 0 81 0 90 0 103 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
822 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
823 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
824 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
825 |
#(#InputFieldSpec |
1502 | 826 |
#name: 'GropTopEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
827 |
#layout: #(#LayoutFrame 95 0 81 0 132 0 103 0) |
1507 | 828 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
829 |
#model: #top |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
830 |
#type: #number |
1502 | 831 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
832 |
#acceptOnPointerLeave: false |
1502 | 833 |
) |
834 |
#(#ActionButtonSpec |
|
835 |
#label: 'Now' |
|
836 |
#name: 'GropTopButton' |
|
837 |
#layout: #(#LayoutFrame 148 0 81 0 221 0 103 0) |
|
838 |
#translateLabel: true |
|
1507 | 839 |
#tabable: true |
1502 | 840 |
#model: #gropTopNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
841 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
842 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
843 |
#label: 'Bottom:' |
1502 | 844 |
#name: 'GropBottomLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
845 |
#layout: #(#LayoutFrame 14 0 111 0 90 0 133 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
846 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
847 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
848 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
849 |
#(#InputFieldSpec |
1502 | 850 |
#name: 'GropBottomEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
851 |
#layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
1507 | 852 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
853 |
#model: #bottom |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
854 |
#type: #number |
1502 | 855 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
856 |
#acceptOnPointerLeave: false |
1502 | 857 |
) |
858 |
#(#ActionButtonSpec |
|
859 |
#label: 'Now' |
|
860 |
#name: 'GropBottomButton' |
|
861 |
#layout: #(#LayoutFrame 148 0 111 0 221 0 133 0) |
|
862 |
#translateLabel: true |
|
1507 | 863 |
#tabable: true |
1502 | 864 |
#model: #gropBottomNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
865 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
866 |
#(#HorizontalPanelViewSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
867 |
#name: 'HorizontalPanel1' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
868 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
869 |
#horizontalLayout: #fitSpace |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
870 |
#verticalLayout: #center |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
871 |
#horizontalSpace: 3 |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
872 |
#verticalSpace: 3 |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
873 |
#reverseOrderIfOKAtLeft: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
874 |
#component: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
875 |
#(#SpecCollection |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
876 |
#collection: #( |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
877 |
#(#ActionButtonSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
878 |
#label: 'Cancel' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
879 |
#name: 'Button1' |
986 | 880 |
#translateLabel: true |
1507 | 881 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
882 |
#model: #cancel |
1490 | 883 |
#extent: #(#Point 77 22) |
884 |
) |
|
885 |
#(#ActionButtonSpec |
|
886 |
#label: 'Apply' |
|
887 |
#name: 'Button3' |
|
888 |
#translateLabel: true |
|
1507 | 889 |
#tabable: true |
1490 | 890 |
#model: #applyAction |
891 |
#extent: #(#Point 78 22) |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
892 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
893 |
#(#ActionButtonSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
894 |
#label: 'OK' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
895 |
#name: 'Button2' |
986 | 896 |
#translateLabel: true |
1507 | 897 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
898 |
#model: #accept |
1490 | 899 |
#extent: #(#Point 78 22) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
900 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
901 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
902 |
|
986 | 903 |
) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
904 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
905 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
906 |
|
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
907 |
) |
986 | 908 |
) |
909 |
! |
|
910 |
||
1557 | 911 |
shiftDialogSpec |
912 |
"This resource specification was automatically generated |
|
913 |
by the UIPainter of ST/X." |
|
914 |
||
915 |
"Do not manually edit this!! If it is corrupted, |
|
916 |
the UIPainter may not be able to read the specification." |
|
917 |
||
918 |
" |
|
919 |
UIPainter new openOnClass:ImageEditor andSelector:#shiftDialogSpec |
|
920 |
ImageEditor new openInterface:#shiftDialogSpec |
|
921 |
" |
|
922 |
||
923 |
<resource: #canvas> |
|
924 |
||
925 |
^ |
|
926 |
#(#FullSpec |
|
927 |
#name: #shiftDialogSpec |
|
928 |
#window: |
|
929 |
#(#WindowSpec |
|
930 |
#label: 'Shift' |
|
931 |
#name: 'Shift' |
|
932 |
#min: #(#Point 10 10) |
|
933 |
#max: #(#Point 800 478) |
|
934 |
#bounds: #(#Rectangle 16 46 261 229) |
|
935 |
) |
|
936 |
#component: |
|
937 |
#(#SpecCollection |
|
938 |
#collection: #( |
|
939 |
#(#LabelSpec |
|
940 |
#label: 'Amount:' |
|
941 |
#name: 'AmountLabel' |
|
942 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
|
943 |
#translateLabel: true |
|
944 |
#adjust: #right |
|
945 |
) |
|
946 |
#(#InputFieldSpec |
|
947 |
#name: 'AmountEntryField' |
|
948 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
|
949 |
#tabable: true |
|
950 |
#model: #shiftAmount |
|
951 |
#type: #number |
|
952 |
#acceptChannel: #acceptChannel |
|
953 |
#acceptOnPointerLeave: false |
|
954 |
) |
|
955 |
#(#HorizontalPanelViewSpec |
|
956 |
#name: 'HorizontalPanel1' |
|
957 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
958 |
#horizontalLayout: #fitSpace |
|
959 |
#verticalLayout: #center |
|
960 |
#horizontalSpace: 3 |
|
961 |
#verticalSpace: 3 |
|
962 |
#reverseOrderIfOKAtLeft: true |
|
963 |
#component: |
|
964 |
#(#SpecCollection |
|
965 |
#collection: #( |
|
966 |
#(#ActionButtonSpec |
|
967 |
#label: 'Cancel' |
|
968 |
#name: 'Button1' |
|
969 |
#translateLabel: true |
|
970 |
#tabable: true |
|
971 |
#model: #cancel |
|
972 |
#extent: #(#Point 118 22) |
|
973 |
) |
|
974 |
#(#ActionButtonSpec |
|
975 |
#label: 'OK' |
|
976 |
#name: 'Button2' |
|
977 |
#translateLabel: true |
|
978 |
#tabable: true |
|
979 |
#model: #accept |
|
980 |
#extent: #(#Point 118 22) |
|
981 |
) |
|
982 |
) |
|
983 |
||
984 |
) |
|
985 |
) |
|
986 |
#(#ArrowButtonSpec |
|
987 |
#name: 'ArrowButton1' |
|
988 |
#layout: #(#LayoutFrame 105 0 67 0 127 0 89 0) |
|
989 |
#model: #shiftUpNow |
|
990 |
#isTriggerOnDown: true |
|
991 |
#actionValue: '' |
|
992 |
#direction: #up |
|
993 |
) |
|
994 |
#(#ArrowButtonSpec |
|
995 |
#name: 'ArrowButton2' |
|
996 |
#layout: #(#LayoutFrame 88 0 86 0 110 0 108 0) |
|
997 |
#model: #shiftLeftNow |
|
998 |
#isTriggerOnDown: true |
|
999 |
#actionValue: '' |
|
1000 |
#direction: #left |
|
1001 |
) |
|
1002 |
#(#ArrowButtonSpec |
|
1003 |
#name: 'ArrowButton3' |
|
1004 |
#layout: #(#LayoutFrame 122 0 86 0 144 0 108 0) |
|
1005 |
#model: #shiftRightNow |
|
1006 |
#isTriggerOnDown: true |
|
1007 |
#actionValue: '' |
|
1008 |
#direction: #right |
|
1009 |
) |
|
1010 |
#(#ArrowButtonSpec |
|
1011 |
#name: 'ArrowButton4' |
|
1012 |
#layout: #(#LayoutFrame 105 0 103 0 127 0 125 0) |
|
1013 |
#model: #shiftDownNow |
|
1014 |
#isTriggerOnDown: true |
|
1015 |
#actionValue: '' |
|
1016 |
#direction: #down |
|
1017 |
) |
|
1018 |
) |
|
1019 |
||
1020 |
) |
|
1021 |
) |
|
1022 |
! |
|
1023 |
||
1480 | 1024 |
ungropDialogSpec |
1025 |
"This resource specification was automatically generated |
|
1026 |
by the UIPainter of ST/X." |
|
1027 |
||
1028 |
"Do not manually edit this!! If it is corrupted, |
|
1029 |
the UIPainter may not be able to read the specification." |
|
1030 |
||
1031 |
" |
|
1032 |
UIPainter new openOnClass:ImageEditor andSelector:#ungropDialogSpec |
|
1033 |
ImageEditor new openInterface:#ungropDialogSpec |
|
1034 |
" |
|
1035 |
||
1036 |
<resource: #canvas> |
|
1037 |
||
1038 |
^ |
|
1039 |
#(#FullSpec |
|
1040 |
#name: #ungropDialogSpec |
|
1041 |
#window: |
|
1042 |
#(#WindowSpec |
|
1043 |
#label: 'Add Border(s)' |
|
1044 |
#name: 'Add Borders' |
|
1045 |
#min: #(#Point 10 10) |
|
1046 |
#max: #(#Point 800 478) |
|
1047 |
#bounds: #(#Rectangle 16 46 261 229) |
|
1048 |
) |
|
1049 |
#component: |
|
1050 |
#(#SpecCollection |
|
1051 |
#collection: #( |
|
1052 |
#(#LabelSpec |
|
1053 |
#label: 'Left:' |
|
1054 |
#name: 'Label1' |
|
1055 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
|
1056 |
#translateLabel: true |
|
1057 |
#adjust: #right |
|
1058 |
) |
|
1059 |
#(#InputFieldSpec |
|
1060 |
#name: 'EntryField1' |
|
1061 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
|
1062 |
#model: #left |
|
1063 |
#type: #number |
|
1064 |
#acceptOnPointerLeave: false |
|
1065 |
) |
|
1066 |
#(#LabelSpec |
|
1067 |
#label: 'Right:' |
|
1068 |
#name: 'Label2' |
|
1069 |
#layout: #(#LayoutFrame 14 0 51 0 90 0 73 0) |
|
1070 |
#translateLabel: true |
|
1071 |
#adjust: #right |
|
1072 |
) |
|
1073 |
#(#InputFieldSpec |
|
1074 |
#name: 'EntryField2' |
|
1075 |
#layout: #(#LayoutFrame 95 0 51 0 132 0 73 0) |
|
1076 |
#model: #right |
|
1077 |
#type: #number |
|
1078 |
#acceptOnPointerLeave: false |
|
1079 |
) |
|
1080 |
#(#LabelSpec |
|
1081 |
#label: 'Top:' |
|
1082 |
#name: 'Label3' |
|
1083 |
#layout: #(#LayoutFrame 14 0 81 0 90 0 103 0) |
|
1084 |
#translateLabel: true |
|
1085 |
#adjust: #right |
|
1086 |
) |
|
1087 |
#(#InputFieldSpec |
|
1088 |
#name: 'EntryField3' |
|
1089 |
#layout: #(#LayoutFrame 95 0 81 0 132 0 103 0) |
|
1090 |
#model: #top |
|
1091 |
#type: #number |
|
1092 |
#acceptOnPointerLeave: false |
|
1093 |
) |
|
1094 |
#(#LabelSpec |
|
1095 |
#label: 'Bottom:' |
|
1096 |
#name: 'Label4' |
|
1097 |
#layout: #(#LayoutFrame 14 0 111 0 90 0 133 0) |
|
1098 |
#translateLabel: true |
|
1099 |
#adjust: #right |
|
1100 |
) |
|
1101 |
#(#InputFieldSpec |
|
1102 |
#name: 'EntryField4' |
|
1103 |
#layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
|
1104 |
#model: #bottom |
|
1105 |
#type: #number |
|
1106 |
#acceptOnPointerLeave: false |
|
1107 |
) |
|
1108 |
#(#HorizontalPanelViewSpec |
|
1109 |
#name: 'HorizontalPanel1' |
|
1110 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
1111 |
#horizontalLayout: #fitSpace |
|
1112 |
#verticalLayout: #center |
|
1113 |
#horizontalSpace: 3 |
|
1114 |
#verticalSpace: 3 |
|
1115 |
#reverseOrderIfOKAtLeft: true |
|
1116 |
#component: |
|
1117 |
#(#SpecCollection |
|
1118 |
#collection: #( |
|
1119 |
#(#ActionButtonSpec |
|
1120 |
#label: 'Cancel' |
|
1121 |
#name: 'Button1' |
|
1122 |
#translateLabel: true |
|
1123 |
#model: #cancel |
|
1124 |
#extent: #(#Point 118 22) |
|
1125 |
) |
|
1126 |
#(#ActionButtonSpec |
|
1127 |
#label: 'OK' |
|
1128 |
#name: 'Button2' |
|
1129 |
#translateLabel: true |
|
1130 |
#model: #accept |
|
1131 |
#extent: #(#Point 118 22) |
|
1132 |
) |
|
1133 |
) |
|
1134 |
||
1135 |
) |
|
1136 |
) |
|
1137 |
) |
|
1138 |
||
1139 |
) |
|
1140 |
) |
|
1141 |
! |
|
1142 |
||
767 | 1143 |
windowSpec |
1144 |
"This resource specification was automatically generated |
|
1145 |
by the UIPainter of ST/X." |
|
1146 |
||
1147 |
"Do not manually edit this!! If it is corrupted, |
|
1148 |
the UIPainter may not be able to read the specification." |
|
1149 |
||
1150 |
" |
|
1151 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
1152 |
ImageEditor new openInterface:#windowSpec |
|
1153 |
ImageEditor open |
|
1154 |
" |
|
1155 |
||
1156 |
<resource: #canvas> |
|
1157 |
||
1558 | 1158 |
^ |
1159 |
#(#FullSpec |
|
1160 |
#name: #windowSpec |
|
1161 |
#window: |
|
1162 |
#(#WindowSpec |
|
1163 |
#label: 'Image Editor' |
|
1164 |
#name: 'Image Editor' |
|
1165 |
#min: #(#Point 400 320) |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1166 |
#bounds: #(#Rectangle 16 46 466 396) |
1558 | 1167 |
#menu: #menu |
1168 |
) |
|
1169 |
#component: |
|
1170 |
#(#SpecCollection |
|
1171 |
#collection: #( |
|
1172 |
#(#MenuPanelSpec |
|
1173 |
#name: 'menuToolbarView' |
|
1174 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1175 |
#menu: #menuToolbar |
|
1176 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
1177 |
#showSeparatingLines: true |
|
1178 |
) |
|
1179 |
#(#VariableHorizontalPanelSpec |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1180 |
#name: 'horizontalPanel' |
1558 | 1181 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
1637 | 1182 |
#snapMode: #both |
1183 |
#barLevel: 1 |
|
1558 | 1184 |
#component: |
1185 |
#(#SpecCollection |
|
1186 |
#collection: #( |
|
1187 |
#(#ViewSpec |
|
1637 | 1188 |
#name: 'leftView' |
1189 |
#level: 1 |
|
767 | 1190 |
#component: |
1558 | 1191 |
#(#SpecCollection |
1192 |
#collection: #( |
|
1193 |
#(#VariableVerticalPanelSpec |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1194 |
#name: 'verticalPanel' |
1558 | 1195 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1637 | 1196 |
#level: 0 |
1197 |
#snapMode: #both |
|
1558 | 1198 |
#component: |
1199 |
#(#SpecCollection |
|
1200 |
#collection: #( |
|
1201 |
#(#ViewSpec |
|
1202 |
#name: 'View1' |
|
1203 |
#component: |
|
767 | 1204 |
#(#SpecCollection |
1558 | 1205 |
#collection: #( |
1206 |
#(#MenuPanelSpec |
|
1207 |
#name: 'MouseButtonColorToolBar' |
|
1208 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
1637 | 1209 |
#level: 0 |
1558 | 1210 |
#menu: #menuMouseButtonColors |
1211 |
) |
|
1212 |
#(#DataSetSpec |
|
1213 |
#name: 'colorDataSetView' |
|
1214 |
#layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
1215 |
#activeHelpKey: #colorMapTable |
|
1216 |
#model: #selectionOfColor |
|
1217 |
#menu: #colorMapMenu |
|
1218 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
1219 |
#hasHorizontalScrollBar: true |
|
1220 |
#hasVerticalScrollBar: true |
|
1221 |
#miniScrollerHorizontal: true |
|
1222 |
#miniScrollerVertical: true |
|
1223 |
#dataList: #listOfColors |
|
1224 |
#has3Dsepartors: true |
|
1225 |
#has3Dseparators: true |
|
1226 |
#verticalSpacing: 1 |
|
1227 |
#columns: |
|
1228 |
#(#OrderedCollection |
|
1229 |
||
1230 |
#(#DataSetColumnSpec |
|
1231 |
#labelButtonType: #Button |
|
1232 |
#rendererType: #rowSelector |
|
1233 |
#backgroundSelector: #theColorItSelf: |
|
1234 |
) |
|
1235 |
#(#DataSetColumnSpec |
|
1236 |
#label: 'R' |
|
1237 |
#labelAlignment: #left |
|
1238 |
#labelButtonType: #Button |
|
1239 |
#columnAlignment: #right |
|
1240 |
#editorType: #InputField |
|
1241 |
#type: #number |
|
1242 |
#model: #redFromColor: |
|
1243 |
#writeSelector: #redAtColor:put: |
|
1244 |
#selectSelector: #canSelectRedInColor: |
|
1245 |
) |
|
1246 |
||
1247 |
#(#DataSetColumnSpec |
|
1248 |
#label: 'G' |
|
1249 |
#labelAlignment: #left |
|
1250 |
#labelButtonType: #Button |
|
1251 |
#columnAlignment: #right |
|
1252 |
#editorType: #InputField |
|
1253 |
#type: #number |
|
1254 |
#model: #greenFromColor: |
|
1255 |
#writeSelector: #greenAtColor:put: |
|
1256 |
#selectSelector: #canSelectGreenInColor: |
|
1257 |
) |
|
1258 |
#(#DataSetColumnSpec |
|
1259 |
#label: 'B' |
|
1260 |
#labelAlignment: #left |
|
1261 |
#labelButtonType: #Button |
|
1262 |
#columnAlignment: #right |
|
1263 |
#editorType: #InputField |
|
1264 |
#type: #number |
|
1265 |
#model: #blueFromColor: |
|
1266 |
#writeSelector: #blueAtColor:put: |
|
1267 |
#selectSelector: #canSelectBlueInColor: |
|
767 | 1268 |
) |
1558 | 1269 |
) |
1270 |
#columnAdaptor: #colorColumnAdaptor |
|
767 | 1271 |
) |
1558 | 1272 |
) |
1273 |
||
1274 |
) |
|
1275 |
) |
|
1276 |
#(#ArbitraryComponentSpec |
|
1277 |
#name: 'imagePreView' |
|
1278 |
#activeHelpKey: #previewView |
|
1279 |
#menu: #previewMenu |
|
1280 |
#hasHorizontalScrollBar: true |
|
1281 |
#hasVerticalScrollBar: true |
|
1282 |
#miniScrollerHorizontal: true |
|
1283 |
#miniScrollerVertical: true |
|
1284 |
#hasBorder: false |
|
1285 |
#component: #ImageView |
|
767 | 1286 |
) |
1558 | 1287 |
) |
1288 |
||
767 | 1289 |
) |
1637 | 1290 |
#handles: #(#Any 0.5 1.0) |
767 | 1291 |
) |
1558 | 1292 |
) |
1293 |
||
767 | 1294 |
) |
1558 | 1295 |
) |
1296 |
#(#ViewSpec |
|
1637 | 1297 |
#name: 'rightView' |
1558 | 1298 |
#component: |
1299 |
#(#SpecCollection |
|
1300 |
#collection: #( |
|
1637 | 1301 |
#(#MenuPanelSpec |
1302 |
#name: 'ToolBar1' |
|
1303 |
#layout: #(#LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
|
1304 |
#level: 1 |
|
1305 |
#menu: #toolsMenuToolbar |
|
1306 |
#verticalLayout: true |
|
1307 |
#centerItems: true |
|
1308 |
#textDefault: true |
|
1558 | 1309 |
) |
1637 | 1310 |
#(#ViewSpec |
1311 |
#name: 'editingView' |
|
1312 |
#layout: #(#LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
|
1313 |
#level: 1 |
|
1314 |
#component: |
|
1315 |
#(#SpecCollection |
|
1316 |
#collection: #( |
|
1317 |
#(#ArbitraryComponentSpec |
|
1318 |
#name: 'imageEditView' |
|
1319 |
#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
1320 |
#hasHorizontalScrollBar: true |
|
1321 |
#hasVerticalScrollBar: true |
|
1322 |
#hasBorder: false |
|
1323 |
#component: #ImageEditView |
|
1324 |
) |
|
1325 |
#(#LabelSpec |
|
1326 |
#name: 'coordLabel' |
|
1327 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
1328 |
#level: -1 |
|
1329 |
#labelChannel: #imageInfoHolder |
|
1330 |
#resizeForLabel: false |
|
1331 |
#adjust: #left |
|
1332 |
) |
|
1333 |
#(#ArrowButtonSpec |
|
1334 |
#name: 'magnifyDownButton' |
|
1335 |
#layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
1336 |
#activeHelpKey: #magnifyImageDown |
|
1337 |
#model: #doMagnifyDown |
|
1338 |
#enableChannel: #imageIsLoaded |
|
1339 |
#isTriggerOnDown: true |
|
1340 |
#direction: #left |
|
1341 |
) |
|
1342 |
#(#ArrowButtonSpec |
|
1343 |
#name: 'magnifyUpButton' |
|
1344 |
#layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
1345 |
#activeHelpKey: #magnifyImageUp |
|
1346 |
#model: #doMagnifyUp |
|
1347 |
#enableChannel: #imageIsLoaded |
|
1348 |
#isTriggerOnDown: true |
|
1349 |
#direction: #right |
|
1350 |
) |
|
1351 |
#(#InputFieldSpec |
|
1352 |
#name: 'magnificationInputField' |
|
1353 |
#layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
1354 |
#activeHelpKey: #magnificationNumber |
|
1355 |
#enableChannel: #imageIsLoaded |
|
1356 |
#model: #valueOfMagnification |
|
1357 |
#type: #numberInRange |
|
1358 |
#acceptOnReturn: false |
|
1359 |
#acceptOnTab: false |
|
1360 |
#numChars: 2 |
|
1361 |
#minValue: 1 |
|
1362 |
#maxValue: 99 |
|
1363 |
#acceptOnPointerLeave: false |
|
1364 |
) |
|
1365 |
) |
|
1366 |
||
1367 |
) |
|
1558 | 1368 |
) |
1369 |
) |
|
1370 |
||
1371 |
) |
|
1372 |
) |
|
1373 |
) |
|
1374 |
||
767 | 1375 |
) |
1637 | 1376 |
#handles: #(#Any 0.3 1.0) |
1558 | 1377 |
) |
1378 |
#(#UISubSpecification |
|
1379 |
#name: 'infoBarSubSpec' |
|
1380 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
1381 |
#majorKey: #ToolApplicationModel |
|
1382 |
#minorKey: #windowSpecForInfoBar |
|
1383 |
) |
|
1384 |
) |
|
1385 |
||
1386 |
) |
|
767 | 1387 |
) |
519 | 1388 |
! ! |
1389 |
||
1390 |
!ImageEditor class methodsFor:'menu specs'! |
|
1391 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1392 |
colorMapMenu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1393 |
"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
|
1394 |
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
|
1395 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1396 |
"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
|
1397 |
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
|
1398 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1399 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1400 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuSpec |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1401 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuSpec)) startUp |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1402 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1403 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1404 |
<resource: #menu> |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1405 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1406 |
^ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1407 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1408 |
#(#Menu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1409 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1410 |
#( |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1411 |
#(#MenuItem |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1412 |
#label: 'Add Color' |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1413 |
#translateLabel: true |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1414 |
#value: #addColorToColormap |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1415 |
) |
1544 | 1416 |
#(#MenuItem |
1417 |
#label: '-' |
|
1418 |
) |
|
1419 |
#(#MenuItem |
|
1420 |
#label: 'Inspect Color' |
|
1421 |
#translateLabel: true |
|
1422 |
#value: #inspectColor |
|
1423 |
) |
|
1446 | 1424 |
"/ #(#MenuItem |
1425 |
"/ #label: 'Make Brighter' |
|
1426 |
"/ #translateLabel: true |
|
1427 |
"/ #value: #makeSelectedColorBrighter |
|
1428 |
"/ ) |
|
1429 |
"/ #(#MenuItem |
|
1430 |
"/ #label: 'Make Darker' |
|
1431 |
"/ #translateLabel: true |
|
1432 |
"/ #value: #makeSelectedColorDarker |
|
1433 |
"/ ) |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1434 |
) nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1435 |
nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1436 |
) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1437 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1438 |
"Created: / 12.3.1999 / 00:19:00 / cg" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1439 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1440 |
|
400 | 1441 |
menu |
737 | 1442 |
"This resource specification was automatically generated |
1443 |
by the MenuEditor of ST/X." |
|
400 | 1444 |
|
737 | 1445 |
"Do not manually edit this!! If it is corrupted, |
1446 |
the MenuEditor may not be able to read the specification." |
|
400 | 1447 |
|
1448 |
" |
|
1449 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
1450 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
1451 |
" |
|
1452 |
||
1453 |
<resource: #menu> |
|
1454 |
||
1124 | 1455 |
^ |
1456 |
#(#Menu |
|
1457 |
#( |
|
1458 |
#(#MenuItem |
|
1637 | 1459 |
#activeHelpKey: #file |
1489 | 1460 |
#label: '&File' |
1124 | 1461 |
#translateLabel: true |
1462 |
#submenu: |
|
1463 |
#(#Menu |
|
1464 |
#( |
|
1465 |
#(#MenuItem |
|
1637 | 1466 |
#activeHelpKey: #fileNewImage |
1124 | 1467 |
#label: 'New...' |
1637 | 1468 |
#itemValue: #doNewImage |
1124 | 1469 |
#translateLabel: true |
1470 |
) |
|
1471 |
#(#MenuItem |
|
1472 |
#label: '-' |
|
1473 |
) |
|
1474 |
#(#MenuItem |
|
1637 | 1475 |
#activeHelpKey: #fileLoadFromClass |
1124 | 1476 |
#label: 'Load...' |
1637 | 1477 |
#itemValue: #doLoadFromClass |
1124 | 1478 |
#translateLabel: true |
1479 |
) |
|
1480 |
#(#MenuItem |
|
1637 | 1481 |
#activeHelpKey: #fileLoadFromFile |
1570 | 1482 |
#label: 'Load from File...' |
1637 | 1483 |
#itemValue: #doLoadFromFile |
1124 | 1484 |
#translateLabel: true |
1485 |
) |
|
1486 |
#(#MenuItem |
|
1637 | 1487 |
#activeHelpKey: #fileGrabImage |
1570 | 1488 |
#label: 'Grab from Screen' |
1637 | 1489 |
#itemValue: #grabScreenImage |
1124 | 1490 |
#translateLabel: true |
1491 |
) |
|
1492 |
#(#MenuItem |
|
1637 | 1493 |
#enabled: #imageHasNextImage |
1496 | 1494 |
#label: 'Next in Sequence' |
1637 | 1495 |
#itemValue: #nextImageInSequence |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1496 |
#translateLabel: true |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1497 |
) |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1498 |
#(#MenuItem |
1124 | 1499 |
#label: '-' |
1500 |
) |
|
1501 |
#(#MenuItem |
|
1502 |
#activeHelpKey: #fileSaveMethod |
|
1503 |
#enabled: #imageIsLoadedAndClassDefined |
|
1637 | 1504 |
#label: 'Save' |
1505 |
#itemValue: #doSaveMethod |
|
1506 |
#translateLabel: true |
|
1124 | 1507 |
) |
1508 |
#(#MenuItem |
|
1509 |
#activeHelpKey: #fileSaveMethodAs |
|
1510 |
#enabled: #imageIsLoaded |
|
1637 | 1511 |
#label: 'Save As...' |
1512 |
#itemValue: #doSaveMethodAs |
|
1513 |
#translateLabel: true |
|
1124 | 1514 |
) |
1515 |
#(#MenuItem |
|
1516 |
#label: '-' |
|
1517 |
) |
|
1518 |
#(#MenuItem |
|
1519 |
#activeHelpKey: #fileSaveAs |
|
1520 |
#enabled: #imageIsLoaded |
|
1637 | 1521 |
#label: 'Save to File...' |
1522 |
#itemValue: #doSaveImageFileAs |
|
1523 |
#translateLabel: true |
|
1124 | 1524 |
) |
1525 |
#(#MenuItem |
|
1526 |
#activeHelpKey: #fileSaveMaskAs |
|
1527 |
#enabled: #imageIsLoaded |
|
1637 | 1528 |
#label: 'Save Mask to File...' |
1529 |
#itemValue: #doSaveImageMaskFileAs |
|
1530 |
#translateLabel: true |
|
1124 | 1531 |
) |
1532 |
#(#MenuItem |
|
1613 | 1533 |
#activeHelpKey: #fileSaveButtonImageAs |
1534 |
#enabled: #imageIsLoaded |
|
1637 | 1535 |
#label: 'Save As Button to File...' |
1536 |
#itemValue: #doSaveButtonImageToFileAs |
|
1537 |
#translateLabel: true |
|
1613 | 1538 |
) |
1539 |
#(#MenuItem |
|
1124 | 1540 |
#label: '-' |
1541 |
) |
|
1542 |
#(#MenuItem |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1543 |
#activeHelpKey: #fileShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1544 |
#enabled: #imageIsLoaded |
1637 | 1545 |
#label: 'Show storeString' |
1546 |
#itemValue: #doShowStoreString |
|
1547 |
#translateLabel: true |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1548 |
) |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1549 |
#(#MenuItem |
1433 | 1550 |
#activeHelpKey: #fileEditMask |
1551 |
#enabled: #imageIsLoaded |
|
1637 | 1552 |
#label: 'Edit Mask' |
1553 |
#itemValue: #doEditMask |
|
1554 |
#translateLabel: true |
|
1433 | 1555 |
) |
1556 |
#(#MenuItem |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1557 |
#label: '-' |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1558 |
) |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1559 |
#(#MenuItem |
1124 | 1560 |
#activeHelpKey: #filePrint |
1561 |
#enabled: #imageIsLoaded |
|
1637 | 1562 |
#label: 'Print' |
1563 |
#itemValue: #doPrint |
|
1564 |
#translateLabel: true |
|
1124 | 1565 |
) |
1566 |
#(#MenuItem |
|
1567 |
#label: '-' |
|
1568 |
) |
|
1569 |
#(#MenuItem |
|
1570 |
#activeHelpKey: #fileBrowseClass |
|
1571 |
#enabled: #hasClassDefined |
|
1637 | 1572 |
#label: 'Browse Class' |
1573 |
#itemValue: #doBrowseClass |
|
1574 |
#translateLabel: true |
|
1124 | 1575 |
) |
1576 |
#(#MenuItem |
|
1577 |
#label: '-' |
|
1578 |
) |
|
1579 |
#(#MenuItem |
|
1637 | 1580 |
#activeHelpKey: #fileExit |
1124 | 1581 |
#label: 'Exit' |
1637 | 1582 |
#itemValue: #closeRequest |
1124 | 1583 |
#translateLabel: true |
1584 |
) |
|
1585 |
) |
|
1586 |
nil |
|
1587 |
nil |
|
400 | 1588 |
) |
1124 | 1589 |
) |
1590 |
#(#MenuItem |
|
1637 | 1591 |
#activeHelpKey: #edit |
1592 |
#enabled: #imageIsLoaded |
|
1124 | 1593 |
#label: 'Edit' |
1594 |
#translateLabel: true |
|
1595 |
#submenu: |
|
1596 |
#(#Menu |
|
1597 |
#( |
|
1598 |
#(#MenuItem |
|
1599 |
#activeHelpKey: #editUndo |
|
1600 |
#enabled: #valueOfCanUndo |
|
1637 | 1601 |
#label: 'Undo' |
1602 |
#itemValue: #doUndo |
|
1603 |
#translateLabel: true |
|
1124 | 1604 |
) |
1605 |
#(#MenuItem |
|
1606 |
#label: '-' |
|
1607 |
) |
|
1608 |
#(#MenuItem |
|
1637 | 1609 |
#activeHelpKey: #editFlipVertical |
1124 | 1610 |
#label: 'Flip - Vertical' |
1637 | 1611 |
#itemValue: #doFlipVertical |
1124 | 1612 |
#translateLabel: true |
1613 |
) |
|
1614 |
#(#MenuItem |
|
1637 | 1615 |
#activeHelpKey: #editFlipHorizontal |
1124 | 1616 |
#label: 'Flip - Horizontal' |
1637 | 1617 |
#itemValue: #doFlipHorizontal |
1124 | 1618 |
#translateLabel: true |
1619 |
) |
|
1620 |
#(#MenuItem |
|
1621 |
#label: '-' |
|
1622 |
) |
|
1623 |
#(#MenuItem |
|
1637 | 1624 |
#activeHelpKey: #editResize |
1124 | 1625 |
#label: 'Resize...' |
1637 | 1626 |
#itemValue: #doResizeImage |
1124 | 1627 |
#translateLabel: true |
1628 |
) |
|
1629 |
#(#MenuItem |
|
1637 | 1630 |
#activeHelpKey: #editMagnifyImage |
1124 | 1631 |
#label: 'Magnify...' |
1637 | 1632 |
#itemValue: #doMagnifyImage |
1124 | 1633 |
#translateLabel: true |
1634 |
) |
|
1635 |
#(#MenuItem |
|
1637 | 1636 |
#activeHelpKey: #editMagnifyImage |
1479 | 1637 |
#label: 'Magnify By...' |
1637 | 1638 |
#itemValue: #doMagnifyImageBy |
1479 | 1639 |
#translateLabel: true |
1640 |
) |
|
1641 |
#(#MenuItem |
|
1637 | 1642 |
#activeHelpKey: #editRotate |
1124 | 1643 |
#label: 'Rotate...' |
1637 | 1644 |
#itemValue: #doRotateImage |
1124 | 1645 |
#translateLabel: true |
1646 |
) |
|
1647 |
#(#MenuItem |
|
1648 |
#label: '-' |
|
1649 |
) |
|
1650 |
#(#MenuItem |
|
1146 | 1651 |
#label: 'Invert' |
1637 | 1652 |
#itemValue: #doNegativeImage |
1146 | 1653 |
#translateLabel: true |
1654 |
) |
|
1655 |
#(#MenuItem |
|
1656 |
#label: '-' |
|
1657 |
) |
|
1658 |
#(#MenuItem |
|
1124 | 1659 |
#label: 'Crop' |
1660 |
#translateLabel: true |
|
1661 |
#submenu: |
|
400 | 1662 |
#(#Menu |
1124 | 1663 |
#( |
1664 |
#(#MenuItem |
|
1637 | 1665 |
#activeHelpKey: #cropAll |
1124 | 1666 |
#label: 'All' |
1637 | 1667 |
#itemValue: #doCropAll |
1124 | 1668 |
#translateLabel: true |
400 | 1669 |
) |
1124 | 1670 |
#(#MenuItem |
1671 |
#label: '-' |
|
986 | 1672 |
) |
1124 | 1673 |
#(#MenuItem |
1637 | 1674 |
#activeHelpKey: #cropLeft |
1124 | 1675 |
#label: 'Left' |
1637 | 1676 |
#itemValue: #doCropLeft |
1124 | 1677 |
#translateLabel: true |
1678 |
) |
|
1679 |
#(#MenuItem |
|
1637 | 1680 |
#activeHelpKey: #cropRight |
1124 | 1681 |
#label: 'Right' |
1637 | 1682 |
#itemValue: #doCropRight |
1124 | 1683 |
#translateLabel: true |
986 | 1684 |
) |
1124 | 1685 |
#(#MenuItem |
1637 | 1686 |
#activeHelpKey: #cropTop |
1124 | 1687 |
#label: 'Top' |
1637 | 1688 |
#itemValue: #doCropTop |
1124 | 1689 |
#translateLabel: true |
672 | 1690 |
) |
1124 | 1691 |
#(#MenuItem |
1637 | 1692 |
#activeHelpKey: #cropBottom |
1124 | 1693 |
#label: 'Bottom' |
1637 | 1694 |
#itemValue: #doCropBottom |
1124 | 1695 |
#translateLabel: true |
400 | 1696 |
) |
1124 | 1697 |
#(#MenuItem |
1698 |
#label: '-' |
|
400 | 1699 |
) |
1124 | 1700 |
#(#MenuItem |
1637 | 1701 |
#activeHelpKey: #cropManual |
1124 | 1702 |
#label: 'Manual...' |
1637 | 1703 |
#itemValue: #doCropManual |
1124 | 1704 |
#translateLabel: true |
400 | 1705 |
) |
1124 | 1706 |
) |
1707 |
nil |
|
400 | 1708 |
nil |
1124 | 1709 |
) |
400 | 1710 |
) |
1489 | 1711 |
#(#MenuItem |
1637 | 1712 |
#activeHelpKey: #shiftManual |
1557 | 1713 |
#label: 'Shift...' |
1637 | 1714 |
#itemValue: #doShiftManual |
1557 | 1715 |
#translateLabel: true |
1716 |
) |
|
1717 |
#(#MenuItem |
|
1637 | 1718 |
#activeHelpKey: #uncropManual |
1489 | 1719 |
#label: 'Ungrop (Add Border)...' |
1637 | 1720 |
#itemValue: #doUnCropManual |
1489 | 1721 |
#translateLabel: true |
1722 |
) |
|
1124 | 1723 |
) |
1724 |
nil |
|
1725 |
nil |
|
400 | 1726 |
) |
1124 | 1727 |
) |
1728 |
#(#MenuItem |
|
1637 | 1729 |
#enabled: #imageIsLoaded |
1730 |
#label: 'Mode' |
|
1731 |
#translateLabel: true |
|
1732 |
#submenuChannel: #modeMenu |
|
1733 |
) |
|
1734 |
#(#MenuItem |
|
1735 |
#activeHelpKey: #colorMap |
|
1736 |
#enabled: #imageIsLoaded |
|
1124 | 1737 |
#label: 'ColorMap' |
1738 |
#translateLabel: true |
|
1739 |
#submenu: |
|
1740 |
#(#Menu |
|
1741 |
#( |
|
1742 |
#(#MenuItem |
|
1637 | 1743 |
#activeHelpKey: #colorMap8 |
1124 | 1744 |
#label: '8-Plane' |
1637 | 1745 |
#itemValue: #colorMapMode: |
1124 | 1746 |
#translateLabel: true |
1747 |
#argument: '8-plane' |
|
1748 |
#choice: #colorMapMode |
|
1749 |
#choiceValue: '8-plane' |
|
1750 |
) |
|
1751 |
#(#MenuItem |
|
1637 | 1752 |
#activeHelpKey: #colorMap4 |
1124 | 1753 |
#label: '4-Plane' |
1637 | 1754 |
#itemValue: #colorMapMode: |
1124 | 1755 |
#translateLabel: true |
1756 |
#argument: '4-plane' |
|
1757 |
#choice: #colorMapMode |
|
1758 |
#choiceValue: '4-plane' |
|
1759 |
) |
|
1760 |
#(#MenuItem |
|
1637 | 1761 |
#activeHelpKey: #colorMap2 |
1124 | 1762 |
#label: '2-Plane' |
1637 | 1763 |
#itemValue: #colorMapMode: |
1124 | 1764 |
#translateLabel: true |
1765 |
#argument: '2-plane' |
|
1766 |
#choice: #colorMapMode |
|
1767 |
#choiceValue: '2-plane' |
|
1768 |
) |
|
1769 |
#(#MenuItem |
|
1637 | 1770 |
#activeHelpKey: #colorMap1 |
1124 | 1771 |
#label: '1-Plane' |
1637 | 1772 |
#itemValue: #colorMapMode: |
1124 | 1773 |
#translateLabel: true |
1774 |
#argument: '1-plane' |
|
1775 |
#choice: #colorMapMode |
|
1776 |
#choiceValue: '1-plane' |
|
1777 |
) |
|
1778 |
#(#MenuItem |
|
1779 |
#label: '-' |
|
1780 |
) |
|
1781 |
#(#MenuItem |
|
1637 | 1782 |
#activeHelpKey: #colorMap8M |
1124 | 1783 |
#label: '8-Plane + Mask' |
1637 | 1784 |
#itemValue: #colorMapMode: |
1124 | 1785 |
#translateLabel: true |
1786 |
#argument: '8-plane + mask' |
|
1787 |
#choice: #colorMapMode |
|
1788 |
#choiceValue: '8-plane + mask' |
|
1789 |
) |
|
1790 |
#(#MenuItem |
|
1637 | 1791 |
#activeHelpKey: #colorMap4M |
1124 | 1792 |
#label: '4-Plane + Mask' |
1637 | 1793 |
#itemValue: #colorMapMode: |
1124 | 1794 |
#translateLabel: true |
1795 |
#argument: '4-plane + mask' |
|
1796 |
#choice: #colorMapMode |
|
1797 |
#choiceValue: '4-plane + mask' |
|
737 | 1798 |
) |
1124 | 1799 |
#(#MenuItem |
1637 | 1800 |
#activeHelpKey: #colorMap2M |
1124 | 1801 |
#label: '2-Plane + Mask' |
1637 | 1802 |
#itemValue: #colorMapMode: |
1124 | 1803 |
#translateLabel: true |
1804 |
#argument: '2-plane + mask' |
|
1805 |
#choice: #colorMapMode |
|
1806 |
#choiceValue: '2-plane + mask' |
|
1807 |
) |
|
1808 |
#(#MenuItem |
|
1637 | 1809 |
#activeHelpKey: #colorMap1M |
1124 | 1810 |
#label: '1-Plane + Mask' |
1637 | 1811 |
#itemValue: #colorMapMode: |
1124 | 1812 |
#translateLabel: true |
1813 |
#argument: '1-plane + mask' |
|
1814 |
#choice: #colorMapMode |
|
1815 |
#choiceValue: '1-plane + mask' |
|
1816 |
) |
|
1817 |
#(#MenuItem |
|
1818 |
#label: '-' |
|
1819 |
) |
|
1820 |
#(#MenuItem |
|
1821 |
#activeHelpKey: #compressColormap |
|
1822 |
#enabled: #hasColormap |
|
1637 | 1823 |
#label: 'Compress Colormap' |
1824 |
#itemValue: #compressColorMap |
|
1825 |
#translateLabel: true |
|
1124 | 1826 |
) |
1827 |
#(#MenuItem |
|
1637 | 1828 |
#enabled: #hasColormap |
1570 | 1829 |
#label: 'Sort Colormap' |
1637 | 1830 |
#itemValue: #sortColorMap |
1124 | 1831 |
#translateLabel: true |
1832 |
) |
|
1833 |
#(#MenuItem |
|
1598 | 1834 |
#label: 'Reduce Number of Colors...' |
1637 | 1835 |
#itemValue: #reduceNumberOfColors |
1403 | 1836 |
#translateLabel: true |
1837 |
) |
|
1838 |
#(#MenuItem |
|
1124 | 1839 |
#label: '-' |
1840 |
) |
|
1841 |
#(#MenuItem |
|
1598 | 1842 |
#label: 'Make GrayScale' |
1637 | 1843 |
#itemValue: #makeGrayScale |
1124 | 1844 |
#translateLabel: true |
1845 |
) |
|
1436 | 1846 |
#(#MenuItem |
1598 | 1847 |
#label: 'Make Brighter' |
1637 | 1848 |
#itemValue: #makeBrighter |
1598 | 1849 |
#translateLabel: true |
1850 |
) |
|
1851 |
#(#MenuItem |
|
1852 |
#label: 'Make Darker' |
|
1637 | 1853 |
#itemValue: #makeDarker |
1436 | 1854 |
#translateLabel: true |
1598 | 1855 |
) |
1856 |
#(#MenuItem |
|
1857 |
#label: 'Make Inverse' |
|
1637 | 1858 |
#itemValue: #makeInverse |
1598 | 1859 |
#translateLabel: true |
1436 | 1860 |
) |
1480 | 1861 |
#(#MenuItem |
1862 |
#label: '-' |
|
1863 |
) |
|
1864 |
#(#MenuItem |
|
1865 |
#activeHelpKey: #copyMask |
|
1866 |
#enabled: #hasMask |
|
1637 | 1867 |
#label: 'Copy Mask' |
1868 |
#itemValue: #copyMask |
|
1869 |
#translateLabel: true |
|
1480 | 1870 |
) |
1871 |
#(#MenuItem |
|
1872 |
#activeHelpKey: #pasteMask |
|
1873 |
#enabled: #hasMask |
|
1637 | 1874 |
#label: 'Paste Mask' |
1875 |
#itemValue: #pasteMask |
|
1876 |
#translateLabel: true |
|
1480 | 1877 |
) |
1598 | 1878 |
#(#MenuItem |
1879 |
#label: 'Clear Masked Pixels' |
|
1637 | 1880 |
#itemValue: #clearMaskedPixels |
1598 | 1881 |
#translateLabel: true |
1882 |
) |
|
1124 | 1883 |
) |
1884 |
nil |
|
1885 |
nil |
|
756 | 1886 |
) |
1124 | 1887 |
) |
1888 |
#(#MenuItem |
|
1889 |
#label: 'Settings' |
|
1890 |
#translateLabel: true |
|
1891 |
#submenu: |
|
1892 |
#(#Menu |
|
1893 |
#( |
|
1894 |
#(#MenuItem |
|
1637 | 1895 |
#activeHelpKey: #settingsGridMagnification |
1353 | 1896 |
#label: 'Grid Magnification Limit...' |
1637 | 1897 |
#itemValue: #doChangeGridMagnification |
1124 | 1898 |
#translateLabel: true |
1899 |
) |
|
1900 |
) |
|
1901 |
nil |
|
1902 |
nil |
|
400 | 1903 |
) |
1124 | 1904 |
) |
1905 |
#(#MenuItem |
|
1637 | 1906 |
#activeHelpKey: #history |
1124 | 1907 |
#label: 'History' |
1908 |
#translateLabel: true |
|
1909 |
#submenuChannel: #menuHistory |
|
1910 |
) |
|
1911 |
#(#MenuItem |
|
1637 | 1912 |
#activeHelpKey: #help |
1124 | 1913 |
#label: 'Help' |
1914 |
#translateLabel: true |
|
1915 |
#startGroup: #right |
|
1916 |
#submenuChannel: #menuHelp |
|
1917 |
) |
|
1918 |
) |
|
1919 |
nil |
|
1920 |
nil |
|
400 | 1921 |
) |
1922 |
! |
|
1923 |
||
679 | 1924 |
menuMouseButtonColors |
737 | 1925 |
"This resource specification was automatically generated |
1926 |
by the MenuEditor of ST/X." |
|
679 | 1927 |
|
737 | 1928 |
"Do not manually edit this!! If it is corrupted, |
1929 |
the MenuEditor may not be able to read the specification." |
|
679 | 1930 |
|
1931 |
" |
|
1932 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
1933 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
1934 |
" |
|
1935 |
||
1936 |
<resource: #menu> |
|
1937 |
||
1938 |
^ |
|
1939 |
||
1940 |
#(#Menu |
|
1941 |
||
1942 |
#( |
|
1943 |
#(#MenuItem |
|
1944 |
#label: 'Left Mouse Button' |
|
1945 |
#nameKey: #leftMouseKeyButton |
|
1946 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 1947 |
#enabled: #imageIsLoaded |
679 | 1948 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
975 | 1949 |
#choice: #mouseKeyColorMode |
1950 |
#choiceValue: 1 |
|
679 | 1951 |
) |
1952 |
#(#MenuItem |
|
1953 |
#label: 'Right Mouse Button' |
|
1954 |
#nameKey: #rightMouseKeyButton |
|
1955 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 1956 |
#enabled: #imageIsLoaded |
679 | 1957 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
975 | 1958 |
#choice: #mouseKeyColorMode |
1959 |
#choiceValue: 2 |
|
679 | 1960 |
) |
1961 |
) nil |
|
1962 |
nil |
|
1963 |
) |
|
1964 |
! |
|
1965 |
||
400 | 1966 |
menuToolbar |
737 | 1967 |
"This resource specification was automatically generated |
1968 |
by the MenuEditor of ST/X." |
|
400 | 1969 |
|
737 | 1970 |
"Do not manually edit this!! If it is corrupted, |
1971 |
the MenuEditor may not be able to read the specification." |
|
400 | 1972 |
|
1973 |
" |
|
1974 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
1975 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
1976 |
" |
|
1977 |
||
1978 |
<resource: #menu> |
|
1979 |
||
1196 | 1980 |
^ |
1981 |
#(#Menu |
|
1982 |
#( |
|
1983 |
#(#MenuItem |
|
1637 | 1984 |
#activeHelpKey: #fileNewImage |
1196 | 1985 |
#label: 'newImage' |
1637 | 1986 |
#itemValue: #doNewImage |
1987 |
#translateLabel: true |
|
1196 | 1988 |
#isButton: true |
1989 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
|
1990 |
) |
|
1991 |
#(#MenuItem |
|
1637 | 1992 |
#activeHelpKey: #fileLoadFromClass |
1196 | 1993 |
#label: 'loadFromClass' |
1637 | 1994 |
#itemValue: #doLoadFromClass |
1995 |
#translateLabel: true |
|
1196 | 1996 |
#isButton: true |
1997 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
|
1998 |
) |
|
1999 |
#(#MenuItem |
|
2000 |
#activeHelpKey: #fileSaveMethod |
|
2001 |
#enabled: #imageIsLoaded |
|
1637 | 2002 |
#label: 'saveMethod' |
2003 |
#itemValue: #doSaveMethod |
|
2004 |
#translateLabel: true |
|
2005 |
#isButton: true |
|
1196 | 2006 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
2007 |
) |
|
2008 |
#(#MenuItem |
|
2009 |
#label: '' |
|
2010 |
) |
|
2011 |
#(#MenuItem |
|
2012 |
#label: '' |
|
2013 |
) |
|
2014 |
#(#MenuItem |
|
1637 | 2015 |
#activeHelpKey: #editUndo |
2016 |
#enabled: #valueOfCanUndo |
|
2017 |
#label: 'Undo' |
|
2018 |
#itemValue: #doUndo |
|
2019 |
#translateLabel: true |
|
2020 |
#isButton: true |
|
2021 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #undo16x16Icon2) |
|
1196 | 2022 |
) |
1637 | 2023 |
) |
2024 |
nil |
|
2025 |
nil |
|
2026 |
) |
|
2027 |
! |
|
2028 |
||
2029 |
modeMenu |
|
2030 |
"This resource specification was automatically generated |
|
2031 |
by the MenuEditor of ST/X." |
|
2032 |
||
2033 |
"Do not manually edit this!! If it is corrupted, |
|
2034 |
the MenuEditor may not be able to read the specification." |
|
2035 |
||
2036 |
" |
|
2037 |
MenuEditor new openOnClass:ImageEditor andSelector:#modeMenu |
|
2038 |
(Menu new fromLiteralArrayEncoding:(ImageEditor modeMenu)) startUp |
|
2039 |
" |
|
2040 |
||
2041 |
<resource: #menu> |
|
2042 |
||
2043 |
^ |
|
2044 |
#(#Menu |
|
2045 |
#( |
|
1196 | 2046 |
#(#MenuItem |
2047 |
#activeHelpKey: #drawModePoint |
|
2048 |
#enabled: #imageIsLoaded |
|
1637 | 2049 |
#label: 'Point' |
2050 |
#translateLabel: true |
|
1196 | 2051 |
#choice: #editMode |
2052 |
#choiceValue: #point |
|
2053 |
) |
|
2054 |
#(#MenuItem |
|
2055 |
#activeHelpKey: #drawModeBox |
|
2056 |
#enabled: #imageIsLoaded |
|
1637 | 2057 |
#label: 'Rect' |
2058 |
#translateLabel: true |
|
1196 | 2059 |
#choice: #editMode |
2060 |
#choiceValue: #box |
|
2061 |
) |
|
2062 |
#(#MenuItem |
|
2063 |
#activeHelpKey: #drawModeFilledBox |
|
2064 |
#enabled: #imageIsLoaded |
|
1637 | 2065 |
#label: 'FillRect' |
2066 |
#translateLabel: true |
|
1196 | 2067 |
#choice: #editMode |
2068 |
#choiceValue: #filledBox |
|
2069 |
) |
|
2070 |
#(#MenuItem |
|
2071 |
#activeHelpKey: #drawModeFill |
|
2072 |
#enabled: #imageIsLoaded |
|
1637 | 2073 |
#label: 'Fill' |
2074 |
#translateLabel: true |
|
1196 | 2075 |
#choice: #editMode |
2076 |
#choiceValue: #fill |
|
2077 |
) |
|
2078 |
#(#MenuItem |
|
2079 |
#activeHelpKey: #drawModeCopy |
|
2080 |
#enabled: #imageIsLoaded |
|
1637 | 2081 |
#label: 'Copy' |
2082 |
#translateLabel: true |
|
1196 | 2083 |
#choice: #editMode |
2084 |
#choiceValue: #copy |
|
2085 |
) |
|
2086 |
#(#MenuItem |
|
2087 |
#activeHelpKey: #drawModePaste |
|
2088 |
#enabled: #imageIsLoaded |
|
1637 | 2089 |
#label: 'Paste' |
2090 |
#translateLabel: true |
|
1196 | 2091 |
#choice: #editMode |
2092 |
#choiceValue: #paste |
|
2093 |
) |
|
2094 |
#(#MenuItem |
|
2095 |
#activeHelpKey: #drawModePasteUnder |
|
2096 |
#enabled: #imageIsLoaded |
|
1637 | 2097 |
#label: 'Paste Under' |
2098 |
#translateLabel: true |
|
1196 | 2099 |
#choice: #editMode |
2100 |
#choiceValue: #pasteUnder |
|
2101 |
) |
|
1411 | 2102 |
#(#MenuItem |
1579 | 2103 |
#activeHelpKey: #drawModePasteWithMask |
2104 |
#enabled: #imageIsLoaded |
|
1637 | 2105 |
#label: 'Paste With Mask' |
2106 |
#translateLabel: true |
|
1579 | 2107 |
#choice: #editMode |
2108 |
#choiceValue: #pasteWithMask |
|
2109 |
) |
|
2110 |
#(#MenuItem |
|
1411 | 2111 |
#activeHelpKey: #drawModeSpecial |
2112 |
#enabled: #imageIsLoaded |
|
1637 | 2113 |
#label: 'Special' |
2114 |
#translateLabel: true |
|
1411 | 2115 |
#choice: #editMode |
2116 |
#choiceValue: #specialOperation |
|
2117 |
) |
|
1196 | 2118 |
) |
2119 |
nil |
|
2120 |
nil |
|
400 | 2121 |
) |
1558 | 2122 |
! |
2123 |
||
2124 |
previewMenu |
|
2125 |
"This resource specification was automatically generated |
|
2126 |
by the MenuEditor of ST/X." |
|
2127 |
||
2128 |
"Do not manually edit this!! If it is corrupted, |
|
2129 |
the MenuEditor may not be able to read the specification." |
|
2130 |
||
2131 |
" |
|
2132 |
MenuEditor new openOnClass:ImageEditor andSelector:#previewMenu |
|
2133 |
(Menu new fromLiteralArrayEncoding:(ImageEditor previewMenu)) startUp |
|
2134 |
" |
|
2135 |
||
2136 |
<resource: #menu> |
|
2137 |
||
2138 |
^ |
|
2139 |
#(#Menu |
|
2140 |
#( |
|
2141 |
#(#MenuItem |
|
2142 |
#label: 'TileMode' |
|
2143 |
#translateLabel: true |
|
2144 |
#indication: #tileModeHolder |
|
2145 |
) |
|
2146 |
) |
|
2147 |
nil |
|
2148 |
nil |
|
2149 |
) |
|
1637 | 2150 |
! |
2151 |
||
2152 |
toolsMenuToolbar |
|
2153 |
"This resource specification was automatically generated |
|
2154 |
by the MenuEditor of ST/X." |
|
2155 |
||
2156 |
"Do not manually edit this!! If it is corrupted, |
|
2157 |
the MenuEditor may not be able to read the specification." |
|
2158 |
||
2159 |
" |
|
2160 |
MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar |
|
2161 |
(Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp |
|
2162 |
" |
|
2163 |
||
2164 |
<resource: #menu> |
|
2165 |
||
2166 |
^ |
|
2167 |
#(#Menu |
|
2168 |
#( |
|
2169 |
#(#MenuItem |
|
2170 |
#activeHelpKey: #drawModePoint |
|
2171 |
#enabled: #imageIsLoaded |
|
2172 |
#label: 'Point' |
|
2173 |
#translateLabel: true |
|
2174 |
#isButton: true |
|
2175 |
#labelImage: #(#ResourceRetriever #ImageEditor #pointIcon) |
|
2176 |
#choice: #editMode |
|
2177 |
#choiceValue: #point |
|
2178 |
) |
|
2179 |
#(#MenuItem |
|
2180 |
#activeHelpKey: #drawModeBox |
|
2181 |
#enabled: #imageIsLoaded |
|
2182 |
#label: 'Rect' |
|
2183 |
#translateLabel: true |
|
2184 |
#isButton: true |
|
2185 |
#labelImage: #(#ResourceRetriever #ImageEditor #rectIcon) |
|
2186 |
#choice: #editMode |
|
2187 |
#choiceValue: #box |
|
2188 |
) |
|
2189 |
#(#MenuItem |
|
2190 |
#activeHelpKey: #drawModeFilledBox |
|
2191 |
#enabled: #imageIsLoaded |
|
2192 |
#label: 'FillRect' |
|
2193 |
#translateLabel: true |
|
2194 |
#isButton: true |
|
2195 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillRectIcon) |
|
2196 |
#choice: #editMode |
|
2197 |
#choiceValue: #filledBox |
|
2198 |
) |
|
2199 |
#(#MenuItem |
|
2200 |
#activeHelpKey: #drawModeFill |
|
2201 |
#enabled: #imageIsLoaded |
|
2202 |
#label: 'Fill' |
|
2203 |
#translateLabel: true |
|
2204 |
#isButton: true |
|
2205 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillIcon) |
|
2206 |
#choice: #editMode |
|
2207 |
#choiceValue: #fill |
|
2208 |
) |
|
2209 |
#(#MenuItem |
|
2210 |
#activeHelpKey: #drawModeCopy |
|
2211 |
#enabled: #imageIsLoaded |
|
2212 |
#label: 'Copy' |
|
2213 |
#translateLabel: true |
|
2214 |
#isButton: true |
|
2215 |
#labelImage: #(#ResourceRetriever #ImageEditor #copyIcon) |
|
2216 |
#choice: #editMode |
|
2217 |
#choiceValue: #copy |
|
2218 |
) |
|
2219 |
#(#MenuItem |
|
2220 |
#activeHelpKey: #drawModePaste |
|
2221 |
#enabled: #imageIsLoaded |
|
2222 |
#label: 'Paste' |
|
2223 |
#translateLabel: true |
|
2224 |
#isButton: true |
|
2225 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteIcon) |
|
2226 |
#choice: #editMode |
|
2227 |
#choiceValue: #paste |
|
2228 |
) |
|
2229 |
#(#MenuItem |
|
2230 |
#activeHelpKey: #drawModePasteUnder |
|
2231 |
#enabled: #imageIsLoaded |
|
2232 |
#label: 'Paste Under' |
|
2233 |
#translateLabel: true |
|
2234 |
#isButton: true |
|
2235 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteUnderIcon) |
|
2236 |
#choice: #editMode |
|
2237 |
#choiceValue: #pasteUnder |
|
2238 |
) |
|
2239 |
#(#MenuItem |
|
2240 |
#activeHelpKey: #drawModePasteWithMask |
|
2241 |
#enabled: #imageIsLoaded |
|
2242 |
#label: 'Paste With Mask' |
|
2243 |
#translateLabel: true |
|
2244 |
#isButton: true |
|
2245 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteWithMaskIcon) |
|
2246 |
#choice: #editMode |
|
2247 |
#choiceValue: #pasteWithMask |
|
2248 |
) |
|
2249 |
#(#MenuItem |
|
2250 |
#activeHelpKey: #drawModeSpecial |
|
2251 |
#enabled: #imageIsLoaded |
|
2252 |
#label: 'Special' |
|
2253 |
#translateLabel: true |
|
2254 |
#isButton: true |
|
2255 |
#labelImage: #(#ResourceRetriever #ImageEditor #specialIcon) |
|
2256 |
#choice: #editMode |
|
2257 |
#choiceValue: #specialOperation |
|
2258 |
) |
|
2259 |
) |
|
2260 |
nil |
|
2261 |
nil |
|
2262 |
) |
|
400 | 2263 |
! ! |
2264 |
||
2265 |
!ImageEditor methodsFor:'accessing'! |
|
2266 |
||
2267 |
image |
|
767 | 2268 |
"returns the current editing image" |
400 | 2269 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2270 |
^ imageEditView image |
400 | 2271 |
! |
2272 |
||
2273 |
postOpenAction: anAction |
|
767 | 2274 |
"sets an action which is evaluated after opening" |
400 | 2275 |
|
2276 |
postOpenAction := anAction |
|
1381 | 2277 |
! |
2278 |
||
2279 |
resourceClass:aClass |
|
2280 |
imageEditView resourceClass:aClass |
|
400 | 2281 |
! ! |
2282 |
||
1398 | 2283 |
!ImageEditor methodsFor:'accessing-views'! |
400 | 2284 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2285 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2286 |
"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
|
2287 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2288 |
^(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
|
2289 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2290 |
"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
|
2291 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2292 |
|
487 | 2293 |
coordLabel |
767 | 2294 |
"returns the view the coord label" |
487 | 2295 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2296 |
^self componentAt: #coordLabel |
487 | 2297 |
! |
2298 |
||
400 | 2299 |
imageEditView |
911 | 2300 |
"returns the view of the image" |
400 | 2301 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2302 |
imageEditView isNil ifTrue:[ |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2303 |
imageEditView := (self componentAt: #imageEditView) scrolledView. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2304 |
imageEditView addDependent:self. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2305 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2306 |
^ imageEditView |
1345 | 2307 |
|
2308 |
"Modified: / 10.2.2000 / 23:19:20 / cg" |
|
400 | 2309 |
! |
2310 |
||
2311 |
imagePreView |
|
767 | 2312 |
"returns the preview of the image" |
400 | 2313 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2314 |
^ (self componentAt: #imagePreView) subViews first |
475 | 2315 |
! ! |
2316 |
||
400 | 2317 |
!ImageEditor methodsFor:'aspects'! |
2318 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2319 |
activityInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2320 |
^ self valueOfInfoLabel |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2321 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2322 |
"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
|
2323 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2324 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2325 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2326 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2327 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2328 |
"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
|
2329 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2330 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2331 |
hasClassAndSelectorDefined |
1054 | 2332 |
^ [ |
2333 |
|clsName| |
|
2334 |
||
2335 |
(clsName := imageEditView resourceClass) size > 0 |
|
2336 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil |
|
2337 |
and:[imageEditView resourceSelector notNil]] |
|
2338 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2339 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2340 |
"Created: / 31.7.1998 / 02:02:54 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2341 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2342 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2343 |
hasClassDefined |
1054 | 2344 |
^ [ |
2345 |
|clsName| |
|
2346 |
||
1443 | 2347 |
(clsName := imageEditView resourceClass) size > 0 |
1054 | 2348 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil] |
2349 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2350 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2351 |
"Created: / 31.7.1998 / 02:02:22 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2352 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2353 |
|
1008 | 2354 |
hasColormap |
2355 |
^ [self image notNil and:[self image colorMap notNil]] |
|
2356 |
||
2357 |
"Created: / 30.9.1998 / 23:53:55 / cg" |
|
2358 |
! |
|
2359 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2360 |
imageHasNextImage |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2361 |
"returns whether an image is loaded as value holder" |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2362 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2363 |
^ [self image notNil |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2364 |
and:[self image imageSequence notNil]] |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2365 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2366 |
"Created: / 31.7.1998 / 02:04:18 / cg" |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2367 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2368 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2369 |
imageInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2370 |
|holder| |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2371 |
(holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2372 |
builder aspectAt:#imageInfoHolder put:(holder := '' asValue). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2373 |
]. |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2374 |
^ holder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2375 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2376 |
"Modified: / 29.7.1998 / 18:32:08 / cg" |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2377 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2378 |
|
400 | 2379 |
imageIsLoaded |
767 | 2380 |
"returns whether an image is loaded as value holder" |
400 | 2381 |
|
2382 |
|holder| |
|
2383 |
(holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[ |
|
2384 |
builder aspectAt:#imageIsLoaded put:(holder := false asValue). |
|
2385 |
]. |
|
2386 |
^ holder |
|
2387 |
! |
|
2388 |
||
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2389 |
imageIsLoadedAndClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2390 |
"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
|
2391 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2392 |
^ [self hasClassAndSelectorDefined value |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2393 |
and:[self imageIsLoaded value]] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2394 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2395 |
"Created: / 31.7.1998 / 02:04:18 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2396 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2397 |
|
400 | 2398 |
listOfColors |
767 | 2399 |
"returns the list of colors in a List" |
400 | 2400 |
|
2401 |
|holder| |
|
2402 |
(holder := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
2403 |
builder aspectAt:#listOfColors put:(holder := List new). |
|
942 | 2404 |
holder addDependent:self. |
400 | 2405 |
]. |
2406 |
^ holder |
|
2407 |
! |
|
2408 |
||
2409 |
selectionOfColor |
|
767 | 2410 |
"returns current selection of the edit color as an AspectAdaptor" |
400 | 2411 |
|
2412 |
|holder| |
|
2413 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
|
2414 |
builder aspectAt:#selectionOfColor put:( |
|
2415 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex). |
|
2416 |
]. |
|
2417 |
^ holder |
|
2418 |
! |
|
2419 |
||
1558 | 2420 |
tileModeHolder |
2421 |
|holder| |
|
2422 |
(holder := builder bindingAt:#tileModeHolder) isNil ifTrue:[ |
|
2423 |
builder aspectAt:#tileModeHolder put:(holder := false asValue). |
|
2424 |
holder addDependent:self. |
|
2425 |
]. |
|
2426 |
^ holder |
|
2427 |
! |
|
2428 |
||
400 | 2429 |
valueOfMagnification |
767 | 2430 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 2431 |
|
2432 |
|holder| |
|
2433 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
2434 |
builder aspectAt:#valueOfMagnification put:( |
|
2435 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
2436 |
]. |
|
2437 |
^ holder |
|
2438 |
! ! |
|
2439 |
||
767 | 2440 |
!ImageEditor methodsFor:'change & update'! |
2441 |
||
2442 |
findColorMapMode |
|
899 | 2443 |
"finds the colorMapMode for a new image" |
767 | 2444 |
|
1054 | 2445 |
|image listOfColors| |
2446 |
||
2447 |
image := self image. |
|
2448 |
image depth > 8 ifTrue: [ |
|
2449 |
colorMapMode value: ''. |
|
2450 |
self listOfColors removeAll. |
|
2451 |
^ nil |
|
2452 |
]. |
|
2453 |
||
2454 |
colorMapMode value:(image depth printString, '-plane'). |
|
2455 |
||
2456 |
(listOfColors := self listOfColors) isEmpty ifTrue:[ |
|
2457 |
self colorMapMode: colorMapMode value. |
|
2458 |
listOfColors := self listOfColors. |
|
2459 |
image := self image. |
|
767 | 2460 |
]. |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2461 |
imageEditView drawingColors:(Array |
1054 | 2462 |
with: (listOfColors at:1) |
2463 |
with: (listOfColors at:2 ifAbsent:[listOfColors at:1])). |
|
2464 |
||
2465 |
image mask notNil ifTrue: [ |
|
2466 |
colorMapMode value:(colorMapMode value, ' + mask'). |
|
2467 |
||
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2468 |
(listOfColors detect: [:clr| clr = (Color colorId:0)] ifNone: nil) isNil |
1054 | 2469 |
ifTrue:[ |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2470 |
listOfColors addFirst:(Color colorId:0). |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2471 |
imageEditView drawingColors: (Array |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2472 |
with:(listOfColors at:2 ifAbsent:[listOfColors at:1]) |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2473 |
with:(listOfColors at:1)). |
898 | 2474 |
] |
767 | 2475 |
]. |
1054 | 2476 |
self selectionOfColor |
1446 | 2477 |
setValue: 0; |
1054 | 2478 |
value: (self listOfColors indexOf: imageEditView selectedColor). |
767 | 2479 |
! |
2480 |
||
942 | 2481 |
update:something with:aParameter from:changedObject |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2482 |
|clrIndex img | |
1436 | 2483 |
|
2484 |
img := self image. |
|
1558 | 2485 |
|
2486 |
changedObject == self tileModeHolder ifTrue:[ |
|
2487 |
self imagePreView tileMode:(changedObject value) tileOffset:(img extent). |
|
2488 |
self imagePreView clear; invalidate. |
|
2489 |
^ self |
|
2490 |
]. |
|
2491 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2492 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2493 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2494 |
"/ colormap entry changed at aParameter |
960 | 2495 |
|
2496 |
clrIndex := aParameter. |
|
2497 |
(self hasMask) ifTrue:[ |
|
2498 |
clrIndex := clrIndex - 1. |
|
2499 |
]. |
|
2500 |
||
1436 | 2501 |
img colorMap at:clrIndex put:(changedObject at:aParameter). |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2502 |
self colorMapChanged. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2503 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2504 |
]. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2505 |
]. |
1124 | 2506 |
|
2507 |
changedObject == imageEditView undoImages ifTrue:[ |
|
2508 |
self valueOfCanUndo value:(changedObject notEmpty). |
|
2509 |
^ self. |
|
2510 |
]. |
|
2511 |
||
1345 | 2512 |
changedObject == imageEditView ifTrue:[ |
2513 |
something == #imageColors ifTrue:[ |
|
1436 | 2514 |
self listOfColors contents:img colorMap. |
1345 | 2515 |
self findColorMapMode. |
2516 |
^ self. |
|
2517 |
]. |
|
2518 |
something == #image ifTrue:[ |
|
1436 | 2519 |
self imagePreView image:img. |
2520 |
self listOfColors contents:img colorMap. |
|
2521 |
self findColorMapMode. |
|
1558 | 2522 |
self tileModeHolder value ifTrue:[ |
2523 |
self imagePreView tileMode:true tileOffset:(img extent). |
|
2524 |
]. |
|
1345 | 2525 |
^ self. |
2526 |
]. |
|
2527 |
something == #subImageIn ifTrue:[ |
|
1436 | 2528 |
self imagePreView image ~~ img ifTrue:[ |
1406 | 2529 |
self halt:'should not happen'. |
2530 |
]. |
|
1558 | 2531 |
self tileModeHolder value ifTrue:[ |
2532 |
self imagePreView invalidate. |
|
2533 |
] ifFalse:[ |
|
2534 |
self imagePreView invalidate:aParameter. |
|
2535 |
]. |
|
1345 | 2536 |
^ self. |
2537 |
]. |
|
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2538 |
something == #selectedColor ifTrue:[ |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2539 |
(aParameter = (Color colorId:0)) ifTrue:[ |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2540 |
self halt. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2541 |
]. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2542 |
clrIndex := self listOfColors indexOf:aParameter. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2543 |
self selectionOfColor value:clrIndex. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2544 |
^ self. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2545 |
]. |
1345 | 2546 |
^ self. |
2547 |
]. |
|
2548 |
||
2549 |
changedObject == imageEditView image ifTrue:[ |
|
1377 | 2550 |
self halt:'to be implemented'. |
1345 | 2551 |
^ self. |
2552 |
]. |
|
2553 |
||
942 | 2554 |
super update:something with:aParameter from:changedObject |
2555 |
||
1345 | 2556 |
"Modified: / 10.2.2000 / 23:36:49 / cg" |
942 | 2557 |
! |
2558 |
||
1054 | 2559 |
updateForNoImage |
767 | 2560 |
"updates channels and view, if image is loaded" |
2561 |
||
2562 |
self imageIsLoaded value: false. |
|
2563 |
self listOfColors removeAll. |
|
2564 |
self imagePreView image: nil |
|
2565 |
||
2566 |
||
2567 |
||
2568 |
||
2569 |
! |
|
2570 |
||
2571 |
updateLabelsAndHistory |
|
2572 |
"updates labels and history, if something has changed" |
|
2573 |
||
2574 |
self imageIsLoaded value: self image notNil. |
|
2575 |
||
2576 |
self image isNil ifTrue: [^nil]. |
|
2577 |
||
2578 |
self updateInfoLabel. |
|
2579 |
||
911 | 2580 |
imageEditView resourceMessage asCollectionOfWords size = 2 |
2581 |
ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:]. |
|
767 | 2582 |
|
2583 |
self image fileName notNil |
|
2584 |
ifTrue: [self addToHistory: self image fileName -> #loadFromFile:]. |
|
2585 |
||
2586 |
||
2587 |
||
2588 |
! ! |
|
2589 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2590 |
!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
|
2591 |
|
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2592 |
atColor:aOldColor put:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2593 |
"a color changed to a new color |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2594 |
" |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2595 |
|index list| |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2596 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2597 |
list := self listOfColors. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2598 |
index := list identityIndexOf:aOldColor. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2599 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2600 |
index ~~ 0 ifTrue:[ |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2601 |
list at:index put:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2602 |
] ifFalse:[ |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2603 |
self halt:'should not happen'. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2604 |
list add:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2605 |
]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2606 |
! |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2607 |
|
942 | 2608 |
blueAtColor:aColor put:newBlue |
2609 |
"helper used to return a new row element, when blue is changed" |
|
2610 |
||
2611 |
|byte| |
|
2612 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2613 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2614 |
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
|
2615 |
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
|
2616 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2617 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2618 |
put:(Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte). |
942 | 2619 |
! |
2620 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2621 |
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
|
2622 |
"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
|
2623 |
|
930 | 2624 |
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
|
2625 |
^ 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
|
2626 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2627 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 2628 |
"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
|
2629 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2630 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2631 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2632 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2633 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2634 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2635 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2636 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2637 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2638 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2639 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2640 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2641 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2642 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2643 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2644 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2645 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2646 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2647 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2648 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2649 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2650 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2651 |
|
942 | 2652 |
greenAtColor:aColor put:newGreen |
2653 |
"helper used to return a new row element, when green is changed" |
|
2654 |
||
2655 |
|byte| |
|
2656 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2657 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2658 |
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
|
2659 |
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
|
2660 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2661 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2662 |
put:(Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)). |
942 | 2663 |
! |
2664 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2665 |
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
|
2666 |
"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
|
2667 |
|
930 | 2668 |
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
|
2669 |
^ 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
|
2670 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2671 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 2672 |
"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
|
2673 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2674 |
|
942 | 2675 |
redAtColor:aColor put:newRed |
2676 |
"helper used to return a new row element, when red is changed" |
|
2677 |
||
2678 |
|byte| |
|
2679 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2680 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2681 |
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
|
2682 |
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
|
2683 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2684 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2685 |
put:(Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)). |
942 | 2686 |
! |
2687 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2688 |
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
|
2689 |
"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
|
2690 |
|
930 | 2691 |
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
|
2692 |
^ 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
|
2693 |
|
930 | 2694 |
"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
|
2695 |
! |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2696 |
|
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2697 |
theColorItSelf:aColor |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2698 |
^ 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
|
2699 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2700 |
|
672 | 2701 |
!ImageEditor methodsFor:'help'! |
2702 |
||
2703 |
defaultInfoLabel |
|
767 | 2704 |
"returns the default info label" |
672 | 2705 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2706 |
|resourceClass| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2707 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2708 |
resourceClass := imageEditView resourceClass. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2709 |
(resourceClass isSymbol and: [(Smalltalk at:resourceClass) isClass]) |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2710 |
ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2711 |
^ resourceClass, ' >> ', imageEditView resourceSelector |
672 | 2712 |
]. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2713 |
^ 'No class and selector defined.' |
674 | 2714 |
! |
2715 |
||
702 | 2716 |
openDocumentation |
767 | 2717 |
"opens the documentation file of the Image Editor" |
674 | 2718 |
|
763 | 2719 |
self openHTMLDocument: 'tools/uipainter/ImageEditor.html' |
2720 |
||
672 | 2721 |
! ! |
2722 |
||
767 | 2723 |
!ImageEditor methodsFor:'loading'! |
2724 |
||
2725 |
loadFromFile: aFileName |
|
2726 |
"loads an image from aFileName and sets up color map list and other info labels" |
|
2727 |
||
960 | 2728 |
|img| |
2729 |
||
980
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2730 |
self withCursor:Cursor wait do:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2731 |
(imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2732 |
(img := self image) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2733 |
img colorMap notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2734 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2735 |
] ifFalse:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2736 |
self listOfColors removeAll. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2737 |
]. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2738 |
self findColorMapMode. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2739 |
self updateLabelsAndHistory. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2740 |
img := img onDevice:device. |
1057 | 2741 |
imageEditView image:img. |
960 | 2742 |
] ifFalse:[ |
1054 | 2743 |
self updateForNoImage |
1057 | 2744 |
]. |
767 | 2745 |
] |
2746 |
] |
|
960 | 2747 |
|
1057 | 2748 |
"Modified: / 16.3.1999 / 21:44:26 / cg" |
767 | 2749 |
! |
2750 |
||
960 | 2751 |
loadFromImage:anImage |
767 | 2752 |
"loads an image from anImage and sets up color map list and other info labels" |
2753 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2754 |
|img| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2755 |
|
1057 | 2756 |
anImage notNil ifTrue:[ |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2757 |
img := anImage onDevice:device. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2758 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2759 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2760 |
imageEditView image:img. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2761 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2762 |
img notNil ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2763 |
img colorMap notNil ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2764 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
960 | 2765 |
] ifFalse:[ |
767 | 2766 |
self listOfColors removeAll. |
2767 |
]. |
|
2768 |
self findColorMapMode. |
|
2769 |
self updateLabelsAndHistory. |
|
960 | 2770 |
] ifFalse:[ |
1054 | 2771 |
self updateForNoImage |
767 | 2772 |
] |
960 | 2773 |
|
1057 | 2774 |
"Modified: / 16.3.1999 / 21:43:56 / cg" |
767 | 2775 |
! |
2776 |
||
2777 |
loadFromMessage: aMessage |
|
2778 |
"loads an image by evaluating aMessage and sets up color map list and other info labels" |
|
2779 |
||
960 | 2780 |
|img| |
2781 |
||
2782 |
(imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
|
2783 |
(img := self image) notNil ifTrue:[ |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2784 |
img := img onDevice:device. |
960 | 2785 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
767 | 2786 |
self findColorMapMode. |
2787 |
self updateLabelsAndHistory. |
|
1057 | 2788 |
imageEditView image:img. |
960 | 2789 |
] ifFalse:[ |
1054 | 2790 |
self updateForNoImage |
767 | 2791 |
] |
2792 |
] |
|
960 | 2793 |
|
1057 | 2794 |
"Modified: / 16.3.1999 / 21:44:41 / cg" |
767 | 2795 |
! |
2796 |
||
2797 |
loadFromOrPrepareForMessage: aMessage |
|
2798 |
"loads an image by evaluating aMessage; |
|
2799 |
if no image could extract from aMessage; do set the class and the selector from |
|
2800 |
the aMessage for a saving at the end of editing" |
|
2801 |
||
911 | 2802 |
(imageEditView loadFromMessage: aMessage) notNil |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2803 |
ifTrue: [ |
767 | 2804 |
self listOfColors contents: self image usedColors asSet asOrderedCollection. |
2805 |
self findColorMapMode. |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2806 |
] ifFalse: [ |
911 | 2807 |
imageEditView resourceMessage: aMessage. |
767 | 2808 |
]. |
2809 |
self updateLabelsAndHistory. |
|
1057 | 2810 |
|
2811 |
"Modified: / 16.3.1999 / 21:45:07 / cg" |
|
767 | 2812 |
! ! |
2813 |
||
400 | 2814 |
!ImageEditor methodsFor:'menu modes'! |
2815 |
||
975 | 2816 |
colorMapMode |
2817 |
"returns colorMapMode" |
|
400 | 2818 |
|
975 | 2819 |
colorMapMode isNil ifTrue: [colorMapMode := '' asValue]. |
400 | 2820 |
|
975 | 2821 |
^colorMapMode |
400 | 2822 |
! |
2823 |
||
975 | 2824 |
editMode |
2825 |
"returns editMode" |
|
400 | 2826 |
|
1054 | 2827 |
editMode isNil ifTrue: [ |
975 | 2828 |
editMode := #point asValue. |
1329 | 2829 |
editMode onChangeEvaluate:[imageEditView editMode:(editMode value)] |
975 | 2830 |
]. |
2831 |
||
2832 |
^editMode |
|
400 | 2833 |
! |
2834 |
||
975 | 2835 |
mouseKeyColorMode |
2836 |
"returns mouseKeyColorMode" |
|
400 | 2837 |
|
1345 | 2838 |
mouseKeyColorMode isNil ifTrue:[ |
975 | 2839 |
mouseKeyColorMode := 1 asValue. |
1345 | 2840 |
mouseKeyColorMode onChangeEvaluate: [ |
2841 |
imageEditView mouseKeyColorMode:mouseKeyColorMode value. |
|
2842 |
self selectionOfColor value: (self listOfColors indexOf:imageEditView selectedColor). |
|
2843 |
] |
|
956 | 2844 |
]. |
400 | 2845 |
|
975 | 2846 |
^mouseKeyColorMode |
1345 | 2847 |
|
2848 |
"Modified: / 10.2.2000 / 23:16:42 / cg" |
|
400 | 2849 |
! ! |
2850 |
||
1558 | 2851 |
!ImageEditor methodsFor:'private'! |
2852 |
||
1598 | 2853 |
updateImage |
2854 |
|img| |
|
2855 |
||
2856 |
img := imageEditView image. |
|
2857 |
imageEditView image:img. |
|
2858 |
self fetchImageData. |
|
2859 |
! |
|
2860 |
||
1558 | 2861 |
updateImagePreView |
2862 |
self tileModeHolder value ifTrue:[ |
|
2863 |
self imagePreView tileMode:true tileOffset:(self image extent). |
|
2864 |
] |
|
2865 |
! ! |
|
2866 |
||
535 | 2867 |
!ImageEditor methodsFor:'queries'! |
2868 |
||
960 | 2869 |
hasMask |
1556 | 2870 |
^ colorMapMode value notNil and:[colorMapMode value endsWith:'mask'] |
960 | 2871 |
|
2872 |
"Created: / 18.8.1998 / 17:17:38 / cg" |
|
2873 |
! |
|
2874 |
||
535 | 2875 |
preferredExtent |
767 | 2876 |
"returns the preferred extent" |
535 | 2877 |
|
2878 |
^super preferredExtent max: (Screen current width//3)@(Screen current height//3.5) |
|
2879 |
||
2880 |
||
2881 |
! ! |
|
2882 |
||
400 | 2883 |
!ImageEditor methodsFor:'selection'! |
2884 |
||
2885 |
magnification |
|
767 | 2886 |
"returns the magnification of the image" |
400 | 2887 |
|
911 | 2888 |
self imageEditView isNil ifTrue: [^1]. |
2889 |
^imageEditView magnification x |
|
400 | 2890 |
! |
2891 |
||
2892 |
magnification: aValue |
|
767 | 2893 |
"sets the magnification of the image" |
400 | 2894 |
|
905 | 2895 |
|magnification| |
2896 |
magnification := (aValue ? 1) asPoint. |
|
911 | 2897 |
(magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil]. |
2898 |
imageEditView magnification: magnification |
|
400 | 2899 |
! |
2900 |
||
2901 |
selectedColorIndex |
|
767 | 2902 |
"returns the index of the selected color" |
400 | 2903 |
|
2904 |
^selectedColorIndex |
|
2905 |
! |
|
2906 |
||
2907 |
selectedColorIndex: anIndex |
|
767 | 2908 |
"sets the index of the selected color" |
400 | 2909 |
|
1054 | 2910 |
|clr pixel| |
2911 |
||
2912 |
selectedColorIndex := anIndex. |
|
2913 |
clr := self listOfColors at:anIndex ifAbsent:nil. |
|
2914 |
clr isNil ifTrue:[^ self]. |
|
2915 |
||
1075 | 2916 |
pixel := anIndex - 1. |
1054 | 2917 |
(self listOfColors at:1) = Color noColor ifTrue:[ |
2918 |
anIndex == 1 ifTrue:[ |
|
2919 |
pixel := nil. "/ mask |
|
2920 |
] ifFalse:[ |
|
1075 | 2921 |
pixel := pixel - 1 |
1054 | 2922 |
] |
2923 |
]. |
|
2924 |
imageEditView selectedColorIndex:pixel. |
|
2925 |
imageEditView selectedColor:clr. |
|
400 | 2926 |
|
2927 |
! ! |
|
2928 |
||
2929 |
!ImageEditor methodsFor:'startup / release'! |
|
2930 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2931 |
closeDownViews |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2932 |
DefaultRelativeSizes := |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2933 |
Array |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2934 |
with:(builder componentAt:#horizontalPanel) relativeCorners |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2935 |
with:(builder componentAt:#verticalPanel) relativeCorners. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2936 |
|
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2937 |
super closeDownViews |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2938 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2939 |
|
400 | 2940 |
closeRequest |
767 | 2941 |
"close request" |
400 | 2942 |
|
911 | 2943 |
imageEditView checkModified ifTrue:[super closeRequest] |
400 | 2944 |
|
2945 |
! |
|
2946 |
||
2947 |
open |
|
767 | 2948 |
"after opening, sets the masterApplication of the imageEditView to self" |
400 | 2949 |
|
2950 |
super open. |
|
444 | 2951 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2952 |
imageEditView := (self componentAt: #imageEditView) subViews first. |
400 | 2953 |
! |
2954 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2955 |
postBuildWith:aBuilder |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2956 |
super postBuildWith:aBuilder. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2957 |
|
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2958 |
DefaultRelativeSizes notNil ifTrue:[ |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2959 |
(aBuilder componentAt:#horizontalPanel) relativeCorners:DefaultRelativeSizes first. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2960 |
(aBuilder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2961 |
]. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2962 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
2963 |
|
400 | 2964 |
postOpenWith:aBuilder |
767 | 2965 |
"after opening, sets the masterApplication of the imageEditView to self; |
2966 |
evaluate the postOpenAction" |
|
400 | 2967 |
|
1124 | 2968 |
imageEditView undoImages addDependent:self. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2969 |
imageEditView imageInfoHolder:(self imageInfoHolder). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2970 |
imageEditView activityInfoHolder:(self activityInfoHolder). |
1345 | 2971 |
imageEditView clickInfoCallBack:[:button :point | |
2972 |
|mouseButtonColorToolBar| |
|
2973 |
||
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2974 |
mouseButtonColorToolBar := self componentAt:#MouseButtonColorToolBar. |
1345 | 2975 |
(mouseButtonColorToolBar itemAt:button) toggleIndication. |
2976 |
mouseButtonColorToolBar do: [:i| i updateIndicators]. |
|
2977 |
]. |
|
2978 |
imageEditView addDependent:self. |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2979 |
|
400 | 2980 |
postOpenAction notNil ifTrue: [postOpenAction value]. |
2981 |
||
1250 | 2982 |
super postOpenWith:aBuilder. |
2983 |
||
2984 |
aBuilder keyboardProcessor menuBar:nil. |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2985 |
|
1345 | 2986 |
"Modified: / 10.2.2000 / 23:17:43 / cg" |
400 | 2987 |
! ! |
2988 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2989 |
!ImageEditor methodsFor:'user actions - colormap'! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2990 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2991 |
addColorToColormap |
1057 | 2992 |
|depth img cMap newColorMap newImage oldCListSize newMode| |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2993 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2994 |
img := self image. |
1499
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
2995 |
img isNil ifTrue:[ |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
2996 |
self warn:'No Image.'. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
2997 |
^ self |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
2998 |
]. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
2999 |
|
1054 | 3000 |
depth := img depth. |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3001 |
cMap := img colorMap. |
1054 | 3002 |
cMap isNil ifTrue:[ |
1499
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3003 |
self warn:'Image has no colormap.\Change colorMap mode first.' withCRs. |
1054 | 3004 |
^ self |
3005 |
]. |
|
3006 |
||
1583 | 3007 |
("(depth == 1)" false |
1054 | 3008 |
or:[cMap size == (1 bitShift:depth)]) ifTrue:[ |
3009 |
depth >= 8 ifTrue:[ |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3010 |
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
|
3011 |
^ self |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3012 |
]. |
1054 | 3013 |
(self confirm:'No space for more colors in colormap.\Change depth first.' withCRs) |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3014 |
ifFalse:[ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3015 |
^ self |
1057 | 3016 |
]. |
3017 |
||
3018 |
imageEditView makeUndo. |
|
3019 |
newMode := (depth*2) printString , (colorMapMode value copyFrom:2). |
|
3020 |
self colorMapMode:newMode. |
|
3021 |
] ifFalse:[ |
|
3022 |
imageEditView makeUndo. |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3023 |
]. |
1054 | 3024 |
|
3025 |
cMap := cMap asArray. |
|
3026 |
oldCListSize := self listOfColors size. |
|
3027 |
||
3028 |
"/ (colorMapMode value asString endsWith:'mask') ifTrue:[ |
|
3029 |
"/ cMap last = Color noColor ifTrue:[ |
|
3030 |
"/ cMap := cMap copyWithoutLast:1 |
|
3031 |
"/ ] ifFalse:[ |
|
3032 |
"/ cMap first = Color noColor ifTrue:[ |
|
3033 |
"/ cMap := cMap copyFrom:2 |
|
3034 |
"/ ] |
|
3035 |
"/ ]. |
|
3036 |
"/ ]. |
|
3037 |
"/ |
|
3038 |
||
3039 |
newColorMap := cMap copyWith:(Color black). |
|
3040 |
||
3041 |
newImage := img species new |
|
3042 |
width:img width |
|
3043 |
height:img height |
|
3044 |
depth:depth |
|
3045 |
fromArray:img bits. |
|
3046 |
||
3047 |
newImage colorMap:newColorMap. |
|
3048 |
newImage fileName:img fileName. |
|
3049 |
newImage mask:(img mask copy). |
|
3050 |
||
3051 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
3052 |
self listOfColors contents: newImage colorMap. |
|
3053 |
self findColorMapMode. |
|
3054 |
"/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...) |
|
3055 |
self listOfColors size > (oldCListSize + 1) ifTrue:[ |
|
3056 |
self listOfColors removeLast |
|
3057 |
]. |
|
3058 |
self selectionOfColor value:(self listOfColors size). |
|
3059 |
self updateLabelsAndHistory. |
|
3060 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3061 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3062 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
1057 | 3063 |
"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
|
3064 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3065 |
|
1403 | 3066 |
clearMaskedPixels |
3067 |
"clear all masked pixels (to pixelValue 0)" |
|
3068 |
||
1460 | 3069 |
|newImage oldImage| |
1403 | 3070 |
|
3071 |
oldImage := self image. |
|
3072 |
||
3073 |
imageEditView makeUndo. |
|
3074 |
||
3075 |
self withExecuteCursorDo:[ |
|
3076 |
newImage := oldImage clearMaskedPixels. |
|
1460 | 3077 |
0 to:newImage height - 1 do:[:y | |
3078 |
0 to:newImage width - 1 do:[:x | |
|
3079 |
(newImage maskAtX:x y:y) == 0 ifTrue:[ |
|
3080 |
newImage pixelAtX:x y:y put:0 |
|
3081 |
] |
|
3082 |
] |
|
3083 |
]. |
|
3084 |
||
1403 | 3085 |
(imageEditView image:newImage) notNil ifTrue:[ |
1446 | 3086 |
self fetchImageData. |
1403 | 3087 |
] |
3088 |
] |
|
3089 |
! |
|
3090 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3091 |
colorMapChanged |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3092 |
|img| |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3093 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3094 |
img := self image. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3095 |
img release. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3096 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3097 |
self imageEditView invalidate. |
960 | 3098 |
self imagePreView invalidate. |
3099 |
||
3100 |
"/ (imageEditView image:img) notNil ifTrue:[ |
|
3101 |
"/ self updateLabelsAndHistory. |
|
3102 |
"/ self imagePreView image:img |
|
3103 |
"/ ] |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3104 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3105 |
"Created: / 7.8.1998 / 22:26:10 / cg" |
960 | 3106 |
"Modified: / 18.8.1998 / 17:08:55 / cg" |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3107 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3108 |
|
975 | 3109 |
colorMapMode:aMode |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3110 |
"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
|
3111 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3112 |
|depth numColors newColorMap newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3113 |
oldImage image newColors realColorMap oldFileName |
1008 | 3114 |
usedColors useNearest usageCounts tmpBits tmpMap quest |
3115 |
prevMode maskThreshold maskImage| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3116 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3117 |
self withExecuteCursorDo:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3118 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3119 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3120 |
prevMode := colorMapMode value. |
1008 | 3121 |
oldImage depth > 8 ifTrue:[ |
3122 |
prevMode := nil |
|
3123 |
]. |
|
3124 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3125 |
newColorMap := self class listOfColorMaps at:aMode. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3126 |
depth := (newColorMap size log: 2) asInteger. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3127 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3128 |
useNearest := false. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3129 |
depth == 1 ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3130 |
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
|
3131 |
] ifFalse:[ |
1008 | 3132 |
prevMode isNil ifTrue:[ |
3133 |
quest := 'Compute colormap (or use standard)' |
|
3134 |
] ifFalse:[ |
|
3135 |
quest := 'Keep colormap (or use standard)' |
|
3136 |
] |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3137 |
]. |
1008 | 3138 |
((prevMode = aMode) |
1057 | 3139 |
or:[depth > oldImage depth |
3140 |
or:[self confirm:(resources string:quest)]]) ifTrue:[ |
|
1008 | 3141 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3142 |
"/ keep the colormap |
1008 | 3143 |
newColorMap atAllPut:Color black. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3144 |
depth > oldImage depth ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3145 |
"/ easy - simply copy the part |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3146 |
numColors := 1 bitShift:oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3147 |
0 to:numColors-1 do:[:pixel | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3148 |
newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3149 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3150 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3151 |
"/ see if all used color fit the new colormap |
986 | 3152 |
usedColors := oldImage usedColorsMax:(1 bitShift:depth). |
1403 | 3153 |
(usedColors notNil and:[usedColors size > (1 bitShift:depth)]) ifTrue:[ |
3154 |
usedColors := oldImage realUsedColors |
|
3155 |
]. |
|
986 | 3156 |
(usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3157 |
"/ yea - just install them |
986 | 3158 |
usedColors asArray keysAndValuesDo:[:idx :clr | |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3159 |
newColorMap at:idx put:clr |
1008 | 3160 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3161 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3162 |
"/ copy over those that are most often used. |
986 | 3163 |
oldImage depth < 8 ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3164 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3165 |
oldImage bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3166 |
expandPixels:(oldImage depth) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3167 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3168 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3169 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3170 |
mapping:nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3171 |
] ifFalse:[ |
986 | 3172 |
oldImage depth == 8 ifTrue:[ |
3173 |
tmpBits := oldImage bits |
|
3174 |
] ifFalse:[ |
|
1124 | 3175 |
colorMapMode value:prevMode. |
1471 | 3176 |
self warn:('Too many used colors in image (', oldImage usedColors size printString , ').'). |
986 | 3177 |
^ self |
1471 | 3178 |
"/ (self confirm:('Too many used colors in image (', oldImage usedColors size printString , ').\\Dither ?' withCRs)) |
3179 |
"/ ifFalse:[. |
|
3180 |
"/ ^ self |
|
3181 |
"/ ]. |
|
3182 |
"/ self image: (Image newForDepth:depth) fromImage:oldImage. |
|
3183 |
"/ ^ self. |
|
986 | 3184 |
] |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3185 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3186 |
usageCounts := tmpBits usageCounts. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3187 |
tmpMap := Array new:usageCounts size. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3188 |
oldImage colorMap asArray keysAndValuesDo:[:i :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3189 |
tmpMap at:i put:clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3190 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3191 |
usageCounts sort:[:a :b | a > b] with:tmpMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3192 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3193 |
1 to:(1 bitShift:depth) do:[:idx | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3194 |
newColorMap at:idx put:(tmpMap at:idx) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3195 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3196 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3197 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3198 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3199 |
string:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3200 |
with:usedColors size |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3201 |
with:(1 bitShift:depth)) withCRs |
1542 | 3202 |
labels:(resources array:#('Cancel' 'First' 'Nearest')). |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3203 |
useNearest isNil ifTrue:[ |
1542 | 3204 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3205 |
^ self "/ cancel |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3206 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3207 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3208 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3209 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3210 |
"/ standard colormap |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3211 |
usedColors := oldImage usedColors. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3212 |
(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
|
3213 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3214 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3215 |
string:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3216 |
) withCRs |
1542 | 3217 |
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
|
3218 |
useNearest isNil ifTrue:[ |
1542 | 3219 |
colorMapMode value:prevMode. |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3220 |
^ self "/ cancel |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3221 |
]. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3222 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3223 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3224 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3225 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3226 |
|
1424
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
3227 |
newImage := Image newForDepth:depth. |
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
3228 |
newImage depth:depth. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3229 |
oldFileName := oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3230 |
|
1008 | 3231 |
Image imageErrorSignal handle:[:ex| |
3232 |
Color colorErrorSignal handle:[:ex| |
|
1542 | 3233 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3234 |
imageEditView undo. |
1008 | 3235 |
^ self warn:(resources string:'Conversion failed !!') |
3236 |
] do:[ |
|
1393 | 3237 |
newImage := Image newForDepth:depth. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3238 |
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
|
3239 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3240 |
newImage photometric:#palette. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3241 |
newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3242 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3243 |
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
|
3244 |
[:x :y :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3245 |
|newColor| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3246 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3247 |
(newColorMap includes:clr) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3248 |
ifTrue: [newColor := clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3249 |
ifFalse: [ |
1008 | 3250 |
newColor := clr nearestIn:newColorMap. |
3251 |
useNearest ifFalse:[ |
|
3252 |
(newColor deltaFrom:clr) > 0.5 ifTrue:[ |
|
3253 |
newColor := oldImage colorFromValue:0 |
|
3254 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3255 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3256 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3257 |
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
|
3258 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3259 |
image := newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3260 |
]. |
1008 | 3261 |
] do:[ |
3262 |
image := newImage fromImage:oldImage |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3263 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3264 |
|
1008 | 3265 |
(aMode asString endsWith:'mask') ifTrue:[ |
3266 |
image mask isNil ifTrue:[ |
|
3267 |
(self confirm:'Generate mask from black ?') ifTrue:[ |
|
3268 |
maskThreshold := 0.1. |
|
3269 |
maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). |
|
3270 |
] ifFalse:[ |
|
3271 |
maskImage := Depth1Image extent:image extent. |
|
3272 |
maskImage data:(ByteArray |
|
3273 |
new:(maskImage bytesPerRow * maskImage height) |
|
3274 |
withAll:16rFF). |
|
3275 |
||
3276 |
"/ maskImage fillRectangle:(image bounds) withColor:(Color colorId:1). |
|
3277 |
]. |
|
3278 |
image mask:maskImage. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3279 |
]. |
1008 | 3280 |
] ifFalse:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3281 |
image mask: nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3282 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3283 |
realColorMap := OrderedCollection new. |
1054 | 3284 |
image realColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3285 |
(realColorMap includes: clr) ifFalse: [realColorMap add: clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3286 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3287 |
newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size). |
1054 | 3288 |
newColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3289 |
((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
1054 | 3290 |
ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3291 |
newColors add: clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3292 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3293 |
]. |
975 | 3294 |
image colorMap: newColors. |
1446 | 3295 |
image fileName: oldFileName. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3296 |
|
1054 | 3297 |
(imageEditView image: image) notNil ifTrue:[ |
1446 | 3298 |
self fetchImageData. |
3299 |
"/ self listOfColors contents: image colorMap. |
|
3300 |
"/ self findColorMapMode. |
|
3301 |
"/ self updateLabelsAndHistory. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3302 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3303 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3304 |
|
1057 | 3305 |
"Modified: / 16.3.1999 / 21:55:39 / cg" |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3306 |
! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3307 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3308 |
compressColorMap |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3309 |
"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
|
3310 |
|
927 | 3311 |
|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
|
3312 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3313 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3314 |
depth := oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3315 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3316 |
oldImage photometric ~~ #palette ifTrue:[ |
930 | 3317 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3318 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3319 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3320 |
|
1403 | 3321 |
usedColors := oldImage realUsedColors. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3322 |
usedColors size == (1 bitShift:depth) ifTrue:[ |
930 | 3323 |
self information:'Compress colorMap: All colors are used - no compression.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3324 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3325 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3326 |
usedColors size == oldImage colorMap size ifTrue:[ |
930 | 3327 |
self information:'Compress colorMap: Colormap already compressed - no compression.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3328 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3329 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3330 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3331 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3332 |
|
930 | 3333 |
self information:('Compress colorMap: %1 colors used.' bindWith:usedColors size). |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3334 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3335 |
self withExecuteCursorDo:[ |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3336 |
"/ newColorMap := Array new:usedColors size. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3337 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3338 |
"/ translation table |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3339 |
oldToNew := ByteArray new:(1 bitShift:depth). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3340 |
newColorMap := usedColors asArray. |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3341 |
newColorMap sort:[:a :b | |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3342 |
a redByte == b redByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3343 |
a greenByte == b greenByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3344 |
a blueByte < b blueByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3345 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3346 |
a greenByte < b greenByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3347 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3348 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3349 |
a redByte < b redByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3350 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3351 |
]. |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3352 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3353 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3354 |
|newPixel| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3355 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3356 |
(usedColors includes:clr) ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3357 |
newPixel := newColorMap indexOf:clr. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3358 |
oldToNew at:oldIdx put:newPixel-1. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3359 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3360 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3361 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3362 |
oldBits := oldImage bits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3363 |
newBits := ByteArray new:(oldBits size). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3364 |
depth ~~ 8 ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3365 |
"/ expand/compress can only handle 8bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3366 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3367 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3368 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3369 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3370 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3371 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3372 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3373 |
tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3374 |
compressPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3375 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3376 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3377 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3378 |
mapping:nil |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3379 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3380 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3381 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3382 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3383 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3384 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3385 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3386 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3387 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3388 |
newImage := oldImage species new |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3389 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3390 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3391 |
depth:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3392 |
fromArray:newBits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3393 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3394 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3395 |
newImage fileName:oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3396 |
newImage mask:(oldImage mask copy). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3397 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3398 |
(imageEditView image:newImage) notNil ifTrue: |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3399 |
[ |
1446 | 3400 |
self fetchImageData. |
3401 |
"/ self listOfColors contents: newImage colorMap. |
|
3402 |
"/ self findColorMapMode. |
|
3403 |
"/ self updateLabelsAndHistory. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3404 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3405 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3406 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3407 |
"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
|
3408 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
1008 | 3409 |
! |
3410 |
||
1480 | 3411 |
copyMask |
3412 |
|mask| |
|
3413 |
||
3414 |
mask := self image mask. |
|
3415 |
MaskClipboard := mask subImageIn: (0@0 extent:mask extent). |
|
3416 |
! |
|
3417 |
||
1446 | 3418 |
fetchImageData |
1460 | 3419 |
|image| |
3420 |
||
3421 |
(image := imageEditView image) notNil ifTrue:[ |
|
3422 |
self listOfColors contents:(image colorMap). |
|
3423 |
self findColorMapMode. |
|
3424 |
self updateLabelsAndHistory. |
|
3425 |
] |
|
1446 | 3426 |
! |
3427 |
||
1544 | 3428 |
inspectColor |
3429 |
| img clrIndex| |
|
3430 |
||
3431 |
img := self image. |
|
3432 |
img isNil ifTrue:[ |
|
3433 |
self warn:'No Image.'. |
|
3434 |
^ self |
|
3435 |
]. |
|
3436 |
clrIndex := self selectionOfColor value. |
|
1603 | 3437 |
img mask notNil ifTrue: [ clrIndex := clrIndex - 1 ]. |
1544 | 3438 |
(img colorFromValue:clrIndex-1) inspect |
3439 |
! |
|
3440 |
||
1598 | 3441 |
makeBrighter |
3442 |
| anyChange| |
|
3443 |
||
3444 |
self withExecuteCursorDo:[ |
|
3445 |
anyChange := imageEditView makeBrighter. |
|
3446 |
anyChange ifFalse:[ |
|
3447 |
Dialog warn:'Image unchanged'. |
|
3448 |
] ifTrue:[ |
|
3449 |
self updateImage. |
|
3450 |
] |
|
3451 |
]. |
|
3452 |
! |
|
3453 |
||
3454 |
makeDarker |
|
3455 |
| anyChange| |
|
3456 |
||
3457 |
self withExecuteCursorDo:[ |
|
3458 |
anyChange := imageEditView makeDarker. |
|
3459 |
anyChange ifFalse:[ |
|
3460 |
Dialog warn:'Image unchanged'. |
|
3461 |
] ifTrue:[ |
|
3462 |
self updateImage. |
|
3463 |
] |
|
3464 |
]. |
|
3465 |
! |
|
3466 |
||
1436 | 3467 |
makeGrayScale |
1598 | 3468 |
|anyChange| |
1436 | 3469 |
|
3470 |
self withExecuteCursorDo:[ |
|
3471 |
anyChange := imageEditView makeGrayScale. |
|
3472 |
anyChange ifFalse:[ |
|
3473 |
Dialog warn:'Image unchanged'. |
|
3474 |
] ifTrue:[ |
|
1598 | 3475 |
self updateImage. |
3476 |
] |
|
3477 |
]. |
|
3478 |
! |
|
3479 |
||
3480 |
makeInverse |
|
3481 |
| anyChange| |
|
3482 |
||
3483 |
self withExecuteCursorDo:[ |
|
3484 |
anyChange := imageEditView makeInverse. |
|
3485 |
anyChange ifFalse:[ |
|
3486 |
Dialog warn:'Image unchanged'. |
|
3487 |
] ifTrue:[ |
|
3488 |
self updateImage. |
|
1436 | 3489 |
] |
3490 |
]. |
|
3491 |
! |
|
3492 |
||
1446 | 3493 |
makeSelectedColorBrighter |
1559 | 3494 |
|img cMap newImage clr| |
1446 | 3495 |
|
3496 |
img := self image. |
|
3497 |
cMap := img colorMap. |
|
3498 |
cMap isNil ifTrue:[ |
|
3499 |
self warn:'Image has no colormap\change colorMap mode first.' withCRs. |
|
3500 |
^ self |
|
3501 |
]. |
|
3502 |
||
3503 |
imageEditView makeUndo. |
|
3504 |
||
3505 |
cMap := cMap asArray. |
|
3506 |
clr := cMap at:imageEditView selectedColorIndex. |
|
3507 |
cMap at:imageEditView selectedColorIndex put:clr lightened. |
|
3508 |
||
3509 |
newImage := img species new |
|
3510 |
width:img width |
|
3511 |
height:img height |
|
1559 | 3512 |
depth:nil |
1446 | 3513 |
fromArray:img bits. |
3514 |
||
3515 |
newImage colorMap:cMap. |
|
3516 |
newImage fileName:img fileName. |
|
3517 |
newImage mask:(img mask copy). |
|
3518 |
||
3519 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
3520 |
self fetchImageData. |
|
3521 |
"/ self listOfColors contents: newImage colorMap. |
|
3522 |
"/ self findColorMapMode. |
|
3523 |
"/ self updateLabelsAndHistory. |
|
3524 |
] |
|
3525 |
||
3526 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
|
3527 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
|
3528 |
! |
|
3529 |
||
3530 |
makeSelectedColorDarker |
|
1559 | 3531 |
|img cMap clr newImage| |
1446 | 3532 |
|
3533 |
img := self image. |
|
3534 |
cMap := img colorMap. |
|
3535 |
cMap isNil ifTrue:[ |
|
3536 |
self warn:'Image has no colormap\change colorMap mode first.' withCRs. |
|
3537 |
^ self |
|
3538 |
]. |
|
3539 |
imageEditView makeUndo. |
|
3540 |
||
3541 |
cMap := cMap asArray. |
|
3542 |
clr := cMap at:imageEditView selectedColorIndex. |
|
3543 |
cMap at:imageEditView selectedColorIndex put:clr darkened. |
|
3544 |
||
3545 |
newImage := img species new |
|
3546 |
width:img width |
|
3547 |
height:img height |
|
1559 | 3548 |
depth:nil |
1446 | 3549 |
fromArray:img bits. |
3550 |
||
3551 |
newImage colorMap:cMap. |
|
3552 |
newImage fileName:img fileName. |
|
3553 |
newImage mask:(img mask copy). |
|
3554 |
||
3555 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
3556 |
self fetchImageData. |
|
3557 |
"/ self listOfColors contents: newImage colorMap. |
|
3558 |
"/ self findColorMapMode. |
|
3559 |
"/ self updateLabelsAndHistory. |
|
3560 |
] |
|
3561 |
||
3562 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
|
3563 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
|
3564 |
! |
|
3565 |
||
1480 | 3566 |
pasteMask |
3567 |
|img mask| |
|
3568 |
||
3569 |
imageEditView makeUndo. |
|
3570 |
||
3571 |
img := self image. |
|
3572 |
mask := img mask. |
|
3573 |
||
3574 |
mask |
|
3575 |
copyFrom:MaskClipboard |
|
3576 |
x:0 y:0 |
|
3577 |
toX:0 y:0 |
|
3578 |
width:(mask width min:MaskClipboard width) |
|
3579 |
height:(mask height min:MaskClipboard height). |
|
3580 |
img mask:mask. |
|
3581 |
(imageEditView image:img copy) notNil ifTrue:[ |
|
3582 |
self fetchImageData. |
|
3583 |
] |
|
3584 |
! |
|
3585 |
||
1124 | 3586 |
reduceNumberOfColors |
3587 |
|s n anyChange img| |
|
3588 |
||
3589 |
s := Dialog request:'Number of color bits to strip (1-7) ?'. |
|
1435 | 3590 |
s size == 0 ifTrue:[^ self]. |
1124 | 3591 |
n := Integer readFrom:s onError:0. |
3592 |
(n between:1 and:7) ifFalse:[ |
|
3593 |
Dialog warn:'Image unchanged'. |
|
3594 |
^ self |
|
3595 |
]. |
|
3596 |
||
3597 |
self withExecuteCursorDo:[ |
|
3598 |
anyChange := imageEditView reduceColorResolutionBy:n. |
|
3599 |
anyChange ifFalse:[ |
|
3600 |
Dialog warn:'Image unchanged'. |
|
3601 |
] ifTrue:[ |
|
3602 |
img := imageEditView image. |
|
3603 |
imageEditView image:img. |
|
1446 | 3604 |
|
3605 |
self fetchImageData. |
|
3606 |
"/ self listOfColors contents:(img colorMap). |
|
3607 |
"/ self findColorMapMode. |
|
3608 |
"/ self updateLabelsAndHistory. |
|
1124 | 3609 |
Dialog information:(img usedColors size printString , ' colors used.') |
3610 |
] |
|
3611 |
]. |
|
3612 |
! |
|
3613 |
||
1008 | 3614 |
sortColorMap |
3615 |
"calculates a new color map for the image, sorting colors" |
|
3616 |
||
3617 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
|
3618 |
||
3619 |
oldImage := self image. |
|
3620 |
depth := oldImage depth. |
|
3621 |
||
3622 |
oldImage photometric ~~ #palette ifTrue:[ |
|
3623 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
3624 |
^ self |
|
3625 |
]. |
|
3626 |
||
3627 |
usedColors := oldImage realColorMap. |
|
3628 |
||
3629 |
imageEditView makeUndo. |
|
3630 |
||
3631 |
self withExecuteCursorDo:[ |
|
3632 |
"/ newColorMap := Array new:usedColors size. |
|
3633 |
||
3634 |
"/ translation table |
|
3635 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
3636 |
newColorMap := usedColors asArray. |
|
3637 |
newColorMap sort:[:a :b | |
|
3638 |
a redByte == b redByte ifTrue:[ |
|
3639 |
a greenByte == b greenByte ifTrue:[ |
|
3640 |
a blueByte < b blueByte |
|
3641 |
] ifFalse:[ |
|
3642 |
a greenByte < b greenByte |
|
3643 |
] |
|
3644 |
] ifFalse:[ |
|
3645 |
a redByte < b redByte |
|
3646 |
] |
|
3647 |
]. |
|
3648 |
||
3649 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
3650 |
|newPixel| |
|
3651 |
||
3652 |
(usedColors includes:clr) ifTrue:[ |
|
3653 |
newPixel := newColorMap indexOf:clr. |
|
3654 |
oldToNew at:oldIdx put:newPixel-1. |
|
3655 |
] |
|
3656 |
]. |
|
3657 |
||
3658 |
oldBits := oldImage bits. |
|
3659 |
newBits := ByteArray new:(oldBits size). |
|
3660 |
depth ~~ 8 ifTrue:[ |
|
3661 |
"/ expand/compress can only handle 8bits |
|
3662 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
3663 |
oldBits |
|
3664 |
expandPixels:depth |
|
3665 |
width:oldImage width |
|
3666 |
height:oldImage height |
|
3667 |
into:tmpBits |
|
3668 |
mapping:oldToNew. |
|
3669 |
tmpBits |
|
3670 |
compressPixels:depth |
|
3671 |
width:oldImage width |
|
3672 |
height:oldImage height |
|
3673 |
into:newBits |
|
3674 |
mapping:nil |
|
3675 |
] ifFalse:[ |
|
3676 |
oldBits |
|
3677 |
expandPixels:depth |
|
3678 |
width:oldImage width |
|
3679 |
height:oldImage height |
|
3680 |
into:newBits |
|
3681 |
mapping:oldToNew. |
|
3682 |
]. |
|
3683 |
||
3684 |
newImage := oldImage species new |
|
3685 |
width:oldImage width |
|
3686 |
height:oldImage height |
|
3687 |
depth:depth |
|
3688 |
fromArray:newBits. |
|
3689 |
||
3690 |
newImage colorMap:newColorMap. |
|
3691 |
newImage fileName:oldImage fileName. |
|
3692 |
newImage mask:(oldImage mask copy). |
|
3693 |
||
1054 | 3694 |
(imageEditView image:newImage) notNil ifTrue:[ |
1446 | 3695 |
self fetchImageData. |
3696 |
"/ self listOfColors contents: newImage colorMap. |
|
3697 |
"/ self findColorMapMode. |
|
3698 |
"/ self updateLabelsAndHistory. |
|
1008 | 3699 |
] |
3700 |
] |
|
3701 |
||
3702 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
|
3703 |
"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
|
3704 |
! ! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3705 |
|
400 | 3706 |
!ImageEditor methodsFor:'user actions - editing'! |
3707 |
||
767 | 3708 |
doBrowseClass |
3709 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
400 | 3710 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3711 |
|cls| |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3712 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3713 |
cls := Smalltalk at:(imageEditView resourceClass) ifAbsent:nil. |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3714 |
cls isNil ifTrue:[^ self warn:'No Class specified']. |
1488 | 3715 |
UserPreferences systemBrowserClass |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3716 |
openInClass:cls class |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3717 |
selector:(imageEditView resourceSelector) |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3718 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
3719 |
"Modified: / 31.7.1998 / 02:01:15 / cg" |
400 | 3720 |
! |
3721 |
||
1045 | 3722 |
doCropAll |
986 | 3723 |
"find all borders and cut them off" |
3724 |
||
1045 | 3725 |
imageEditView cropLeft:true right:true top:true bottom:true. |
986 | 3726 |
self updateInfoLabel |
3727 |
||
3728 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
3729 |
"Created: / 7.9.1998 / 16:33:43 / cg" |
|
3730 |
! |
|
3731 |
||
1045 | 3732 |
doCropBottom |
986 | 3733 |
"find a bottom border and cut it off" |
3734 |
||
1045 | 3735 |
imageEditView cropLeft:false right:false top:false bottom:true. |
986 | 3736 |
self updateInfoLabel |
3737 |
||
3738 |
"Created: / 7.9.1998 / 13:00:20 / cg" |
|
3739 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
3740 |
! |
|
3741 |
||
1045 | 3742 |
doCropLeft |
986 | 3743 |
"find a left border and cut it off" |
3744 |
||
1045 | 3745 |
imageEditView cropLeft:true right:false top:false bottom:false. |
986 | 3746 |
self updateInfoLabel |
3747 |
||
3748 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
3749 |
"Modified: / 7.9.1998 / 14:26:34 / cg" |
|
3750 |
! |
|
3751 |
||
1045 | 3752 |
doCropManual |
986 | 3753 |
"let user specify borders and cut them off" |
3754 |
||
1502 | 3755 |
|bindings left top right bottom img firstChange gropAction acceptChannel| |
3756 |
||
3757 |
acceptChannel := TriggerValue new. |
|
1490 | 3758 |
|
3759 |
firstChange := true. |
|
3760 |
||
1502 | 3761 |
gropAction := |
3762 |
[:lV :rV :tV :bV | |l r t b| |
|
3763 |
acceptChannel value:true. |
|
3764 |
||
3765 |
l := lV value. |
|
3766 |
r := rV value. |
|
3767 |
t := tV value. |
|
3768 |
b := bV value. |
|
3769 |
(l + r + t + b) == 0 ifTrue:[ |
|
3770 |
Screen current beep |
|
3771 |
] ifFalse:[ |
|
3772 |
img := imageEditView image. |
|
3773 |
firstChange ifTrue:[ |
|
3774 |
imageEditView makeUndo. |
|
3775 |
firstChange := false. |
|
3776 |
]. |
|
3777 |
imageEditView |
|
3778 |
makeSubImageX:l y:t |
|
3779 |
width:(img width - l - r) |
|
3780 |
height:(img height - t - b). |
|
3781 |
self updateInfoLabel |
|
3782 |
]. |
|
1490 | 3783 |
]. |
986 | 3784 |
|
3785 |
bindings := IdentityDictionary new. |
|
1507 | 3786 |
bindings at:#left put:(left := 1 asValue). |
3787 |
bindings at:#right put:(right := 1 asValue). |
|
3788 |
bindings at:#top put:(top := 1 asValue). |
|
3789 |
bindings at:#bottom put:(bottom := 1 asValue). |
|
1502 | 3790 |
bindings at:#acceptChannel put:acceptChannel. |
3791 |
||
3792 |
bindings at:#gropLeftNow put:[ gropAction value:left value:0 value:0 value:0 ]. |
|
3793 |
bindings at:#gropRightNow put:[ gropAction value:0 value:right value:0 value:0 ]. |
|
3794 |
bindings at:#gropTopNow put:[ gropAction value:0 value:0 value:top value:0 ]. |
|
3795 |
bindings at:#gropBottomNow put:[ gropAction value:0 value:0 value:0 value:bottom ]. |
|
3796 |
||
3797 |
bindings at:#applyAction put:[ gropAction value:left value:right value:top value:bottom ]. |
|
1490 | 3798 |
|
3799 |
(self openDialogInterface:#gropDialogSpec withBindings:bindings) |
|
1507 | 3800 |
ifFalse:[ |
3801 |
firstChange ~~ true ifTrue:[ |
|
1558 | 3802 |
imageEditView undo. |
3803 |
self updateImagePreView. |
|
1507 | 3804 |
] |
3805 |
]. |
|
986 | 3806 |
|
3807 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
3808 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
3809 |
! |
|
3810 |
||
1045 | 3811 |
doCropRight |
986 | 3812 |
"find a right border and cut it off" |
3813 |
||
1045 | 3814 |
imageEditView cropLeft:false right:true top:false bottom:false. |
986 | 3815 |
self updateInfoLabel |
3816 |
||
3817 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
3818 |
"Modified: / 7.9.1998 / 14:26:44 / cg" |
|
3819 |
! |
|
3820 |
||
1045 | 3821 |
doCropTop |
986 | 3822 |
"find a top border and cut it off" |
3823 |
||
1045 | 3824 |
imageEditView cropLeft:false right:false top:true bottom:false. |
986 | 3825 |
self updateInfoLabel |
3826 |
||
3827 |
"Created: / 7.9.1998 / 13:00:19 / cg" |
|
3828 |
"Modified: / 7.9.1998 / 14:26:52 / cg" |
|
3829 |
! |
|
3830 |
||
1433 | 3831 |
doEditMask |
3832 |
"" |
|
3833 |
||
3834 |
self image mask edit |
|
3835 |
! |
|
3836 |
||
767 | 3837 |
doFlipHorizontal |
3838 |
"flips horizontally current image" |
|
400 | 3839 |
|
911 | 3840 |
imageEditView flipHorizontal |
400 | 3841 |
! |
3842 |
||
767 | 3843 |
doFlipVertical |
3844 |
"flips vertically current image" |
|
400 | 3845 |
|
911 | 3846 |
imageEditView flipVertical |
400 | 3847 |
! |
3848 |
||
767 | 3849 |
doMagnifyDown |
3850 |
"magnifies current image one step down" |
|
400 | 3851 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3852 |
|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
|
3853 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3854 |
magHolder := self valueOfMagnification. |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3855 |
(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
|
3856 |
magHolder value: mag - 1 |
400 | 3857 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3858 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3859 |
"Modified: / 26.7.1998 / 20:24:08 / cg" |
400 | 3860 |
! |
3861 |
||
767 | 3862 |
doMagnifyImage |
1479 | 3863 |
"magnifies the current image to a new size" |
400 | 3864 |
|
1353 | 3865 |
|box newSize image| |
3866 |
||
3867 |
image := imageEditView image. |
|
3868 |
||
3869 |
box := EnterBox new. |
|
3870 |
box title:(resources string:'Images new size:'). |
|
3871 |
box okText:(resources string:'OK'). |
|
3872 |
box abortText:(resources string:'Cancel'). |
|
3873 |
box initialText:image extent printString. |
|
3874 |
box showAtPointer. |
|
3875 |
(box accepted |
|
3876 |
and: [(newSize := Object readFromString:(box contents) onError:nil) notNil]) |
|
3877 |
ifTrue:[ |
|
1479 | 3878 |
newSize isPoint ifFalse:[ |
3879 |
self warn:'please enter the new size as ''x @ y''.'. |
|
3880 |
^ self. |
|
3881 |
]. |
|
3882 |
imageEditView magnifyImageTo:newSize. |
|
3883 |
]. |
|
3884 |
||
3885 |
self updateInfoLabel |
|
3886 |
! |
|
3887 |
||
3888 |
doMagnifyImageBy |
|
3889 |
"magnifies the current image (by a scale)" |
|
3890 |
||
3891 |
|box oldSize newSize scale image| |
|
3892 |
||
3893 |
image := imageEditView image. |
|
3894 |
oldSize := image extent. |
|
3895 |
||
3896 |
box := EnterBox new. |
|
3897 |
box title:(resources string:'Scale factor (<1 to shrink; >1 to magnify):'). |
|
3898 |
box okText:(resources string:'OK'). |
|
3899 |
box abortText:(resources string:'Cancel'). |
|
3900 |
box initialText:1 printString. |
|
3901 |
box showAtPointer. |
|
3902 |
||
3903 |
(box accepted |
|
3904 |
and: [(scale := Object readFromString:(box contents) onError:nil) notNil]) |
|
3905 |
ifTrue:[ |
|
3906 |
scale isNumber ifFalse:[ |
|
3907 |
self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'. |
|
3908 |
^ self. |
|
3909 |
]. |
|
3910 |
newSize := oldSize * scale. |
|
1353 | 3911 |
imageEditView magnifyImageTo:newSize. |
3912 |
]. |
|
3913 |
||
400 | 3914 |
self updateInfoLabel |
3915 |
! |
|
3916 |
||
767 | 3917 |
doMagnifyUp |
3918 |
"magnifies current image one step up" |
|
400 | 3919 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3920 |
|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
|
3921 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3922 |
magHolder := self valueOfMagnification. |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3923 |
(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
|
3924 |
magHolder value: mag + 1 |
400 | 3925 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3926 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3927 |
"Modified: / 26.7.1998 / 20:23:52 / cg" |
400 | 3928 |
! |
3929 |
||
767 | 3930 |
doNegativeImage |
3931 |
"negates current image by negating the color map" |
|
400 | 3932 |
|
1598 | 3933 |
self image depth ~~ 1 ifTrue:[ |
3934 |
Dialog warn:'Only useful for depth 1 images'. |
|
3935 |
^ self |
|
3936 |
]. |
|
911 | 3937 |
imageEditView negativeImage. |
400 | 3938 |
self listOfColors removeAll. |
901 | 3939 |
self findColorMapMode. |
911 | 3940 |
imageEditView undoImages removeLast |
400 | 3941 |
! |
3942 |
||
767 | 3943 |
doResizeImage |
1353 | 3944 |
"resizes the current image" |
3945 |
||
3946 |
|box newSize image| |
|
3947 |
||
3948 |
image := imageEditView image. |
|
3949 |
||
3950 |
box := EnterBox new. |
|
3951 |
box title:(resources string:'Images new size:'). |
|
3952 |
box okText:(resources string:'OK'). |
|
3953 |
box abortText:(resources string:'Cancel'). |
|
3954 |
box initialText:image extent printString. |
|
3955 |
box showAtPointer. |
|
3956 |
(box accepted |
|
3957 |
and: [(newSize := Object readFromString:(box contents) onError:nil) notNil]) |
|
3958 |
ifTrue:[ |
|
3959 |
imageEditView resizeImageTo:newSize. |
|
3960 |
]. |
|
400 | 3961 |
! |
3962 |
||
767 | 3963 |
doRotateImage |
3964 |
"rotates current image" |
|
400 | 3965 |
|
1353 | 3966 |
|box rotation| |
3967 |
||
3968 |
box := EnterBox new. |
|
3969 |
box title:(resources string:'Rotate by (degrees, clockwise):'). |
|
3970 |
box okText:(resources string:'OK'). |
|
3971 |
box abortText:(resources string:'Cancel'). |
|
3972 |
box initialText: '0'. |
|
3973 |
box showAtPointer. |
|
3974 |
(box accepted and: [(rotation := Object readFromString: box contents onError:nil) notNil]) |
|
3975 |
ifTrue:[ |
|
3976 |
imageEditView rotateImageBy:rotation. |
|
1558 | 3977 |
self updateInfoLabel. |
1353 | 3978 |
]. |
400 | 3979 |
! |
3980 |
||
1557 | 3981 |
doShiftManual |
3982 |
"let user specify amount and shift" |
|
3983 |
||
3984 |
|bindings amount img firstChange shiftAction acceptChannel| |
|
3985 |
||
3986 |
acceptChannel := TriggerValue new. |
|
3987 |
||
3988 |
firstChange := true. |
|
3989 |
||
3990 |
shiftAction := |
|
3991 |
[:shiftH :shiftV | |
|
3992 |
acceptChannel value:true. |
|
3993 |
||
3994 |
img := imageEditView image. |
|
3995 |
firstChange ifTrue:[ |
|
3996 |
imageEditView makeUndo. |
|
3997 |
firstChange := false. |
|
3998 |
]. |
|
3999 |
imageEditView shiftImageHorizontal:shiftH value vertical:shiftV value. |
|
4000 |
self updateInfoLabel |
|
4001 |
]. |
|
4002 |
||
4003 |
bindings := IdentityDictionary new. |
|
4004 |
bindings at:#shiftAmount put:(amount := 1 asValue). |
|
4005 |
bindings at:#acceptChannel put:acceptChannel. |
|
4006 |
||
4007 |
bindings at:#shiftLeftNow put:[ shiftAction value:(-1*amount value) value:0 ]. |
|
4008 |
bindings at:#shiftRightNow put:[ shiftAction value:amount value value:0 ]. |
|
4009 |
bindings at:#shiftUpNow put:[ shiftAction value:0 value:(-1*amount value) ]. |
|
4010 |
bindings at:#shiftDownNow put:[ shiftAction value:0 value:amount value ]. |
|
4011 |
||
4012 |
(self openDialogInterface:#shiftDialogSpec withBindings:bindings) |
|
4013 |
ifFalse:[ |
|
4014 |
firstChange ~~ true ifTrue:[ |
|
4015 |
imageEditView undo |
|
4016 |
] |
|
4017 |
]. |
|
4018 |
||
4019 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
4020 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
4021 |
! |
|
4022 |
||
1480 | 4023 |
doUnCropManual |
4024 |
"let user specify borders and add them" |
|
4025 |
||
4026 |
|bindings left top right bottom img| |
|
4027 |
||
4028 |
bindings := IdentityDictionary new. |
|
4029 |
bindings at:#left put:(left := 0 asValue). |
|
4030 |
bindings at:#right put:(right := 0 asValue). |
|
4031 |
bindings at:#top put:(top := 0 asValue). |
|
4032 |
bindings at:#bottom put:(bottom := 0 asValue). |
|
4033 |
(self openDialogInterface:#ungropDialogSpec withBindings:bindings) |
|
4034 |
ifTrue:[ |
|
4035 |
left := left value. |
|
4036 |
right := right value. |
|
4037 |
top := top value. |
|
4038 |
bottom := bottom value. |
|
4039 |
img := imageEditView image. |
|
4040 |
||
4041 |
imageEditView |
|
4042 |
makeBorderedImageX:left y:top |
|
4043 |
width:(img width + left + right) |
|
4044 |
height:(img height + top + bottom). |
|
4045 |
self updateInfoLabel |
|
4046 |
]. |
|
4047 |
||
4048 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
4049 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
4050 |
! |
|
4051 |
||
767 | 4052 |
doUndo |
4053 |
"reverses last edit action" |
|
400 | 4054 |
|
1436 | 4055 |
imageEditView undo. |
400 | 4056 |
! ! |
4057 |
||
4058 |
!ImageEditor methodsFor:'user actions - loading'! |
|
4059 |
||
767 | 4060 |
doLoadFromClass |
4061 |
"opens a dialog for loading an image from class and a (resource-) selector" |
|
400 | 4062 |
|
1122 | 4063 |
|img| |
4064 |
||
1054 | 4065 |
(imageEditView loadFromClass) notNil ifTrue:[ |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4066 |
imageSeqNr := nil. |
1122 | 4067 |
(img := self image) notNil ifTrue: [ |
4068 |
self listOfColors contents: img usedColors asSet asOrderedCollection. |
|
574 | 4069 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4070 |
self updateLabelsAndHistory. |
1054 | 4071 |
] ifFalse: [ |
4072 |
self updateForNoImage |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4073 |
]. |
449 | 4074 |
] |
400 | 4075 |
! |
4076 |
||
767 | 4077 |
doLoadFromFile |
4078 |
"opens a dialog for loading an image from a file" |
|
400 | 4079 |
|
1353 | 4080 |
|img file dir filters| |
4081 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4082 |
imageSeqNr := nil. |
1353 | 4083 |
img := self image. |
4084 |
img notNil ifTrue: [ |
|
4085 |
file := img fileName |
|
4086 |
] ifFalse:[ |
|
4087 |
dir := LastDirectory |
|
4088 |
]. |
|
4089 |
||
4090 |
filters := FileSelectionBrowser loadImageFileNameFilters. |
|
4091 |
||
4092 |
file notNil ifTrue:[ |
|
4093 |
file := FileSelectionBrowser |
|
4094 |
request:'Load Image From' |
|
4095 |
fileName:file |
|
4096 |
withFileFilters:filters. |
|
4097 |
] ifFalse:[ |
|
4098 |
file := FileSelectionBrowser |
|
4099 |
request:'Load Image From' |
|
4100 |
inDirectory:dir |
|
4101 |
withFileFilters:filters. |
|
4102 |
]. |
|
4103 |
file notNil ifTrue:[ |
|
4104 |
LastDirectory := file asFilename directoryName. |
|
4105 |
self loadFromFile:file |
|
4106 |
] |
|
400 | 4107 |
! |
4108 |
||
767 | 4109 |
doNewImage |
4110 |
"opens a dialog with choices of size and color map for creating a new image" |
|
400 | 4111 |
|
1637 | 4112 |
|aspects width height cMapString cMap imageClass image szString| |
767 | 4113 |
|
400 | 4114 |
aspects := IdentityDictionary new |
767 | 4115 |
at:#listOfSizes put: self class listOfDefaultSizes asValue; |
4116 |
at:#listOfColorMaps put: self class listOfColorMaps keys asSortedCollection asValue; |
|
1637 | 4117 |
at:#selectionOfSize put: (LastSizeString ? self class listOfDefaultSizes first copy) asValue; |
4118 |
at:#selectionOfColorMap put: (LastColormapMode ? self class listOfColorMaps keys asSortedCollection first) asValue; |
|
400 | 4119 |
yourself. |
4120 |
||
767 | 4121 |
(self openDialogInterface:#dialogSpecForNewImage withBindings:aspects) |
1383 | 4122 |
ifTrue:[ |
4123 |
szString := (aspects at:#selectionOfSize) value. |
|
4124 |
width := 128 min: (Integer readFromString: (szString upTo: $x) onError:[24]). |
|
4125 |
height := 128 min: (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[24]). |
|
400 | 4126 |
|
1637 | 4127 |
cMapString := (aspects at:#selectionOfColorMap) value. |
975 | 4128 |
cMap := (self class listOfColorMaps at: (colorMapMode value: (aspects at:#selectionOfColorMap) value) value). |
400 | 4129 |
imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger). |
767 | 4130 |
image := imageClass width: width height: height fromArray: (ByteArray new: width*height). |
400 | 4131 |
|
1637 | 4132 |
LastSizeString := szString. |
4133 |
LastColormapMode := cMapString. |
|
4134 |
||
975 | 4135 |
(colorMapMode value endsWith: 'mask') |
400 | 4136 |
ifTrue: |
4137 |
[ |
|
767 | 4138 |
image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels |
400 | 4139 |
]. |
4140 |
image colorMap: cMap. |
|
4141 |
image fillRectangleX:0 y:0 width:width height:height with:Color white. |
|
911 | 4142 |
(imageEditView image: image) notNil |
400 | 4143 |
ifTrue: |
4144 |
[ |
|
4145 |
self listOfColors contents: cMap. |
|
4146 |
self findColorMapMode. |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4147 |
self updateLabelsAndHistory. |
400 | 4148 |
] |
767 | 4149 |
] |
929 | 4150 |
! |
4151 |
||
4152 |
grabScreenImage |
|
4153 |
"let user choose an area and grab that are for editing" |
|
4154 |
||
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4155 |
Processor |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4156 |
addTimedBlock:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4157 |
|image d8image img| |
929 | 4158 |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4159 |
imageSeqNr := nil. |
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4160 |
image := Image fromUser. |
1121 | 4161 |
image isNil ifFalse:[ |
4162 |
image depth > 8 ifTrue:[ |
|
1122 | 4163 |
Object errorSignal handle:[:ex | |sig| |
1537
e86a686eeba2
class based exceptions - no longer need to send #haltSÃgnal
Claus Gittinger <cg@exept.de>
parents:
1507
diff
changeset
|
4164 |
(sig := ex signal) == HaltInterrupt ifTrue:[ex reject]. |
1122 | 4165 |
sig == Signal noHandlerSignal ifTrue:[ex reject]. |
1121 | 4166 |
|
4167 |
self warn:'Could not convert to depth8 image (too many colors)'. |
|
4168 |
d8image := nil. |
|
4169 |
] do:[ |
|
4170 |
d8image := Depth8Image new. |
|
4171 |
d8image fromImage:image. |
|
4172 |
]. |
|
4173 |
d8image notNil ifTrue:[ |
|
4174 |
image := d8image |
|
4175 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4176 |
]. |
1121 | 4177 |
(imageEditView image:image) notNil ifTrue:[ |
4178 |
self listOfColors contents:(image colorMap). |
|
4179 |
self findColorMapMode. |
|
4180 |
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
|
4181 |
] |
1121 | 4182 |
] |
4183 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4184 |
afterSeconds:1 |
929 | 4185 |
|
4186 |
"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
|
4187 |
"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
|
4188 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4189 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4190 |
nextImageInSequence |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4191 |
"display the next image in the image sequence" |
1383 | 4192 |
|img seq frame listOfColors| |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4193 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4194 |
imageEditView releaseUndos. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4195 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4196 |
seq := self image imageSequence. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4197 |
imageSeqNr isNil ifTrue:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4198 |
imageSeqNr := 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4199 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4200 |
imageSeqNr := imageSeqNr + 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4201 |
imageSeqNr > seq size ifTrue:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4202 |
self information:'Back to first image in sequence'. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4203 |
imageSeqNr := 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4204 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4205 |
frame := seq at:imageSeqNr. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4206 |
imageEditView image:(frame image). |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4207 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4208 |
(img := self image) notNil ifTrue:[ |
1383 | 4209 |
listOfColors := self listOfColors. |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4210 |
img colorMap notNil ifTrue:[ |
1383 | 4211 |
listOfColors contents:(img usedColors asSet asOrderedCollection). |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4212 |
] ifFalse:[ |
1383 | 4213 |
listOfColors removeAll. |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4214 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4215 |
self findColorMapMode. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4216 |
self updateLabelsAndHistory. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4217 |
img := img onDevice:device. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4218 |
imageEditView image:img. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4219 |
] ifFalse:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4220 |
self updateForNoImage |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4221 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4222 |
|
400 | 4223 |
! ! |
4224 |
||
4225 |
!ImageEditor methodsFor:'user actions - saving'! |
|
4226 |
||
767 | 4227 |
doPrint |
4228 |
"prints current image on the current printer" |
|
400 | 4229 |
|
911 | 4230 |
imageEditView print |
400 | 4231 |
! |
4232 |
||
1613 | 4233 |
doSaveButtonImageToFileAs |
4234 |
"opens a dialog for saving current image to a file" |
|
4235 |
||
4236 |
imageEditView saveButtonImageToFileAs. |
|
4237 |
self updateLabelsAndHistory. |
|
4238 |
! |
|
4239 |
||
767 | 4240 |
doSaveImageFile |
4241 |
"saves current image to current file" |
|
400 | 4242 |
|
1481 | 4243 |
imageEditView save. |
400 | 4244 |
! |
4245 |
||
767 | 4246 |
doSaveImageFileAs |
4247 |
"opens a dialog for saving current image to a file" |
|
400 | 4248 |
|
911 | 4249 |
imageEditView saveImageFileAs. |
1481 | 4250 |
self updateLabelsAndHistory. |
400 | 4251 |
! |
4252 |
||
767 | 4253 |
doSaveImageMaskFileAs |
4254 |
"opens a dialog for saving mask of current image to a file" |
|
400 | 4255 |
|
1481 | 4256 |
imageEditView saveImageMaskFileAs. |
400 | 4257 |
! |
4258 |
||
767 | 4259 |
doSaveMethod |
4260 |
"saves current image on current class and selector" |
|
400 | 4261 |
|
911 | 4262 |
imageEditView saveMethod notNil |
400 | 4263 |
ifTrue: |
4264 |
[ |
|
694 | 4265 |
self updateLabelsAndHistory |
400 | 4266 |
] |
4267 |
! |
|
4268 |
||
767 | 4269 |
doSaveMethodAs |
4270 |
"opens a dialog for saving current image on a class and a selector" |
|
400 | 4271 |
|
911 | 4272 |
imageEditView saveMethodAs notNil |
400 | 4273 |
ifTrue: |
4274 |
[ |
|
694 | 4275 |
self updateLabelsAndHistory |
400 | 4276 |
] |
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4277 |
! |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4278 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4279 |
doShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4280 |
"opens a dialog showing the storeString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4281 |
(sometimes useful to embed an image into source code)" |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4282 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4283 |
|img| |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4284 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4285 |
img := imageEditView image. |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4286 |
TextBox openOn:img storeString |
400 | 4287 |
! ! |
4288 |
||
1353 | 4289 |
!ImageEditor methodsFor:'user actions - settings'! |
4290 |
||
4291 |
doChangeGridMagnification |
|
4292 |
"change grid magnification" |
|
4293 |
||
4294 |
|box oldGridLimit newGridLimit| |
|
4295 |
||
4296 |
oldGridLimit := imageEditView class gridMagnificationLimit asPoint. |
|
4297 |
||
4298 |
box := EnterBox new. |
|
4299 |
box title:(resources string:'Grid Magnification Limit:'). |
|
4300 |
box okText:(resources string:'OK'). |
|
4301 |
box abortText:(resources string:'Cancel'). |
|
4302 |
box initialText:(oldGridLimit x printString). |
|
4303 |
box showAtPointer. |
|
4304 |
||
4305 |
(box accepted |
|
4306 |
and: [(newGridLimit := Number readFromString:(box contents) onError:[2]) notNil] |
|
4307 |
) ifTrue:[ |
|
4308 |
newGridLimit := (99 min: (2 max:newGridLimit)) asPoint. |
|
4309 |
imageEditView class gridMagnificationLimit:newGridLimit. |
|
4310 |
imageEditView invalidate |
|
4311 |
] |
|
4312 |
||
4313 |
! ! |
|
4314 |
||
400 | 4315 |
!ImageEditor class methodsFor:'documentation'! |
4316 |
||
4317 |
version |
|
4318 |
^ '$Header$' |
|
4319 |
! ! |