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