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