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