author | Claus Gittinger <cg@exept.de> |
Mon, 17 Aug 1998 10:22:40 +0200 | |
changeset 958 | 14088f998b72 |
parent 956 | dc4df8952e82 |
child 960 | 6196f12b97f6 |
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 |
||
13 |
ToolApplicationModel subclass:#ImageEditor |
|
929 | 14 |
instanceVariableNames:'imageEditView colorMapMode selectedColorIndex postOpenAction' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-UIPainter' |
|
400 | 18 |
! |
19 |
||
20 |
!ImageEditor class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
767 | 24 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 25 |
All Rights Reserved |
26 |
||
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
405 | 29 |
inclusion of the above copyright notice. This software may not |
400 | 30 |
be provided or otherwise made available to, or used by, any |
405 | 31 |
other person. No title to or ownership of the software is |
400 | 32 |
hereby transferred. |
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
737 | 38 |
Image Editor allows you to create, design, modify or just inspect images. |
400 | 39 |
|
40 |
[start with:] |
|
41 |
ImageEditor open |
|
941 | 42 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
400 | 43 |
|
44 |
[see also:] |
|
45 |
ImageEditView Image |
|
46 |
||
47 |
[author:] |
|
544 | 48 |
Thomas Zwick, eXept Software AG |
400 | 49 |
" |
50 |
! ! |
|
51 |
||
52 |
!ImageEditor class methodsFor:'instance creation'! |
|
53 |
||
54 |
openModalOnClass: aClass andSelector: aSelector |
|
900 | 55 |
"opens modal a Image Editor on aClass and aSelector" |
767 | 56 |
" |
57 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
58 |
" |
|
400 | 59 |
|
767 | 60 |
|imageEditor imageEditView className resourceClassName resourceSelector| |
61 |
||
400 | 62 |
imageEditor := self new. |
767 | 63 |
|
900 | 64 |
aClass isClass ifTrue: [className := aClass name]. |
65 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 66 |
aClass isNil ifTrue: [className := '']. |
400 | 67 |
|
688 | 68 |
imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. imageEditor loadFromOrPrepareForMessage: className, ' ', aSelector]. |
400 | 69 |
imageEditor openModal. |
70 |
||
688 | 71 |
resourceClassName := imageEditView resourceClass. |
767 | 72 |
resourceSelector := imageEditView resourceSelector. |
415 | 73 |
|
815 | 74 |
((className asString ~= resourceClassName) |
75 |
or:[aSelector asString ~= resourceSelector]) |
|
415 | 76 |
ifTrue: [^resourceClassName, ' ', resourceSelector] |
77 |
ifFalse:[^nil] |
|
400 | 78 |
! |
79 |
||
80 |
openOnClass: aClass andSelector: aSelector |
|
900 | 81 |
"opens a Image Editor on aClass and aSelector" |
767 | 82 |
" |
83 |
self openOnClass: self andSelector: #leftMouseKeyIcon |
|
84 |
" |
|
400 | 85 |
|
86 |
^self open loadFromMessage: aClass name, ' ', aSelector |
|
87 |
! |
|
88 |
||
767 | 89 |
openOnFile: aFileName |
900 | 90 |
"opens a Image Editor on aFileName" |
767 | 91 |
" |
92 |
self openOnFile: 'bitmaps/SmalltalkX.xbm' |
|
93 |
" |
|
400 | 94 |
|
767 | 95 |
^self open loadFromFile: aFileName |
400 | 96 |
! |
97 |
||
767 | 98 |
openOnImage: anImage |
900 | 99 |
"opens a Image Editor on anImage" |
767 | 100 |
" |
895 | 101 |
self openOnImage: Icon startIcon |
767 | 102 |
" |
400 | 103 |
|
767 | 104 |
^self open loadFromImage: anImage |
400 | 105 |
! ! |
106 |
||
107 |
!ImageEditor class methodsFor:'accessing'! |
|
108 |
||
109 |
listOfColorMaps |
|
767 | 110 |
"returns the list of default color maps for a new image" |
400 | 111 |
|
112 |
|colorMap| |
|
898 | 113 |
|
400 | 114 |
(colorMap := OrderedCollection new) |
115 |
add: Color black; |
|
116 |
add: Color white; |
|
117 |
add: Color red; |
|
118 |
add: Color green; |
|
119 |
add: Color blue; |
|
120 |
add: Color cyan; |
|
121 |
add: Color yellow; |
|
122 |
add: Color magenta; |
|
898 | 123 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
124 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
125 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
126 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
127 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
128 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
129 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
130 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
131 |
||
400 | 132 |
0 to: 5 do: |
133 |
[:r| |
|
134 |
0 to: 5 do: |
|
135 |
[:g| |
|
136 |
0 to: 5 do: |
|
137 |
[:b| |
|
898 | 138 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 139 |
] |
140 |
] |
|
141 |
]. |
|
142 |
||
143 |
1 to: 25 do: |
|
144 |
[:g| |
|
898 | 145 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 146 |
]. |
147 |
||
148 |
^Dictionary new |
|
149 |
at: '8-plane' put: colorMap; |
|
150 |
at: '8-plane + mask' put: colorMap; |
|
151 |
at: '4-plane' put: (colorMap copyFrom: 1 to: 16); |
|
152 |
at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16); |
|
153 |
at: '2-plane' put: (colorMap copyFrom: 1 to: 4); |
|
154 |
at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4); |
|
155 |
at: '1-plane' put: (colorMap copyFrom: 1 to: 2); |
|
156 |
at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2); |
|
157 |
yourself |
|
158 |
! |
|
159 |
||
160 |
listOfDefaultSizes |
|
767 | 161 |
"returns the list of default sizes for a new image" |
400 | 162 |
|
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
163 |
^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
164 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
165 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
400 | 166 |
! ! |
167 |
||
460 | 168 |
!ImageEditor class methodsFor:'help specs'! |
169 |
||
170 |
helpSpec |
|
737 | 171 |
"This resource specification was automatically generated |
172 |
by the UIHelpTool of ST/X." |
|
173 |
||
174 |
"Do not manually edit this!! If it is corrupted, |
|
175 |
the UIHelpTool may not be able to read the specification." |
|
460 | 176 |
|
177 |
" |
|
737 | 178 |
UIHelpTool openOnClass:ImageEditor |
460 | 179 |
" |
180 |
||
737 | 181 |
<resource: #help> |
182 |
||
183 |
^super helpSpec addPairsFrom:#( |
|
460 | 184 |
|
185 |
#colorMap |
|
929 | 186 |
'ColorMap functions.' |
187 |
||
188 |
#colorMap1 |
|
189 |
'Convert to depth-1 image.' |
|
190 |
||
191 |
#colorMap2 |
|
192 |
'Convert to depth-2 image.' |
|
193 |
||
194 |
#colorMap4 |
|
195 |
'Convert to depth-4 image.' |
|
196 |
||
197 |
#colorMap8 |
|
198 |
'Convert to depth-8 image.' |
|
199 |
||
200 |
#colorMap1M |
|
201 |
'Convert to depth-1 image plus mask.' |
|
202 |
||
203 |
#colorMap2M |
|
204 |
'Convert to depth-2 image plus mask.' |
|
205 |
||
206 |
#colorMap4M |
|
207 |
'Convert to depth-4 image plus mask.' |
|
208 |
||
209 |
#colorMap8M |
|
210 |
'Convert to depth-8 image plus mask.' |
|
211 |
||
212 |
#compressColormap |
|
213 |
'Remove unneeded entries from the colorMap.' |
|
460 | 214 |
|
487 | 215 |
#colorMapTable |
675 | 216 |
'Shows a list of used colors of the image.' |
487 | 217 |
|
460 | 218 |
#drawModeBox |
914 | 219 |
'Switches to box-drawing mode.' |
460 | 220 |
|
221 |
#drawModeCopy |
|
914 | 222 |
'Switches to area-copy mode.' |
460 | 223 |
|
224 |
#drawModeFill |
|
914 | 225 |
'Switches to flood-fill mode.' |
460 | 226 |
|
227 |
#drawModeFilledBox |
|
914 | 228 |
'Switches to filled-box drawing mode.' |
460 | 229 |
|
230 |
#drawModePaste |
|
914 | 231 |
'Switches to paste mode.' |
232 |
||
233 |
#drawModePasteUnder |
|
234 |
'Switches to paste under mode.' |
|
460 | 235 |
|
236 |
#drawModePoint |
|
914 | 237 |
'Switches to point-drawing mode.' |
460 | 238 |
|
239 |
#editFlipHorizontal |
|
914 | 240 |
'Flips the image horizontally.' |
460 | 241 |
|
242 |
#editFlipVertical |
|
914 | 243 |
'Flips the image vertically.' |
460 | 244 |
|
245 |
#editMagnifyImage |
|
914 | 246 |
'Magnify the image.' |
460 | 247 |
|
248 |
#editNegate |
|
914 | 249 |
'Invert the images colors.' |
460 | 250 |
|
251 |
#editResize |
|
914 | 252 |
'Resize the image (preserving the old image).' |
460 | 253 |
|
254 |
#editRotate |
|
914 | 255 |
'Rotate the image.' |
460 | 256 |
|
929 | 257 |
#fileGrabImage |
258 |
'Pick an image from the screen.' |
|
259 |
||
460 | 260 |
#fileLoadFromClass |
929 | 261 |
'Select and load an image from a resource method.' |
460 | 262 |
|
263 |
#fileLoadFromFile |
|
929 | 264 |
'Select and load an image from a file.' |
460 | 265 |
|
266 |
#fileNewImage |
|
914 | 267 |
'Create a new image' |
460 | 268 |
|
269 |
#filePrint |
|
270 |
'Print the image on a postscript printer.' |
|
271 |
||
272 |
#fileSaveAs |
|
914 | 273 |
'Save the image to a file.' |
460 | 274 |
|
275 |
#fileSaveMaskAs |
|
914 | 276 |
'Save the mask of the image to a file.' |
460 | 277 |
|
278 |
#fileSaveMethod |
|
914 | 279 |
'Save the image as resource method in the current class and selector.' |
460 | 280 |
|
281 |
#fileSaveMethodAs |
|
914 | 282 |
'Save the image as resource method in a class.' |
460 | 283 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
284 |
#historyMenuItem |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
285 |
'Edit this image.' |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
286 |
|
487 | 287 |
#magnificationNumber |
914 | 288 |
'Shows the current magnification.' |
487 | 289 |
|
290 |
#magnifyImageDown |
|
914 | 291 |
'Decrease magnification.' |
487 | 292 |
|
293 |
#magnifyImageUp |
|
914 | 294 |
'Increase magnification.' |
487 | 295 |
|
296 |
#mouseKeyColorMode |
|
914 | 297 |
'Toggles between left and right mouse button color.' |
487 | 298 |
|
299 |
#previewView |
|
914 | 300 |
'Shows a preview of the image.' |
487 | 301 |
|
905 | 302 |
#settingsGridMagnification |
914 | 303 |
'Change the grid magnification of the edit view.' |
905 | 304 |
|
460 | 305 |
) |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
306 |
|
929 | 307 |
"Modified: / 29.7.1998 / 22:27:36 / cg" |
460 | 308 |
! ! |
309 |
||
737 | 310 |
!ImageEditor class methodsFor:'image specs'! |
311 |
||
312 |
leftMouseKeyIcon |
|
313 |
"This resource specification was automatically generated |
|
314 |
by the ImageEditor of ST/X." |
|
315 |
||
316 |
"Do not manually edit this!! If it is corrupted, |
|
317 |
the ImageEditor may not be able to read the specification." |
|
318 |
||
319 |
" |
|
320 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
|
321 |
" |
|
322 |
||
323 |
<resource: #image> |
|
324 |
||
325 |
^Icon |
|
326 |
constantNamed:#'ImageEditor leftMouseKeyIcon' |
|
327 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JEE@@B!!QP@@(TT@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; 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]! |
|
328 |
||
329 |
rightMouseKeyIcon |
|
330 |
"This resource specification was automatically generated |
|
331 |
by the ImageEditor of ST/X." |
|
332 |
||
333 |
"Do not manually edit this!! If it is corrupted, |
|
334 |
the ImageEditor may not be able to read the specification." |
|
335 |
||
336 |
" |
|
337 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
|
338 |
" |
|
339 |
||
340 |
<resource: #image> |
|
341 |
||
342 |
^Icon |
|
343 |
constantNamed:#'ImageEditor rightMouseKeyIcon' |
|
344 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EEJ@@AQR @@TT(@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; 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]! ! |
|
345 |
||
400 | 346 |
!ImageEditor class methodsFor:'interface specs'! |
347 |
||
767 | 348 |
dialogSpecForNewImage |
737 | 349 |
"This resource specification was automatically generated |
350 |
by the UIPainter of ST/X." |
|
519 | 351 |
|
737 | 352 |
"Do not manually edit this!! If it is corrupted, |
353 |
the UIPainter may not be able to read the specification." |
|
519 | 354 |
|
355 |
" |
|
767 | 356 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
357 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 358 |
" |
359 |
||
360 |
<resource: #canvas> |
|
361 |
||
362 |
^ |
|
363 |
||
364 |
#(#FullSpec |
|
672 | 365 |
#window: |
519 | 366 |
#(#WindowSpec |
672 | 367 |
#name: 'New Image' |
951
457d94e33e93
fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents:
945
diff
changeset
|
368 |
#layout: #(#LayoutFrame 216 0 173 0 516 0 291 0) |
672 | 369 |
#label: 'New Image' |
370 |
#min: #(#Point 10 10) |
|
371 |
#max: #(#Point 1152 900) |
|
951
457d94e33e93
fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents:
945
diff
changeset
|
372 |
#bounds: #(#Rectangle 216 173 517 292) |
672 | 373 |
#usePreferredExtent: false |
519 | 374 |
) |
672 | 375 |
#component: |
519 | 376 |
#(#SpecCollection |
672 | 377 |
#collection: |
519 | 378 |
#( |
379 |
#(#ViewSpec |
|
672 | 380 |
#name: 'View' |
737 | 381 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
672 | 382 |
#component: |
519 | 383 |
#(#SpecCollection |
672 | 384 |
#collection: |
519 | 385 |
#( |
386 |
#(#FramedBoxSpec |
|
672 | 387 |
#name: 'framedBox1' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
388 |
#layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0) |
672 | 389 |
#component: |
519 | 390 |
#(#SpecCollection |
672 | 391 |
#collection: |
519 | 392 |
#( |
393 |
#(#ComboBoxSpec |
|
672 | 394 |
#name: 'defaultSizesComboBox' |
951
457d94e33e93
fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents:
945
diff
changeset
|
395 |
#layout: #(#LayoutFrame -8 0.0 13 0.0 89 0.0 36 0.0) |
672 | 396 |
#model: #selectionOfSize |
397 |
#type: #string |
|
398 |
#comboList: #listOfDefaultSizes |
|
519 | 399 |
) |
400 |
) |
|
401 |
) |
|
672 | 402 |
#label: 'Size' |
403 |
#labelPosition: #topLeft |
|
404 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 405 |
) |
406 |
#(#FramedBoxSpec |
|
672 | 407 |
#name: 'framedBox2' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
408 |
#layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0) |
672 | 409 |
#component: |
519 | 410 |
#(#SpecCollection |
672 | 411 |
#collection: |
519 | 412 |
#( |
413 |
#(#ComboListSpec |
|
672 | 414 |
#name: 'colorMapComboBox' |
951
457d94e33e93
fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents:
945
diff
changeset
|
415 |
#layout: #(#LayoutFrame -4 0.0 12 0.0 144 0.0 35 0.0) |
672 | 416 |
#model: #selectionOfColorMap |
417 |
#comboList: #listOfColorMaps |
|
418 |
#useIndex: false |
|
519 | 419 |
) |
420 |
) |
|
421 |
) |
|
672 | 422 |
#label: 'Color Map' |
423 |
#labelPosition: #topLeft |
|
424 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 425 |
) |
426 |
) |
|
427 |
) |
|
672 | 428 |
#level: 1 |
519 | 429 |
) |
672 | 430 |
#(#UISubSpecification |
431 |
#name: 'UISubSpecification1' |
|
737 | 432 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
672 | 433 |
#majorKey: #ToolApplicationModel |
434 |
#minorKey: #windowSpecForCommitWithoutChannels |
|
519 | 435 |
) |
436 |
) |
|
437 |
) |
|
438 |
) |
|
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
439 |
|
951
457d94e33e93
fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents:
945
diff
changeset
|
440 |
"Modified: / 13.8.1998 / 19:56:22 / cg" |
767 | 441 |
! |
442 |
||
443 |
windowSpec |
|
444 |
"This resource specification was automatically generated |
|
445 |
by the UIPainter of ST/X." |
|
446 |
||
447 |
"Do not manually edit this!! If it is corrupted, |
|
448 |
the UIPainter may not be able to read the specification." |
|
449 |
||
450 |
" |
|
451 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
452 |
ImageEditor new openInterface:#windowSpec |
|
453 |
ImageEditor open |
|
454 |
" |
|
455 |
||
456 |
<resource: #canvas> |
|
457 |
||
458 |
^ |
|
459 |
||
460 |
#(#FullSpec |
|
461 |
#window: |
|
462 |
#(#WindowSpec |
|
463 |
#name: 'Image Editor' |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
464 |
#layout: #(#LayoutFrame 176 0 156 0 675 0 501 0) |
767 | 465 |
#label: 'Image Editor' |
466 |
#min: #(#Point 400 320) |
|
467 |
#max: #(#Point 1152 900) |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
468 |
#bounds: #(#Rectangle 176 156 676 502) |
767 | 469 |
#menu: #menu |
470 |
#usePreferredExtent: false |
|
471 |
) |
|
472 |
#component: |
|
473 |
#(#SpecCollection |
|
474 |
#collection: |
|
475 |
#( |
|
476 |
#(#MenuPanelSpec |
|
477 |
#name: 'menuToolbarView' |
|
478 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
479 |
#menu: #menuToolbar |
|
480 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
481 |
#showSeparatingLines: true |
|
482 |
) |
|
483 |
#(#VariableHorizontalPanelSpec |
|
484 |
#name: 'variableHorizontalPanel1' |
|
485 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
486 |
#component: |
|
487 |
#(#SpecCollection |
|
488 |
#collection: |
|
489 |
#( |
|
490 |
#(#ViewSpec |
|
491 |
#name: 'view1' |
|
492 |
#component: |
|
493 |
#(#SpecCollection |
|
494 |
#collection: |
|
495 |
#( |
|
496 |
#(#VariableVerticalPanelSpec |
|
497 |
#name: 'VariableVerticalPanel1' |
|
498 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
499 |
#component: |
|
500 |
#(#SpecCollection |
|
501 |
#collection: |
|
502 |
#( |
|
503 |
#(#ViewSpec |
|
504 |
#name: 'View1' |
|
505 |
#component: |
|
506 |
#(#SpecCollection |
|
507 |
#collection: |
|
508 |
#( |
|
509 |
#(#MenuPanelSpec |
|
510 |
#name: 'MouseButtonColorToolBar' |
|
511 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
512 |
#menu: #menuMouseButtonColors |
|
513 |
) |
|
514 |
#(#DataSetSpec |
|
515 |
#name: 'colorDataSetView' |
|
516 |
#layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
517 |
#activeHelpKey: #colorMapTable |
|
518 |
#model: #selectionOfColor |
|
519 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
520 |
#hasHorizontalScrollBar: true |
|
521 |
#hasVerticalScrollBar: true |
|
522 |
#miniScrollerHorizontal: true |
|
523 |
#miniScrollerVertical: true |
|
524 |
#dataList: #listOfColors |
|
525 |
#has3Dsepartors: true |
|
905 | 526 |
#has3Dseparators: true |
767 | 527 |
#verticalSpacing: 1 |
528 |
#columns: |
|
529 |
#( |
|
530 |
#(#DataSetColumnSpec |
|
531 |
#rendererType: #rowSelector |
|
532 |
#backgroundSelector: #yourself |
|
533 |
) |
|
534 |
#(#DataSetColumnSpec |
|
535 |
#label: 'R' |
|
536 |
#labelAlignment: #left |
|
942 | 537 |
#columnAlignment: #right |
538 |
#editorType: #InputField |
|
539 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
540 |
#model: #redFromColor: |
942 | 541 |
#writeSelector: #redAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
542 |
#selectSelector: #canSelectRedInColor: |
767 | 543 |
) |
544 |
#(#DataSetColumnSpec |
|
545 |
#label: 'G' |
|
546 |
#labelAlignment: #left |
|
942 | 547 |
#columnAlignment: #right |
548 |
#editorType: #InputField |
|
549 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
550 |
#model: #greenFromColor: |
942 | 551 |
#writeSelector: #greenAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
552 |
#selectSelector: #canSelectGreenInColor: |
767 | 553 |
) |
554 |
#(#DataSetColumnSpec |
|
555 |
#label: 'B' |
|
556 |
#labelAlignment: #left |
|
942 | 557 |
#columnAlignment: #right |
558 |
#editorType: #InputField |
|
559 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
560 |
#model: #blueFromColor: |
942 | 561 |
#writeSelector: #blueAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
562 |
#selectSelector: #canSelectBlueInColor: |
767 | 563 |
) |
564 |
) |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
565 |
#columnAdaptor: #colorColumnAdaptor |
767 | 566 |
) |
567 |
) |
|
568 |
) |
|
569 |
) |
|
570 |
#(#ArbitraryComponentSpec |
|
571 |
#name: 'imagePreView' |
|
572 |
#activeHelpKey: #previewView |
|
573 |
#hasHorizontalScrollBar: true |
|
574 |
#hasVerticalScrollBar: true |
|
575 |
#miniScrollerHorizontal: true |
|
576 |
#miniScrollerVertical: true |
|
577 |
#component: #ImageView |
|
578 |
#hasBorder: false |
|
579 |
) |
|
580 |
) |
|
581 |
) |
|
582 |
#handles: #(#Any 0.723776 1.0) |
|
583 |
) |
|
584 |
) |
|
585 |
) |
|
586 |
) |
|
587 |
#(#ViewSpec |
|
588 |
#name: 'view2' |
|
589 |
#component: |
|
590 |
#(#SpecCollection |
|
591 |
#collection: |
|
592 |
#( |
|
593 |
#(#ArbitraryComponentSpec |
|
594 |
#name: 'imageEditView' |
|
595 |
#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
596 |
#hasHorizontalScrollBar: true |
|
597 |
#hasVerticalScrollBar: true |
|
598 |
#component: #ImageEditView |
|
599 |
#hasBorder: false |
|
600 |
) |
|
601 |
#(#LabelSpec |
|
602 |
#name: 'coordLabel' |
|
603 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
604 |
#labelChannel: #imageInfoHolder |
767 | 605 |
#level: -1 |
606 |
#adjust: #left |
|
607 |
#resizeForLabel: false |
|
608 |
) |
|
609 |
#(#ArrowButtonSpec |
|
610 |
#name: 'magnifyDownButton' |
|
611 |
#layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
612 |
#activeHelpKey: #magnifyImageDown |
|
613 |
#model: #doMagnifyDown |
|
614 |
#enableChannel: #imageIsLoaded |
|
615 |
#isTriggerOnDown: true |
|
616 |
#direction: #left |
|
617 |
) |
|
618 |
#(#ArrowButtonSpec |
|
619 |
#name: 'magnifyUpButton' |
|
620 |
#layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
621 |
#activeHelpKey: #magnifyImageUp |
|
622 |
#model: #doMagnifyUp |
|
623 |
#enableChannel: #imageIsLoaded |
|
624 |
#isTriggerOnDown: true |
|
625 |
#direction: #right |
|
626 |
) |
|
627 |
#(#InputFieldSpec |
|
628 |
#name: 'magnificationInputField' |
|
629 |
#layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
630 |
#activeHelpKey: #magnificationNumber |
|
631 |
#enableChannel: #imageIsLoaded |
|
632 |
#model: #valueOfMagnification |
|
905 | 633 |
#type: #numberInRange |
767 | 634 |
#acceptOnReturn: false |
635 |
#acceptOnTab: false |
|
636 |
#numChars: 2 |
|
905 | 637 |
#minValue: 1 |
638 |
#maxValue: 99 |
|
767 | 639 |
) |
640 |
) |
|
641 |
) |
|
642 |
#level: -1 |
|
643 |
) |
|
644 |
) |
|
645 |
) |
|
646 |
#handles: #(#Any 0.276 1.0) |
|
647 |
) |
|
648 |
#(#UISubSpecification |
|
649 |
#name: 'infoBarSubSpec' |
|
650 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
651 |
#majorKey: #ToolApplicationModel |
|
652 |
#minorKey: #windowSpecForInfoBar |
|
653 |
) |
|
654 |
) |
|
655 |
) |
|
656 |
) |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
657 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
658 |
"Modified: / 7.8.1998 / 22:52:28 / cg" |
519 | 659 |
! ! |
660 |
||
661 |
!ImageEditor class methodsFor:'menu specs'! |
|
662 |
||
400 | 663 |
menu |
737 | 664 |
"This resource specification was automatically generated |
665 |
by the MenuEditor of ST/X." |
|
400 | 666 |
|
737 | 667 |
"Do not manually edit this!! If it is corrupted, |
668 |
the MenuEditor may not be able to read the specification." |
|
400 | 669 |
|
670 |
" |
|
671 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
672 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
673 |
" |
|
674 |
||
675 |
<resource: #menu> |
|
676 |
||
677 |
^ |
|
678 |
||
679 |
#(#Menu |
|
680 |
||
681 |
#( |
|
682 |
#(#MenuItem |
|
672 | 683 |
#label: 'About' |
843 | 684 |
#translateLabel: true |
672 | 685 |
#activeHelpKey: #about |
686 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
687 |
#submenuChannel: #menuAbout |
|
400 | 688 |
) |
689 |
#(#MenuItem |
|
672 | 690 |
#label: 'File' |
691 |
#translateLabel: true |
|
692 |
#activeHelpKey: #file |
|
693 |
#submenu: |
|
400 | 694 |
#(#Menu |
695 |
||
696 |
#( |
|
697 |
#(#MenuItem |
|
672 | 698 |
#label: 'New...' |
843 | 699 |
#translateLabel: true |
767 | 700 |
#value: #doNewImage |
672 | 701 |
#activeHelpKey: #fileNewImage |
400 | 702 |
) |
703 |
#(#MenuItem |
|
672 | 704 |
#label: '-' |
400 | 705 |
) |
706 |
#(#MenuItem |
|
672 | 707 |
#label: 'Load...' |
843 | 708 |
#translateLabel: true |
767 | 709 |
#value: #doLoadFromClass |
672 | 710 |
#activeHelpKey: #fileLoadFromClass |
400 | 711 |
) |
712 |
#(#MenuItem |
|
672 | 713 |
#label: 'Load From File...' |
843 | 714 |
#translateLabel: true |
767 | 715 |
#value: #doLoadFromFile |
672 | 716 |
#activeHelpKey: #fileLoadFromFile |
400 | 717 |
) |
718 |
#(#MenuItem |
|
929 | 719 |
#label: 'Grab From Screen' |
720 |
#translateLabel: true |
|
721 |
#value: #grabScreenImage |
|
722 |
#activeHelpKey: #fileGrabImage |
|
723 |
) |
|
724 |
#(#MenuItem |
|
672 | 725 |
#label: '-' |
400 | 726 |
) |
727 |
#(#MenuItem |
|
672 | 728 |
#label: 'Save' |
843 | 729 |
#translateLabel: true |
767 | 730 |
#value: #doSaveMethod |
672 | 731 |
#activeHelpKey: #fileSaveMethod |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
732 |
#enabled: #imageIsLoadedAndClassDefined |
400 | 733 |
) |
734 |
#(#MenuItem |
|
672 | 735 |
#label: 'Save As...' |
843 | 736 |
#translateLabel: true |
767 | 737 |
#value: #doSaveMethodAs |
672 | 738 |
#activeHelpKey: #fileSaveMethodAs |
739 |
#enabled: #imageIsLoaded |
|
740 |
) |
|
741 |
#(#MenuItem |
|
742 |
#label: '-' |
|
400 | 743 |
) |
744 |
#(#MenuItem |
|
672 | 745 |
#label: 'Save To File...' |
843 | 746 |
#translateLabel: true |
767 | 747 |
#value: #doSaveImageFileAs |
672 | 748 |
#activeHelpKey: #fileSaveAs |
749 |
#enabled: #imageIsLoaded |
|
400 | 750 |
) |
751 |
#(#MenuItem |
|
672 | 752 |
#label: 'Save Mask To File...' |
843 | 753 |
#translateLabel: true |
767 | 754 |
#value: #doSaveImageMaskFileAs |
672 | 755 |
#activeHelpKey: #fileSaveMaskAs |
756 |
#enabled: #imageIsLoaded |
|
400 | 757 |
) |
758 |
#(#MenuItem |
|
672 | 759 |
#label: '-' |
400 | 760 |
) |
761 |
#(#MenuItem |
|
672 | 762 |
#label: 'Print' |
843 | 763 |
#translateLabel: true |
767 | 764 |
#value: #doPrint |
672 | 765 |
#activeHelpKey: #filePrint |
766 |
#enabled: #imageIsLoaded |
|
400 | 767 |
) |
768 |
#(#MenuItem |
|
672 | 769 |
#label: '-' |
400 | 770 |
) |
771 |
#(#MenuItem |
|
672 | 772 |
#label: 'Browse Class' |
843 | 773 |
#translateLabel: true |
767 | 774 |
#value: #doBrowseClass |
672 | 775 |
#activeHelpKey: #fileBrowseClass |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
776 |
#enabled: #hasClassDefined |
400 | 777 |
) |
778 |
#(#MenuItem |
|
672 | 779 |
#label: '-' |
400 | 780 |
) |
781 |
#(#MenuItem |
|
672 | 782 |
#label: 'Exit' |
783 |
#translateLabel: true |
|
784 |
#value: #closeRequest |
|
785 |
#activeHelpKey: #fileExit |
|
400 | 786 |
) |
787 |
) nil |
|
788 |
nil |
|
789 |
) |
|
790 |
) |
|
791 |
#(#MenuItem |
|
672 | 792 |
#label: 'Edit' |
843 | 793 |
#translateLabel: true |
672 | 794 |
#activeHelpKey: #edit |
795 |
#enabled: #imageIsLoaded |
|
796 |
#submenu: |
|
400 | 797 |
#(#Menu |
798 |
||
799 |
#( |
|
800 |
#(#MenuItem |
|
672 | 801 |
#label: 'Undo' |
843 | 802 |
#translateLabel: true |
767 | 803 |
#value: #doUndo |
672 | 804 |
#activeHelpKey: #editUndo |
805 |
#enabled: #valueOfCanUndo |
|
400 | 806 |
) |
807 |
#(#MenuItem |
|
672 | 808 |
#label: '-' |
400 | 809 |
) |
810 |
#(#MenuItem |
|
672 | 811 |
#label: 'Flip - Vertical' |
843 | 812 |
#translateLabel: true |
767 | 813 |
#value: #doFlipVertical |
672 | 814 |
#activeHelpKey: #editFlipVertical |
400 | 815 |
) |
816 |
#(#MenuItem |
|
672 | 817 |
#label: 'Flip - Horizontal' |
843 | 818 |
#translateLabel: true |
767 | 819 |
#value: #doFlipHorizontal |
672 | 820 |
#activeHelpKey: #editFlipHorizontal |
400 | 821 |
) |
822 |
#(#MenuItem |
|
672 | 823 |
#label: '-' |
400 | 824 |
) |
825 |
#(#MenuItem |
|
672 | 826 |
#label: 'Resize...' |
843 | 827 |
#translateLabel: true |
767 | 828 |
#value: #doResizeImage |
672 | 829 |
#activeHelpKey: #editResize |
400 | 830 |
) |
831 |
#(#MenuItem |
|
672 | 832 |
#label: 'Magnify...' |
843 | 833 |
#translateLabel: true |
767 | 834 |
#value: #doMagnifyImage |
672 | 835 |
#activeHelpKey: #editMagnifyImage |
400 | 836 |
) |
837 |
#(#MenuItem |
|
672 | 838 |
#label: 'Rotate...' |
843 | 839 |
#translateLabel: true |
767 | 840 |
#value: #doRotateImage |
672 | 841 |
#activeHelpKey: #editRotate |
400 | 842 |
) |
843 |
) nil |
|
844 |
nil |
|
845 |
) |
|
846 |
) |
|
847 |
#(#MenuItem |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
848 |
#label: 'ColorMap' |
843 | 849 |
#translateLabel: true |
672 | 850 |
#activeHelpKey: #colorMap |
851 |
#enabled: #imageIsLoaded |
|
852 |
#submenu: |
|
400 | 853 |
#(#Menu |
854 |
||
855 |
#( |
|
856 |
#(#MenuItem |
|
672 | 857 |
#label: '8-Plane' |
843 | 858 |
#translateLabel: true |
929 | 859 |
#activeHelpKey: #colorMap8 |
672 | 860 |
#argument: '8-plane' |
861 |
#indication: #colorMapMode:value: |
|
862 |
) |
|
863 |
#(#MenuItem |
|
864 |
#label: '4-Plane' |
|
843 | 865 |
#translateLabel: true |
929 | 866 |
#activeHelpKey: #colorMap4 |
672 | 867 |
#argument: '4-plane' |
868 |
#indication: #colorMapMode:value: |
|
400 | 869 |
) |
870 |
#(#MenuItem |
|
672 | 871 |
#label: '2-Plane' |
843 | 872 |
#translateLabel: true |
929 | 873 |
#activeHelpKey: #colorMap2 |
672 | 874 |
#argument: '2-plane' |
875 |
#indication: #colorMapMode:value: |
|
400 | 876 |
) |
877 |
#(#MenuItem |
|
672 | 878 |
#label: '1-Plane' |
843 | 879 |
#translateLabel: true |
929 | 880 |
#activeHelpKey: #colorMap1 |
672 | 881 |
#argument: '1-plane' |
882 |
#indication: #colorMapMode:value: |
|
400 | 883 |
) |
884 |
#(#MenuItem |
|
672 | 885 |
#label: '-' |
886 |
) |
|
887 |
#(#MenuItem |
|
888 |
#label: '8-Plane + Mask' |
|
843 | 889 |
#translateLabel: true |
929 | 890 |
#activeHelpKey: #colorMap8M |
672 | 891 |
#argument: '8-plane + mask' |
892 |
#indication: #colorMapMode:value: |
|
400 | 893 |
) |
894 |
#(#MenuItem |
|
672 | 895 |
#label: '4-Plane + Mask' |
843 | 896 |
#translateLabel: true |
929 | 897 |
#activeHelpKey: #colorMap4M |
672 | 898 |
#argument: '4-plane + mask' |
899 |
#indication: #colorMapMode:value: |
|
400 | 900 |
) |
901 |
#(#MenuItem |
|
672 | 902 |
#label: '2-Plane + Mask' |
843 | 903 |
#translateLabel: true |
929 | 904 |
#activeHelpKey: #colorMap2M |
672 | 905 |
#argument: '2-plane + mask' |
906 |
#indication: #colorMapMode:value: |
|
907 |
) |
|
908 |
#(#MenuItem |
|
909 |
#label: '1-Plane + Mask' |
|
843 | 910 |
#translateLabel: true |
929 | 911 |
#activeHelpKey: #colorMap1M |
672 | 912 |
#argument: '1-plane + mask' |
913 |
#indication: #colorMapMode:value: |
|
400 | 914 |
) |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
915 |
#(#MenuItem |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
916 |
#label: '-' |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
917 |
) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
918 |
#(#MenuItem |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
919 |
#label: 'Compress colormap' |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
920 |
#translateLabel: true |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
921 |
#value: #compressColorMap |
929 | 922 |
#activeHelpKey: #compressColormap |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
923 |
) |
400 | 924 |
) nil |
925 |
nil |
|
926 |
) |
|
927 |
) |
|
928 |
#(#MenuItem |
|
737 | 929 |
#label: 'Settings' |
843 | 930 |
#translateLabel: true |
737 | 931 |
#submenu: |
932 |
#(#Menu |
|
933 |
||
934 |
#( |
|
935 |
#(#MenuItem |
|
905 | 936 |
#label: 'Grid Magnification...' |
937 |
#translateLabel: true |
|
938 |
#value: #doChangeGridMagnification |
|
939 |
#activeHelpKey: #settingsGridMagnification |
|
940 |
) |
|
941 |
#(#MenuItem |
|
942 |
#label: '-' |
|
943 |
) |
|
944 |
#(#MenuItem |
|
737 | 945 |
#label: 'Fonts' |
843 | 946 |
#translateLabel: true |
737 | 947 |
#submenuChannel: #menuFont |
948 |
) |
|
949 |
) nil |
|
950 |
nil |
|
951 |
) |
|
952 |
) |
|
953 |
#(#MenuItem |
|
756 | 954 |
#label: 'History' |
843 | 955 |
#translateLabel: true |
756 | 956 |
#activeHelpKey: #history |
957 |
#submenuChannel: #menuHistory |
|
958 |
) |
|
959 |
#(#MenuItem |
|
672 | 960 |
#label: 'Help' |
843 | 961 |
#translateLabel: true |
672 | 962 |
#startGroup: #right |
963 |
#activeHelpKey: #help |
|
964 |
#submenuChannel: #menuHelp |
|
400 | 965 |
) |
966 |
) nil |
|
967 |
nil |
|
968 |
) |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
969 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
970 |
"Modified: / 31.7.1998 / 02:04:49 / cg" |
400 | 971 |
! |
972 |
||
679 | 973 |
menuMouseButtonColors |
737 | 974 |
"This resource specification was automatically generated |
975 |
by the MenuEditor of ST/X." |
|
679 | 976 |
|
737 | 977 |
"Do not manually edit this!! If it is corrupted, |
978 |
the MenuEditor may not be able to read the specification." |
|
679 | 979 |
|
980 |
" |
|
981 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
982 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
983 |
" |
|
984 |
||
985 |
<resource: #menu> |
|
986 |
||
987 |
^ |
|
988 |
||
989 |
#(#Menu |
|
990 |
||
991 |
#( |
|
992 |
#(#MenuItem |
|
993 |
#label: 'Left Mouse Button' |
|
994 |
#nameKey: #leftMouseKeyButton |
|
995 |
#activeHelpKey: #mouseKeyColorMode |
|
996 |
#argument: '1' |
|
997 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
|
998 |
#indication: #mouseKeyColorMode:value: |
|
999 |
) |
|
1000 |
#(#MenuItem |
|
1001 |
#label: 'Right Mouse Button' |
|
1002 |
#nameKey: #rightMouseKeyButton |
|
1003 |
#activeHelpKey: #mouseKeyColorMode |
|
1004 |
#argument: '2' |
|
1005 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
|
1006 |
#indication: #mouseKeyColorMode:value: |
|
1007 |
) |
|
1008 |
) nil |
|
1009 |
nil |
|
1010 |
) |
|
1011 |
! |
|
1012 |
||
400 | 1013 |
menuToolbar |
737 | 1014 |
"This resource specification was automatically generated |
1015 |
by the MenuEditor of ST/X." |
|
400 | 1016 |
|
737 | 1017 |
"Do not manually edit this!! If it is corrupted, |
1018 |
the MenuEditor may not be able to read the specification." |
|
400 | 1019 |
|
1020 |
" |
|
1021 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
1022 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
1023 |
" |
|
1024 |
||
1025 |
<resource: #menu> |
|
1026 |
||
1027 |
^ |
|
1028 |
||
1029 |
#(#Menu |
|
1030 |
||
1031 |
#( |
|
1032 |
#(#MenuItem |
|
672 | 1033 |
#label: 'newImage' |
1034 |
#isButton: true |
|
767 | 1035 |
#value: #doNewImage |
672 | 1036 |
#activeHelpKey: #fileNewImage |
880 | 1037 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
400 | 1038 |
) |
1039 |
#(#MenuItem |
|
672 | 1040 |
#label: 'loadFromClass' |
1041 |
#isButton: true |
|
767 | 1042 |
#value: #doLoadFromClass |
672 | 1043 |
#activeHelpKey: #fileLoadFromClass |
880 | 1044 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
672 | 1045 |
) |
1046 |
#(#MenuItem |
|
1047 |
#label: 'saveMethod' |
|
1048 |
#isButton: true |
|
767 | 1049 |
#value: #doSaveMethod |
672 | 1050 |
#activeHelpKey: #fileSaveMethod |
1051 |
#enabled: #imageIsLoaded |
|
880 | 1052 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
400 | 1053 |
) |
1054 |
#(#MenuItem |
|
672 | 1055 |
#label: '' |
400 | 1056 |
) |
1057 |
#(#MenuItem |
|
672 | 1058 |
#label: '' |
1059 |
) |
|
1060 |
#(#MenuItem |
|
1061 |
#label: '' |
|
1062 |
) |
|
1063 |
#(#MenuItem |
|
1064 |
#label: '' |
|
400 | 1065 |
) |
1066 |
#(#MenuItem |
|
672 | 1067 |
#label: 'Point' |
1068 |
#activeHelpKey: #drawModePoint |
|
1069 |
#enabled: #imageIsLoaded |
|
1070 |
#argument: 'point' |
|
1071 |
#indication: #editMode:value: |
|
400 | 1072 |
) |
1073 |
#(#MenuItem |
|
672 | 1074 |
#label: 'Box' |
1075 |
#activeHelpKey: #drawModeBox |
|
1076 |
#enabled: #imageIsLoaded |
|
1077 |
#argument: 'box' |
|
1078 |
#indication: #editMode:value: |
|
400 | 1079 |
) |
1080 |
#(#MenuItem |
|
672 | 1081 |
#label: 'Filled Box' |
1082 |
#activeHelpKey: #drawModeFilledBox |
|
1083 |
#enabled: #imageIsLoaded |
|
1084 |
#argument: 'filledBox' |
|
1085 |
#indication: #editMode:value: |
|
400 | 1086 |
) |
1087 |
#(#MenuItem |
|
672 | 1088 |
#label: 'Fill' |
1089 |
#activeHelpKey: #drawModeFill |
|
1090 |
#enabled: #imageIsLoaded |
|
1091 |
#argument: 'fill' |
|
1092 |
#indication: #editMode:value: |
|
400 | 1093 |
) |
1094 |
#(#MenuItem |
|
672 | 1095 |
#label: 'Copy' |
1096 |
#activeHelpKey: #drawModeCopy |
|
1097 |
#enabled: #imageIsLoaded |
|
1098 |
#argument: 'copy' |
|
1099 |
#indication: #editMode:value: |
|
400 | 1100 |
) |
1101 |
#(#MenuItem |
|
672 | 1102 |
#label: 'Paste' |
1103 |
#activeHelpKey: #drawModePaste |
|
1104 |
#enabled: #imageIsLoaded |
|
1105 |
#argument: 'paste' |
|
1106 |
#indication: #editMode:value: |
|
400 | 1107 |
) |
914 | 1108 |
#(#MenuItem |
1109 |
#label: 'Paste Under' |
|
1110 |
#activeHelpKey: #drawModePasteUnder |
|
1111 |
#enabled: #imageIsLoaded |
|
1112 |
#argument: 'pasteUnder' |
|
1113 |
#indication: #editMode:value: |
|
1114 |
) |
|
400 | 1115 |
) nil |
1116 |
nil |
|
1117 |
) |
|
1118 |
! ! |
|
1119 |
||
1120 |
!ImageEditor methodsFor:'accessing'! |
|
1121 |
||
1122 |
image |
|
767 | 1123 |
"returns the current editing image" |
400 | 1124 |
|
911 | 1125 |
^imageEditView image |
400 | 1126 |
! |
1127 |
||
1128 |
postOpenAction: anAction |
|
767 | 1129 |
"sets an action which is evaluated after opening" |
400 | 1130 |
|
1131 |
postOpenAction := anAction |
|
1132 |
! ! |
|
1133 |
||
1134 |
!ImageEditor methodsFor:'accessing - views'! |
|
1135 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1136 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1137 |
"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
|
1138 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1139 |
^(builder componentAt: #colorDataSetView) |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1140 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1141 |
"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
|
1142 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1143 |
|
487 | 1144 |
coordLabel |
767 | 1145 |
"returns the view the coord label" |
487 | 1146 |
|
1147 |
^builder componentAt: #coordLabel |
|
1148 |
! |
|
1149 |
||
400 | 1150 |
imageEditView |
911 | 1151 |
"returns the view of the image" |
400 | 1152 |
|
911 | 1153 |
^imageEditView := (builder componentAt: #imageEditView) subViews first |
400 | 1154 |
! |
1155 |
||
1156 |
imagePreView |
|
767 | 1157 |
"returns the preview of the image" |
400 | 1158 |
|
1159 |
^(builder componentAt: #imagePreView) subViews first |
|
475 | 1160 |
! ! |
1161 |
||
400 | 1162 |
!ImageEditor methodsFor:'aspects'! |
1163 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1164 |
activityInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1165 |
^ self valueOfInfoLabel |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1166 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1167 |
"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
|
1168 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1169 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1170 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1171 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1172 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1173 |
"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
|
1174 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1175 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1176 |
hasClassAndSelectorDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1177 |
^ [(Smalltalk at:(imageEditView resourceClass) ifAbsent:nil) notNil |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1178 |
and:[imageEditView resourceSelector notNil]] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1179 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1180 |
"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
|
1181 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1182 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1183 |
hasClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1184 |
^ [(Smalltalk at:(imageEditView resourceClass) ifAbsent:nil) notNil] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1185 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1186 |
"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
|
1187 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1188 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1189 |
imageInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1190 |
|holder| |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1191 |
(holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1192 |
builder aspectAt:#imageInfoHolder put:(holder := '' asValue). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1193 |
]. |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1194 |
^ holder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1195 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1196 |
"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
|
1197 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1198 |
|
400 | 1199 |
imageIsLoaded |
767 | 1200 |
"returns whether an image is loaded as value holder" |
400 | 1201 |
|
1202 |
|holder| |
|
1203 |
(holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[ |
|
1204 |
builder aspectAt:#imageIsLoaded put:(holder := false asValue). |
|
1205 |
]. |
|
1206 |
^ holder |
|
1207 |
! |
|
1208 |
||
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1209 |
imageIsLoadedAndClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1210 |
"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
|
1211 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1212 |
^ [self hasClassAndSelectorDefined value |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1213 |
and:[self imageIsLoaded value]] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1214 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1215 |
"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
|
1216 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1217 |
|
400 | 1218 |
listOfColors |
767 | 1219 |
"returns the list of colors in a List" |
400 | 1220 |
|
1221 |
|holder| |
|
1222 |
(holder := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
1223 |
builder aspectAt:#listOfColors put:(holder := List new). |
|
942 | 1224 |
holder addDependent:self. |
400 | 1225 |
]. |
1226 |
^ holder |
|
1227 |
! |
|
1228 |
||
1229 |
selectionOfColor |
|
767 | 1230 |
"returns current selection of the edit color as an AspectAdaptor" |
400 | 1231 |
|
1232 |
|holder| |
|
1233 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
|
1234 |
builder aspectAt:#selectionOfColor put:( |
|
1235 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex). |
|
1236 |
]. |
|
1237 |
^ holder |
|
1238 |
! |
|
1239 |
||
1240 |
valueOfMagnification |
|
767 | 1241 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 1242 |
|
1243 |
|holder| |
|
1244 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
1245 |
builder aspectAt:#valueOfMagnification put:( |
|
1246 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
1247 |
]. |
|
1248 |
^ holder |
|
1249 |
! ! |
|
1250 |
||
767 | 1251 |
!ImageEditor methodsFor:'change & update'! |
1252 |
||
1253 |
findColorMapMode |
|
899 | 1254 |
"finds the colorMapMode for a new image" |
767 | 1255 |
|
1256 |
self image depth > 8 ifTrue: [colorMapMode := ''. self listOfColors removeAll. ^nil]. |
|
1257 |
colorMapMode := self image depth printString, '-plane'. |
|
1258 |
self listOfColors isEmpty |
|
1259 |
ifTrue: |
|
1260 |
[ |
|
1261 |
self colorMapMode: colorMapMode value: nil |
|
1262 |
]. |
|
911 | 1263 |
imageEditView selectColors: (Array with: (self listOfColors at: 1) with: (self listOfColors at: 2 ifAbsent: [self listOfColors at: 1])). |
898 | 1264 |
|
1265 |
self image mask notNil |
|
767 | 1266 |
ifTrue: |
1267 |
[ |
|
1268 |
colorMapMode := colorMapMode, ' + mask'. |
|
898 | 1269 |
(self listOfColors detect: [:clr| clr = (Color basicNew setColorId:0)] ifNone: nil) isNil |
1270 |
ifTrue: |
|
1271 |
[ |
|
1272 |
self listOfColors addFirst: (Color basicNew setColorId:0). |
|
911 | 1273 |
imageEditView selectColors: (Array with: (self listOfColors at: 2 ifAbsent: [self listOfColors at: 1]) with: (self listOfColors at: 1)). |
898 | 1274 |
] |
767 | 1275 |
]. |
1276 |
self selectionOfColor value: 0. |
|
911 | 1277 |
self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor). |
767 | 1278 |
! |
1279 |
||
942 | 1280 |
update:something with:aParameter from:changedObject |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1281 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1282 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1283 |
"/ colormap entry changed at aParameter |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1284 |
self image colorMap at:aParameter put:(changedObject at:aParameter). |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1285 |
self colorMapChanged. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1286 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1287 |
]. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1288 |
]. |
942 | 1289 |
super update:something with:aParameter from:changedObject |
1290 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1291 |
"Modified: / 7.8.1998 / 22:32:09 / cg" |
942 | 1292 |
! |
1293 |
||
767 | 1294 |
updateForNoneImage |
1295 |
"updates channels and view, if image is loaded" |
|
1296 |
||
1297 |
self imageIsLoaded value: false. |
|
1298 |
self listOfColors removeAll. |
|
1299 |
self imagePreView image: nil |
|
1300 |
||
1301 |
||
1302 |
||
1303 |
||
1304 |
! |
|
1305 |
||
1306 |
updateLabelsAndHistory |
|
1307 |
"updates labels and history, if something has changed" |
|
1308 |
||
1309 |
self imageIsLoaded value: self image notNil. |
|
1310 |
||
1311 |
self image isNil ifTrue: [^nil]. |
|
1312 |
||
1313 |
self updateInfoLabel. |
|
1314 |
||
911 | 1315 |
imageEditView resourceMessage asCollectionOfWords size = 2 |
1316 |
ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:]. |
|
767 | 1317 |
|
1318 |
self image fileName notNil |
|
1319 |
ifTrue: [self addToHistory: self image fileName -> #loadFromFile:]. |
|
1320 |
||
1321 |
||
1322 |
||
1323 |
! ! |
|
1324 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1325 |
!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
|
1326 |
|
942 | 1327 |
blueAtColor:aColor put:newBlue |
1328 |
"helper used to return a new row element, when blue is changed" |
|
1329 |
||
1330 |
|byte| |
|
1331 |
||
1332 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1333 |
byte := newBlue clampBetween:0 and:255. |
|
1334 |
^ Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte |
|
1335 |
! |
|
1336 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1337 |
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
|
1338 |
"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
|
1339 |
|
930 | 1340 |
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
|
1341 |
^ 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
|
1342 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1343 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 1344 |
"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
|
1345 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1346 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1347 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1348 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1349 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1350 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1351 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1352 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1353 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1354 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1355 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1356 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1357 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1358 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1359 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1360 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1361 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1362 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1363 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1364 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1365 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1366 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1367 |
|
942 | 1368 |
greenAtColor:aColor put:newGreen |
1369 |
"helper used to return a new row element, when green is changed" |
|
1370 |
||
1371 |
|byte| |
|
1372 |
||
1373 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1374 |
byte := newGreen clampBetween:0 and:255. |
|
1375 |
^ Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte) |
|
1376 |
! |
|
1377 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1378 |
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
|
1379 |
"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
|
1380 |
|
930 | 1381 |
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
|
1382 |
^ 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
|
1383 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1384 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 1385 |
"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
|
1386 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1387 |
|
942 | 1388 |
redAtColor:aColor put:newRed |
1389 |
"helper used to return a new row element, when red is changed" |
|
1390 |
||
1391 |
|byte| |
|
1392 |
||
1393 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1394 |
byte := newRed clampBetween:0 and:255. |
|
1395 |
^ Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte) |
|
1396 |
! |
|
1397 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1398 |
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
|
1399 |
"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
|
1400 |
|
930 | 1401 |
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
|
1402 |
^ 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
|
1403 |
|
930 | 1404 |
"Modified: / 31.7.1998 / 01:11:35 / 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
|
1405 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1406 |
|
672 | 1407 |
!ImageEditor methodsFor:'help'! |
1408 |
||