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