ImageEditor.st
author tm
Wed, 19 Aug 1998 12:52:51 +0200
changeset 961 9b6928725d49
parent 960 6196f12b97f6
child 975 ede3746e0dea
permissions -rw-r--r--
added meter to user-gallery
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
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    14
	instanceVariableNames:'imageEditView colorMapMode selectedColorIndex postOpenAction'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    15
	classVariableNames:''
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    16
	poolDictionaries:''
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
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
941
6d75430a8120 fixed start call in docu
tz
parents: 937
diff changeset
    42
        ImageEditor openOnClass:Icon andSelector:#startIcon
400
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
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   163
    ^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64')
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   164
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   165
    "Modified: / 31.7.1998 / 01:57:34 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   166
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   167
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   168
!ImageEditor class methodsFor:'help specs'!
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   169
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   170
helpSpec
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   171
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   172
     by the UIHelpTool of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   173
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   174
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   175
     the UIHelpTool may not be able to read the specification."
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   176
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   177
    "
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   178
     UIHelpTool openOnClass:ImageEditor    
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   179
    "
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   180
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   181
    <resource: #help>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   182
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   183
    ^super helpSpec addPairsFrom:#(
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   184
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   185
#colorMap
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   186
'ColorMap functions.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   187
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   188
#colorMap1
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   189
'Convert to depth-1 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   190
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   191
#colorMap2
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   192
'Convert to depth-2 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   193
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   194
#colorMap4
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   195
'Convert to depth-4 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   196
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   197
#colorMap8
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   198
'Convert to depth-8 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   199
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   200
#colorMap1M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   201
'Convert to depth-1 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   202
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   203
#colorMap2M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   204
'Convert to depth-2 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   205
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   206
#colorMap4M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   207
'Convert to depth-4 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   208
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   209
#colorMap8M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   210
'Convert to depth-8 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   211
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   212
#compressColormap
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   213
'Remove unneeded entries from the colorMap.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   214
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   215
#colorMapTable
675
25a770a729fc some help text changed
tz
parents: 674
diff changeset
   216
'Shows a list of used colors of the image.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   217
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   218
#drawModeBox
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   219
'Switches to box-drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   220
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   221
#drawModeCopy
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   222
'Switches to area-copy mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   223
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   224
#drawModeFill
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   225
'Switches to flood-fill mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   226
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   227
#drawModeFilledBox
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   228
'Switches to filled-box drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   229
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   230
#drawModePaste
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   231
'Switches to paste mode.'
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   232
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   233
#drawModePasteUnder
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   234
'Switches to paste under mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   235
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   236
#drawModePoint
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   237
'Switches to point-drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   238
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   239
#editFlipHorizontal
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   240
'Flips the image horizontally.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   241
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   242
#editFlipVertical
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   243
'Flips the image vertically.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   244
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   245
#editMagnifyImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   246
'Magnify the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   247
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   248
#editNegate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   249
'Invert the images colors.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   250
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   251
#editResize
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   252
'Resize the image (preserving the old image).'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   253
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   254
#editRotate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   255
'Rotate the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   256
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   257
#fileGrabImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   258
'Pick an image from the screen.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   259
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   260
#fileLoadFromClass
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   261
'Select and load an image from a resource method.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   262
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   263
#fileLoadFromFile
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   264
'Select and load an image from a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   265
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   266
#fileNewImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   267
'Create a new image'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   268
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   269
#filePrint
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   270
'Print the image on a postscript printer.'
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   271
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   272
#fileSaveAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   273
'Save the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   274
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   275
#fileSaveMaskAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   276
'Save the mask of the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   277
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   278
#fileSaveMethod
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   279
'Save the image as resource method in the current class and selector.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   280
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   281
#fileSaveMethodAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   282
'Save the image as resource method in a class.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   283
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   284
#historyMenuItem
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   285
'Edit this image.'
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   286
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   287
#magnificationNumber
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   288
'Shows the current magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   289
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   290
#magnifyImageDown
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   291
'Decrease magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   292
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   293
#magnifyImageUp
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   294
'Increase magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   295
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   296
#mouseKeyColorMode
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   297
'Toggles between left and right mouse button color.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   298
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   299
#previewView
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   300
'Shows a preview of the image.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   301
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   302
#settingsGridMagnification
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   303
'Change the grid magnification of the edit view.'
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   304
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   305
)
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   306
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   307
    "Modified: / 29.7.1998 / 22:27:36 / cg"
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   308
! !
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   309
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   310
!ImageEditor class methodsFor:'image specs'!
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   311
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   312
leftMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   313
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   314
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   315
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   316
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   317
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   318
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   319
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   320
     ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   321
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   322
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   323
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   324
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   325
    ^Icon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   326
        constantNamed:#'ImageEditor leftMouseKeyIcon'
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   327
        ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JEE@@B!!QP@@(TT@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]!
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   328
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   329
rightMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   330
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   331
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   332
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   333
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   334
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   335
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   336
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   337
     ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   338
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   339
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   340
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   341
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   342
    ^Icon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   343
        constantNamed:#'ImageEditor rightMouseKeyIcon'
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   344
        ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EEJ@@AQR @@TT(@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]! !
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   345
400
228524287573 intitial checkin
tz
parents:
diff changeset
   346
!ImageEditor class methodsFor:'interface specs'!
228524287573 intitial checkin
tz
parents:
diff changeset
   347
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   348
dialogSpecForNewImage
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   349
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   350
     by the UIPainter of ST/X."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   351
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   352
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   353
     the UIPainter may not be able to read the specification."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   354
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   355
    "
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   356
     UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   357
     ImageEditor new openInterface:#dialogSpecForNewImage
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   358
    "
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   359
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   360
    <resource: #canvas>
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   361
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   362
    ^
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   363
     
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   364
       #(#FullSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   365
          #window: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   366
           #(#WindowSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   367
              #name: 'New Image'
951
457d94e33e93 fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   368
              #layout: #(#LayoutFrame 216 0 173 0 516 0 291 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   369
              #label: 'New Image'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   370
              #min: #(#Point 10 10)
738210a2fa06 revised version
tz
parents: 651
diff changeset
   371
              #max: #(#Point 1152 900)
951
457d94e33e93 fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   372
              #bounds: #(#Rectangle 216 173 517 292)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   373
              #usePreferredExtent: false
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   374
          )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   375
          #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   376
           #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   377
              #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   378
               #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   379
                 #(#ViewSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   380
                    #name: 'View'
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   381
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   382
                    #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   383
                     #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   384
                        #collection: 
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
                           #(#FramedBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   387
                              #name: 'framedBox1'
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   388
                              #layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   389
                              #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   390
                               #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   391
                                  #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   392
                                   #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   393
                                     #(#ComboBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   394
                                        #name: 'defaultSizesComboBox'
951
457d94e33e93 fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   395
                                        #layout: #(#LayoutFrame -8 0.0 13 0.0 89 0.0 36 0.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   396
                                        #model: #selectionOfSize
738210a2fa06 revised version
tz
parents: 651
diff changeset
   397
                                        #type: #string
738210a2fa06 revised version
tz
parents: 651
diff changeset
   398
                                        #comboList: #listOfDefaultSizes
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   399
                                    )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   400
                                  )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   401
                              )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   402
                              #label: 'Size'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   403
                              #labelPosition: #topLeft
738210a2fa06 revised version
tz
parents: 651
diff changeset
   404
                              #style: #(#FontDescription #helvetica #medium #roman 12)
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   405
                          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   406
                           #(#FramedBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   407
                              #name: 'framedBox2'
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   408
                              #layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   409
                              #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   410
                               #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   411
                                  #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   412
                                   #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   413
                                     #(#ComboListSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   414
                                        #name: 'colorMapComboBox'
951
457d94e33e93 fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   415
                                        #layout: #(#LayoutFrame -4 0.0 12 0.0 144 0.0 35 0.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   416
                                        #model: #selectionOfColorMap
738210a2fa06 revised version
tz
parents: 651
diff changeset
   417
                                        #comboList: #listOfColorMaps
738210a2fa06 revised version
tz
parents: 651
diff changeset
   418
                                        #useIndex: false
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   419
                                    )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   420
                                  )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   421
                              )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   422
                              #label: 'Color Map'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   423
                              #labelPosition: #topLeft
738210a2fa06 revised version
tz
parents: 651
diff changeset
   424
                              #style: #(#FontDescription #helvetica #medium #roman 12)
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   425
                          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   426
                        )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   427
                    )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   428
                    #level: 1
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   429
                )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   430
                 #(#UISubSpecification
738210a2fa06 revised version
tz
parents: 651
diff changeset
   431
                    #name: 'UISubSpecification1'
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   432
                    #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   433
                    #majorKey: #ToolApplicationModel
738210a2fa06 revised version
tz
parents: 651
diff changeset
   434
                    #minorKey: #windowSpecForCommitWithoutChannels
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   435
                )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   436
              )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   437
          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   438
      )
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   439
951
457d94e33e93 fixed layout (change with framedBox - sigh)
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   440
    "Modified: / 13.8.1998 / 19:56:22 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   441
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   442
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   443
windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   444
    "This resource specification was automatically generated
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   445
     by the UIPainter of ST/X."
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   446
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   447
    "Do not manually edit this!! If it is corrupted,
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   448
     the UIPainter may not be able to read the specification."
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   449
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   450
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   451
     UIPainter new openOnClass:ImageEditor andSelector:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   452
     ImageEditor new openInterface:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   453
     ImageEditor open
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   454
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   455
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   456
    <resource: #canvas>
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   457
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   458
    ^
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   459
     
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   460
       #(#FullSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   461
          #window: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   462
           #(#WindowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   463
              #name: 'Image Editor'
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   464
              #layout: #(#LayoutFrame 176 0 156 0 675 0 501 0)
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   465
              #label: 'Image Editor'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   466
              #min: #(#Point 400 320)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   467
              #max: #(#Point 1152 900)
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   468
              #bounds: #(#Rectangle 176 156 676 502)
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   469
              #menu: #menu
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   470
              #usePreferredExtent: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   471
          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   472
          #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   473
           #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   474
              #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   475
               #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   476
                 #(#MenuPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   477
                    #name: 'menuToolbarView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   478
                    #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   479
                    #menu: #menuToolbar
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   480
                    #style: #(#FontDescription #helvetica #medium #roman 10)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   481
                    #showSeparatingLines: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   482
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   483
                 #(#VariableHorizontalPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   484
                    #name: 'variableHorizontalPanel1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   485
                    #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   486
                    #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   487
                     #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   488
                        #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   489
                         #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   490
                           #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   491
                              #name: 'view1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   492
                              #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   493
                               #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   494
                                  #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   495
                                   #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   496
                                     #(#VariableVerticalPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   497
                                        #name: 'VariableVerticalPanel1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   498
                                        #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   499
                                        #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   500
                                         #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   501
                                            #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   502
                                             #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   503
                                               #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   504
                                                  #name: 'View1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   505
                                                  #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   506
                                                   #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   507
                                                      #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   508
                                                       #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   509
                                                         #(#MenuPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   510
                                                            #name: 'MouseButtonColorToolBar'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   511
                                                            #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   512
                                                            #menu: #menuMouseButtonColors
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   513
                                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   514
                                                         #(#DataSetSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   515
                                                            #name: 'colorDataSetView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   516
                                                            #layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   517
                                                            #activeHelpKey: #colorMapTable
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   518
                                                            #model: #selectionOfColor
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   519
                                                            #style: #(#FontDescription #helvetica #medium #roman 10)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   520
                                                            #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   521
                                                            #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   522
                                                            #miniScrollerHorizontal: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   523
                                                            #miniScrollerVertical: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   524
                                                            #dataList: #listOfColors
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   525
                                                            #has3Dsepartors: true
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   526
                                                            #has3Dseparators: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   527
                                                            #verticalSpacing: 1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   528
                                                            #columns: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   529
                                                             #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   530
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   531
                                                                  #rendererType: #rowSelector
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   532
                                                                  #backgroundSelector: #yourself
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   533
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   534
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   535
                                                                  #label: 'R'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   536
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   537
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   538
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   539
                                                                  #type: #number
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
   540
                                                                  #model: #redFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   541
                                                                  #writeSelector: #redAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   542
                                                                  #selectSelector: #canSelectRedInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   543
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   544
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   545
                                                                  #label: 'G'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   546
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   547
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   548
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   549
                                                                  #type: #number
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
   550
                                                                  #model: #greenFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   551
                                                                  #writeSelector: #greenAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   552
                                                                  #selectSelector: #canSelectGreenInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   553
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   554
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   555
                                                                  #label: 'B'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   556
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   557
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   558
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   559
                                                                  #type: #number
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
   560
                                                                  #model: #blueFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   561
                                                                  #writeSelector: #blueAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   562
                                                                  #selectSelector: #canSelectBlueInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   563
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   564
                                                            )
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
   565
                                                            #columnAdaptor: #colorColumnAdaptor
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   566
                                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   567
                                                      )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   568
                                                  )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   569
                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   570
                                               #(#ArbitraryComponentSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   571
                                                  #name: 'imagePreView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   572
                                                  #activeHelpKey: #previewView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   573
                                                  #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   574
                                                  #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   575
                                                  #miniScrollerHorizontal: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   576
                                                  #miniScrollerVertical: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   577
                                                  #component: #ImageView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   578
                                                  #hasBorder: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   579
                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   580
                                            )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   581
                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   582
                                        #handles: #(#Any 0.723776 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   583
                                    )
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
                           #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   588
                              #name: 'view2'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   589
                              #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   590
                               #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   591
                                  #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   592
                                   #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   593
                                     #(#ArbitraryComponentSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   594
                                        #name: 'imageEditView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   595
                                        #layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   596
                                        #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   597
                                        #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   598
                                        #component: #ImageEditView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   599
                                        #hasBorder: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   600
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   601
                                     #(#LabelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   602
                                        #name: 'coordLabel'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   603
                                        #layout: #(#LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0)
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   604
                                        #labelChannel: #imageInfoHolder
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   605
                                        #level: -1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   606
                                        #adjust: #left
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   607
                                        #resizeForLabel: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   608
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   609
                                     #(#ArrowButtonSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   610
                                        #name: 'magnifyDownButton'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   611
                                        #layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   612
                                        #activeHelpKey: #magnifyImageDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   613
                                        #model: #doMagnifyDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   614
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   615
                                        #isTriggerOnDown: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   616
                                        #direction: #left
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   617
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   618
                                     #(#ArrowButtonSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   619
                                        #name: 'magnifyUpButton'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   620
                                        #layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   621
                                        #activeHelpKey: #magnifyImageUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   622
                                        #model: #doMagnifyUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   623
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   624
                                        #isTriggerOnDown: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   625
                                        #direction: #right
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   626
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   627
                                     #(#InputFieldSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   628
                                        #name: 'magnificationInputField'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   629
                                        #layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   630
                                        #activeHelpKey: #magnificationNumber
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   631
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   632
                                        #model: #valueOfMagnification
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   633
                                        #type: #numberInRange
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   634
                                        #acceptOnReturn: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   635
                                        #acceptOnTab: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   636
                                        #numChars: 2
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   637
                                        #minValue: 1
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   638
                                        #maxValue: 99
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   639
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   640
                                  )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   641
                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   642
                              #level: -1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   643
                          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   644
                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   645
                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   646
                    #handles: #(#Any 0.276 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   647
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   648
                 #(#UISubSpecification
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   649
                    #name: 'infoBarSubSpec'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   650
                    #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   651
                    #majorKey: #ToolApplicationModel
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   652
                    #minorKey: #windowSpecForInfoBar
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   653
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   654
              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   655
          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   656
      )
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   657
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   658
    "Modified: / 7.8.1998 / 22:52:28 / cg"
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   659
! !
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   660
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   661
!ImageEditor class methodsFor:'menu specs'!
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   662
400
228524287573 intitial checkin
tz
parents:
diff changeset
   663
menu
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   664
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   665
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
   666
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   667
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   668
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
   669
228524287573 intitial checkin
tz
parents:
diff changeset
   670
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   671
     MenuEditor new openOnClass:ImageEditor andSelector:#menu
228524287573 intitial checkin
tz
parents:
diff changeset
   672
     (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
   673
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   674
228524287573 intitial checkin
tz
parents:
diff changeset
   675
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
   676
228524287573 intitial checkin
tz
parents:
diff changeset
   677
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   678
     
228524287573 intitial checkin
tz
parents:
diff changeset
   679
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   680
          
228524287573 intitial checkin
tz
parents:
diff changeset
   681
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
   682
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   683
                #label: 'About'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   684
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   685
                #activeHelpKey: #about
738210a2fa06 revised version
tz
parents: 651
diff changeset
   686
                #labelImage: #(#ResourceRetriever nil #menuIcon)
738210a2fa06 revised version
tz
parents: 651
diff changeset
   687
                #submenuChannel: #menuAbout
400
228524287573 intitial checkin
tz
parents:
diff changeset
   688
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   689
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   690
                #label: 'File'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   691
                #translateLabel: true
738210a2fa06 revised version
tz
parents: 651
diff changeset
   692
                #activeHelpKey: #file
738210a2fa06 revised version
tz
parents: 651
diff changeset
   693
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
   694
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   695
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   696
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   697
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   698
                          #label: 'New...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   699
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   700
                          #value: #doNewImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   701
                          #activeHelpKey: #fileNewImage
400
228524287573 intitial checkin
tz
parents:
diff changeset
   702
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   703
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   704
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   705
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   706
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   707
                          #label: 'Load...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   708
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   709
                          #value: #doLoadFromClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   710
                          #activeHelpKey: #fileLoadFromClass
400
228524287573 intitial checkin
tz
parents:
diff changeset
   711
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   712
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   713
                          #label: 'Load From File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   714
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   715
                          #value: #doLoadFromFile
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   716
                          #activeHelpKey: #fileLoadFromFile
400
228524287573 intitial checkin
tz
parents:
diff changeset
   717
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   718
                       #(#MenuItem
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   719
                          #label: 'Grab From Screen'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   720
                          #translateLabel: true
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   721
                          #value: #grabScreenImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   722
                          #activeHelpKey: #fileGrabImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   723
                      )
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   724
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   725
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   726
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   727
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   728
                          #label: 'Save'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   729
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   730
                          #value: #doSaveMethod
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   731
                          #activeHelpKey: #fileSaveMethod
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   732
                          #enabled: #imageIsLoadedAndClassDefined
400
228524287573 intitial checkin
tz
parents:
diff changeset
   733
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   734
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   735
                          #label: 'Save As...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   736
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   737
                          #value: #doSaveMethodAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   738
                          #activeHelpKey: #fileSaveMethodAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   739
                          #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
   740
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
   741
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
   742
                          #label: '-'
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: 'Save To File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   746
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   747
                          #value: #doSaveImageFileAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   748
                          #activeHelpKey: #fileSaveAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   749
                          #enabled: #imageIsLoaded
400
228524287573 intitial checkin
tz
parents:
diff changeset
   750
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   751
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   752
                          #label: 'Save Mask To File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   753
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   754
                          #value: #doSaveImageMaskFileAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   755
                          #activeHelpKey: #fileSaveMaskAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   756
                          #enabled: #imageIsLoaded
400
228524287573 intitial checkin
tz
parents:
diff changeset
   757
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   758
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   759
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   760
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   761
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   762
                          #label: 'Print'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   763
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   764
                          #value: #doPrint
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   765
                          #activeHelpKey: #filePrint
738210a2fa06 revised version
tz
parents: 651
diff changeset
   766
                          #enabled: #imageIsLoaded
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: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   770
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   771
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   772
                          #label: 'Browse Class'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   773
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   774
                          #value: #doBrowseClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   775
                          #activeHelpKey: #fileBrowseClass
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   776
                          #enabled: #hasClassDefined
400
228524287573 intitial checkin
tz
parents:
diff changeset
   777
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   778
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   779
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   780
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   781
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   782
                          #label: 'Exit'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   783
                          #translateLabel: true
738210a2fa06 revised version
tz
parents: 651
diff changeset
   784
                          #value: #closeRequest
738210a2fa06 revised version
tz
parents: 651
diff changeset
   785
                          #activeHelpKey: #fileExit
400
228524287573 intitial checkin
tz
parents:
diff changeset
   786
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   787
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   788
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   789
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   790
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   791
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   792
                #label: 'Edit'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   793
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   794
                #activeHelpKey: #edit
738210a2fa06 revised version
tz
parents: 651
diff changeset
   795
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
   796
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
   797
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   798
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   799
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   800
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   801
                          #label: 'Undo'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   802
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   803
                          #value: #doUndo
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   804
                          #activeHelpKey: #editUndo
738210a2fa06 revised version
tz
parents: 651
diff changeset
   805
                          #enabled: #valueOfCanUndo
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: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   809
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   810
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   811
                          #label: 'Flip - Vertical'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   812
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   813
                          #value: #doFlipVertical
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   814
                          #activeHelpKey: #editFlipVertical
400
228524287573 intitial checkin
tz
parents:
diff changeset
   815
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   816
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   817
                          #label: 'Flip - Horizontal'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   818
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   819
                          #value: #doFlipHorizontal
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   820
                          #activeHelpKey: #editFlipHorizontal
400
228524287573 intitial checkin
tz
parents:
diff changeset
   821
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   822
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   823
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   824
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   825
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   826
                          #label: 'Resize...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   827
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   828
                          #value: #doResizeImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   829
                          #activeHelpKey: #editResize
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: 'Magnify...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   833
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   834
                          #value: #doMagnifyImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   835
                          #activeHelpKey: #editMagnifyImage
400
228524287573 intitial checkin
tz
parents:
diff changeset
   836
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   837
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   838
                          #label: 'Rotate...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   839
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   840
                          #value: #doRotateImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   841
                          #activeHelpKey: #editRotate
400
228524287573 intitial checkin
tz
parents:
diff changeset
   842
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   843
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   844
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   845
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   846
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   847
             #(#MenuItem
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   848
                #label: 'ColorMap'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   849
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   850
                #activeHelpKey: #colorMap
738210a2fa06 revised version
tz
parents: 651
diff changeset
   851
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
   852
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
   853
                 #(#Menu
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
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   857
                          #label: '8-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   858
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   859
                          #activeHelpKey: #colorMap8
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   860
                          #argument: '8-plane'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   861
                          #indication: #colorMapMode:value:
738210a2fa06 revised version
tz
parents: 651
diff changeset
   862
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
   863
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
   864
                          #label: '4-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   865
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   866
                          #activeHelpKey: #colorMap4
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   867
                          #argument: '4-plane'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   868
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   869
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   870
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   871
                          #label: '2-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   872
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   873
                          #activeHelpKey: #colorMap2
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   874
                          #argument: '2-plane'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   875
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   876
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   877
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   878
                          #label: '1-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   879
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   880
                          #activeHelpKey: #colorMap1
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   881
                          #argument: '1-plane'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   882
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   883
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   884
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   885
                          #label: '-'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   886
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
   887
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
   888
                          #label: '8-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   889
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   890
                          #activeHelpKey: #colorMap8M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   891
                          #argument: '8-plane + mask'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   892
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   893
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   894
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   895
                          #label: '4-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   896
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   897
                          #activeHelpKey: #colorMap4M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   898
                          #argument: '4-plane + mask'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   899
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   900
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   901
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   902
                          #label: '2-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   903
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   904
                          #activeHelpKey: #colorMap2M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   905
                          #argument: '2-plane + mask'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   906
                          #indication: #colorMapMode:value:
738210a2fa06 revised version
tz
parents: 651
diff changeset
   907
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
   908
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
   909
                          #label: '1-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   910
                          #translateLabel: true
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   911
                          #activeHelpKey: #colorMap1M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   912
                          #argument: '1-plane + mask'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   913
                          #indication: #colorMapMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
   914
                      )
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   915
                       #(#MenuItem
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   916
                          #label: '-'
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   917
                      )
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   918
                       #(#MenuItem
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   919
                          #label: 'Compress colormap'
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   920
                          #translateLabel: true
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   921
                          #value: #compressColorMap
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   922
                          #activeHelpKey: #compressColormap
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   923
                      )
400
228524287573 intitial checkin
tz
parents:
diff changeset
   924
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   925
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   926
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   927
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   928
             #(#MenuItem
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   929
                #label: 'Settings'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   930
                #translateLabel: true
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   931
                #submenu: 
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   932
                 #(#Menu
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   933
                    
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   934
                     #(
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   935
                       #(#MenuItem
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   936
                          #label: 'Grid Magnification...'
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   937
                          #translateLabel: true
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   938
                          #value: #doChangeGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   939
                          #activeHelpKey: #settingsGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   940
                      )
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   941
                       #(#MenuItem
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   942
                          #label: '-'
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   943
                      )
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   944
                       #(#MenuItem
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   945
                          #label: 'Fonts'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   946
                          #translateLabel: true
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   947
                          #submenuChannel: #menuFont
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   948
                      )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   949
                    ) nil
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   950
                    nil
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   951
                )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   952
            )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   953
             #(#MenuItem
756
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
   954
                #label: 'History'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   955
                #translateLabel: true
756
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
   956
                #activeHelpKey: #history
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
   957
                #submenuChannel: #menuHistory
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
   958
            )
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
   959
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   960
                #label: 'Help'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   961
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   962
                #startGroup: #right
738210a2fa06 revised version
tz
parents: 651
diff changeset
   963
                #activeHelpKey: #help
738210a2fa06 revised version
tz
parents: 651
diff changeset
   964
                #submenuChannel: #menuHelp
400
228524287573 intitial checkin
tz
parents:
diff changeset
   965
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   966
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   967
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
   968
      )
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
   969
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   970
    "Modified: / 31.7.1998 / 02:04:49 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   971
!
228524287573 intitial checkin
tz
parents:
diff changeset
   972
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   973
menuMouseButtonColors
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   974
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   975
     by the MenuEditor of ST/X."
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   976
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   977
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   978
     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
   979
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   980
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   981
     MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   982
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   983
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   984
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   985
    <resource: #menu>
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   986
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   987
    ^
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   988
     
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   989
       #(#Menu
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   990
          
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   991
           #(
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   992
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   993
                #label: 'Left Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   994
                #nameKey: #leftMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   995
                #activeHelpKey: #mouseKeyColorMode
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   996
                #argument: '1'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   997
                #labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon)
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   998
                #indication: #mouseKeyColorMode:value:
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
   999
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1000
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1001
                #label: 'Right Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1002
                #nameKey: #rightMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1003
                #activeHelpKey: #mouseKeyColorMode
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1004
                #argument: '2'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1005
                #labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon)
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1006
                #indication: #mouseKeyColorMode:value:
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1007
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1008
          ) nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1009
          nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1010
      )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1011
!
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1012
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1013
menuToolbar
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1014
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1015
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1016
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1017
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1018
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1019
228524287573 intitial checkin
tz
parents:
diff changeset
  1020
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1021
     MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
  1022
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
  1023
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1024
228524287573 intitial checkin
tz
parents:
diff changeset
  1025
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
  1026
228524287573 intitial checkin
tz
parents:
diff changeset
  1027
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
  1028
     
228524287573 intitial checkin
tz
parents:
diff changeset
  1029
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
  1030
          
228524287573 intitial checkin
tz
parents:
diff changeset
  1031
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
  1032
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1033
                #label: 'newImage'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1034
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1035
                #value: #doNewImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1036
                #activeHelpKey: #fileNewImage
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1037
                #labelImage: #(#ResourceRetriever #Icon #newIcon)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1038
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1039
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1040
                #label: 'loadFromClass'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1041
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1042
                #value: #doLoadFromClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1043
                #activeHelpKey: #fileLoadFromClass
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1044
                #labelImage: #(#ResourceRetriever #Icon #loadIcon)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1045
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1046
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1047
                #label: 'saveMethod'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1048
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1049
                #value: #doSaveMethod
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1050
                #activeHelpKey: #fileSaveMethod
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1051
                #enabled: #imageIsLoaded
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1052
                #labelImage: #(#ResourceRetriever #Icon #saveIcon)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1053
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1054
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1055
                #label: ''
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1056
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1057
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1058
                #label: ''
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1059
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1060
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1061
                #label: ''
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1062
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1063
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1064
                #label: ''
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1065
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1066
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1067
                #label: 'Point'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1068
                #activeHelpKey: #drawModePoint
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1069
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1070
                #argument: 'point'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1071
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1072
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1073
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1074
                #label: 'Box'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1075
                #activeHelpKey: #drawModeBox
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1076
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1077
                #argument: 'box'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1078
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1079
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1080
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1081
                #label: 'Filled Box'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1082
                #activeHelpKey: #drawModeFilledBox
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1083
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1084
                #argument: 'filledBox'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1085
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1086
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1087
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1088
                #label: 'Fill'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1089
                #activeHelpKey: #drawModeFill
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1090
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1091
                #argument: 'fill'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1092
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1093
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1094
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1095
                #label: 'Copy'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1096
                #activeHelpKey: #drawModeCopy
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1097
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1098
                #argument: 'copy'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1099
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1100
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1101
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1102
                #label: 'Paste'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1103
                #activeHelpKey: #drawModePaste
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1104
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1105
                #argument: 'paste'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1106
                #indication: #editMode:value:
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1107
            )
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1108
             #(#MenuItem
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1109
                #label: 'Paste Under'
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1110
                #activeHelpKey: #drawModePasteUnder
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1111
                #enabled: #imageIsLoaded
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1112
                #argument: 'pasteUnder'
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1113
                #indication: #editMode:value:
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1114
            )
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1115
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1116
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1117
      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1118
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1119
228524287573 intitial checkin
tz
parents:
diff changeset
  1120
!ImageEditor methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1121
228524287573 intitial checkin
tz
parents:
diff changeset
  1122
image
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1123
    "returns the current editing image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1124
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1125
    ^imageEditView image
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1126
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1127
228524287573 intitial checkin
tz
parents:
diff changeset
  1128
postOpenAction: anAction
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1129
   "sets an action which is evaluated after opening"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1130
228524287573 intitial checkin
tz
parents:
diff changeset
  1131
    postOpenAction := anAction
228524287573 intitial checkin
tz
parents:
diff changeset
  1132
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1133
228524287573 intitial checkin
tz
parents:
diff changeset
  1134
!ImageEditor methodsFor:'accessing - views'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1135
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1136
colorDataSetView
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1137
    "returns the view of the colormap"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1138
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1139
    ^(builder componentAt: #colorDataSetView)
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1140
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1141
    "Created: / 26.7.1998 / 12:02:14 / cg"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1142
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1143
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1144
coordLabel
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1145
    "returns the view the coord label"
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1146
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1147
    ^builder componentAt: #coordLabel
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1148
!
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1149
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1150
imageEditView
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1151
    "returns the view of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1152
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1153
    ^imageEditView := (builder componentAt: #imageEditView) subViews first 
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1154
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1155
228524287573 intitial checkin
tz
parents:
diff changeset
  1156
imagePreView
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1157
    "returns the preview of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1158
228524287573 intitial checkin
tz
parents:
diff changeset
  1159
    ^(builder componentAt: #imagePreView) subViews first 
475
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  1160
! !
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  1161
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1162
!ImageEditor methodsFor:'aspects'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1163
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1164
activityInfoHolder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1165
    ^ self valueOfInfoLabel
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1166
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1167
    "Modified: / 29.7.1998 / 18:49:03 / cg"
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1168
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1169
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1170
colorColumnAdaptor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1171
    ^ self
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1172
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1173
    "Created: / 26.7.1998 / 12:17:03 / cg"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1174
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1175
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1176
hasClassAndSelectorDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1177
    ^ [(Smalltalk at:(imageEditView resourceClass) ifAbsent:nil) notNil
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1178
       and:[imageEditView resourceSelector notNil]]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1179
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1180
    "Created: / 31.7.1998 / 02:02:54 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1181
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1182
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1183
hasClassDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1184
    ^ [(Smalltalk at:(imageEditView resourceClass) ifAbsent:nil) notNil]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1185
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1186
    "Created: / 31.7.1998 / 02:02:22 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1187
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1188
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1189
imageInfoHolder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1190
    |holder|
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1191
    (holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1192
        builder aspectAt:#imageInfoHolder put:(holder :=  '' asValue).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1193
    ].
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1194
    ^ holder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1195
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1196
    "Modified: / 29.7.1998 / 18:32:08 / cg"
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1197
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1198
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1199
imageIsLoaded
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1200
    "returns whether an image is loaded as value holder"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1201
228524287573 intitial checkin
tz
parents:
diff changeset
  1202
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1203
    (holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1204
        builder aspectAt:#imageIsLoaded put:(holder :=  false asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1205
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1206
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1207
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1208
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1209
imageIsLoadedAndClassDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1210
    "returns whether an image is loaded as value holder"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1211
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1212
    ^ [self hasClassAndSelectorDefined value
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1213
       and:[self imageIsLoaded value]]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1214
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1215
    "Created: / 31.7.1998 / 02:04:18 / cg"
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1216
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1217
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1218
listOfColors
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1219
    "returns the list of colors in a List"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1220
228524287573 intitial checkin
tz
parents:
diff changeset
  1221
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1222
    (holder := builder bindingAt:#listOfColors) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1223
        builder aspectAt:#listOfColors put:(holder :=  List new).
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1224
        holder addDependent:self.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1225
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1226
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1227
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1228
228524287573 intitial checkin
tz
parents:
diff changeset
  1229
selectionOfColor
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1230
    "returns current selection of the edit color as an AspectAdaptor"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1231
228524287573 intitial checkin
tz
parents:
diff changeset
  1232
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1233
    (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1234
        builder aspectAt:#selectionOfColor put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1235
        holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex).
228524287573 intitial checkin
tz
parents:
diff changeset
  1236
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1237
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1238
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1239
228524287573 intitial checkin
tz
parents:
diff changeset
  1240
valueOfMagnification
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1241
    "returns current magnification of the image as an AspectAdaptor"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1242
228524287573 intitial checkin
tz
parents:
diff changeset
  1243
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1244
    (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1245
        builder aspectAt:#valueOfMagnification put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1246
        holder := AspectAdaptor new subject:self; forAspect:#magnification)
228524287573 intitial checkin
tz
parents:
diff changeset
  1247
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1248
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1249
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1250
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1251
!ImageEditor methodsFor:'change & update'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1252
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1253
findColorMapMode
899
43b744c647ba comment grammar
tz
parents: 898
diff changeset
  1254
    "finds the colorMapMode for a new image"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1255
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1256
    self image depth > 8 ifTrue: [colorMapMode := ''. self listOfColors removeAll. ^nil].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1257
    colorMapMode := self image depth printString, '-plane'.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1258
    self listOfColors isEmpty
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 colorMapMode: colorMapMode value: nil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1262
    ].                               
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1263
    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
  1264
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1265
    self image mask notNil
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1266
    ifTrue:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1267
    [         
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1268
        colorMapMode := colorMapMode, ' + mask'.
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1269
        (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
  1270
        ifTrue:
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1271
        [
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1272
            self listOfColors addFirst: (Color basicNew setColorId:0).
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1273
            imageEditView selectColors: (Array with: (self listOfColors at: 2 ifAbsent: [self listOfColors at: 1]) with: (self listOfColors at: 1)).
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1274
        ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1275
    ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1276
    self selectionOfColor value: 0.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1277
    self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1278
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1279
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1280
update:something with:aParameter from:changedObject
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1281
    |clrIndex|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1282
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1283
    changedObject == self listOfColors ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1284
        something == #at: ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1285
            "/ colormap entry changed at aParameter
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1286
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1287
            clrIndex := aParameter.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1288
            (self hasMask) ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1289
                clrIndex := clrIndex - 1.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1290
            ].
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1291
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1292
            self image colorMap at:clrIndex put:(changedObject at:aParameter).
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1293
            self colorMapChanged.
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1294
            ^ self
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1295
        ].
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1296
    ].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1297
    super update:something with:aParameter from:changedObject
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1298
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1299
    "Modified: / 18.8.1998 / 17:18:42 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1300
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1301
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1302
updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1303
    "updates channels and view, if image is loaded"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1304
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1305
    self imageIsLoaded value: false.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1306
    self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1307
    self imagePreView image: nil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1308
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1309
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1310
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1311
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1312
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1313
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1314
updateLabelsAndHistory
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1315
    "updates labels and history, if something has changed"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1316
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1317
    self imageIsLoaded value: self image notNil.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1318
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1319
    self image isNil ifTrue: [^nil].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1320
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1321
    self updateInfoLabel.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1322
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1323
    imageEditView resourceMessage asCollectionOfWords size = 2
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1324
        ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1325
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1326
    self image fileName notNil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1327
        ifTrue: [self addToHistory: self image fileName -> #loadFromFile:].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1328
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1329
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1330
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1331
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1332
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1333
!ImageEditor methodsFor:'data access'!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1334
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1335
blueAtColor:aColor put:newBlue
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1336
    "helper used to return a new row element, when blue is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1337
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1338
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1339
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1340
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1341
    byte := newBlue clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1342
    byte = aColor blueByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1343
    ^ Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1344
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1345
    "Modified: / 18.8.1998 / 17:00:12 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1346
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1347
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1348
blueFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1349
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1350
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1351
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1352
    ^ aColor blueByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1353
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1354
    "Created: / 26.7.1998 / 12:30:35 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1355
    "Modified: / 31.7.1998 / 01:11:18 / cg"
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1356
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1357
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1358
canSelectBlueInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1359
    ^ aColor blueByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1360
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1361
    "Created: / 7.8.1998 / 22:50:34 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1362
    "Modified: / 7.8.1998 / 22:52:57 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1363
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1364
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1365
canSelectGreenInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1366
    ^ aColor greenByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1367
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1368
    "Created: / 7.8.1998 / 22:50:22 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1369
    "Modified: / 7.8.1998 / 22:52:46 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1370
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1371
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1372
canSelectRedInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1373
    ^ aColor redByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1374
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1375
    "Created: / 7.8.1998 / 22:50:00 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1376
    "Modified: / 7.8.1998 / 22:51:03 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1377
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1378
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1379
greenAtColor:aColor put:newGreen
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1380
    "helper used to return a new row element, when green is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1381
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1382
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1383
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1384
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1385
    byte := newGreen clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1386
    byte = aColor greenByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1387
    ^ Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1388
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1389
    "Modified: / 18.8.1998 / 17:00:38 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1390
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1391
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1392
greenFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1393
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1394
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1395
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1396
    ^ aColor greenByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1397
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1398
    "Created: / 26.7.1998 / 12:30:29 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1399
    "Modified: / 31.7.1998 / 01:11:31 / cg"
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1400
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1401
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1402
redAtColor:aColor put:newRed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1403
    "helper used to return a new row element, when red is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1404
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1405
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1406
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1407
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1408
    byte := newRed clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1409
    byte = aColor redByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1410
    ^ Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1411
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1412
    "Modified: / 18.8.1998 / 17:00:49 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1413
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1414
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1415
redFromColor:aColor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1416
    "helper used to access a color as a row in the dataSet view"
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1417
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1418
    aColor isNil ifTrue:[^ 'none'].
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1419
    ^ aColor redByte ? 'mask'
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1420
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1421
    "Modified: / 31.7.1998 / 01:11:35 / cg"
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1422
! !
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1423
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1424
!ImageEditor methodsFor:'help'!
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1425
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1426
defaultInfoLabel
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1427
    "returns the default info label"
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1428
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1429
    (imageEditView resourceClass isSymbol and: [(Smalltalk at: imageEditView resourceClass) isClass])
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1430
    ifTrue:
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1431
    [
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1432
        ^imageEditView resourceClass, ' >> ', imageEditView resourceSelector
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1433
    ].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1434
    ^'No class and selector defined.'
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1435
!
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1436
702
c9de7a9bc416 docu call changed
tz
parents: 694
diff changeset
  1437
openDocumentation
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1438
    "opens the documentation file of the Image Editor"
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1439
763
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  1440
    self openHTMLDocument: 'tools/uipainter/ImageEditor.html'
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  1441
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1442
! !
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1443
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1444
!ImageEditor methodsFor:'loading'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1445
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1446
loadFromFile: aFileName
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1447
    "loads an image from aFileName and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1448
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1449
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1450
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1451
    (imageEditView loadFromFile: aFileName) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1452
        (img := self image) notNil ifTrue:[          
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1453
            img colorMap notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1454
                self listOfColors contents:(img usedColors asSet asOrderedCollection).
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1455
            ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1456
                self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1457
            ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1458
            self findColorMapMode.     
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1459
            self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1460
        ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1461
            self updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1462
        ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1463
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1464
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1465
    "Modified: / 18.8.1998 / 17:03:54 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1466
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1467
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1468
loadFromImage:anImage
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1469
    "loads an image from anImage and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1470
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1471
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1472
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1473
    imageEditView image:anImage.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1474
    (img := self image) notNil ifTrue:[    
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1475
        img colorMap notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1476
            self listOfColors contents:(img usedColors asSet asOrderedCollection).
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1477
        ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1478
            self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1479
        ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1480
        self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1481
        self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1482
    ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1483
        self updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1484
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1485
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1486
    "Modified: / 18.8.1998 / 17:04:46 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1487
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1488
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1489
loadFromMessage: aMessage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1490
    "loads an image by evaluating aMessage and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1491
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1492
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1493
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1494
    (imageEditView loadFromMessage: aMessage) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1495
        (img := self image) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1496
            self listOfColors contents:(img usedColors asSet asOrderedCollection).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1497
            self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1498
            self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1499
        ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1500
            self updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1501
        ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1502
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1503
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1504
    "Modified: / 18.8.1998 / 17:03:01 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1505
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1506
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1507
loadFromOrPrepareForMessage: aMessage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1508
    "loads an image by evaluating aMessage;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1509
     if no image could extract from aMessage; do set the class and the selector from 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1510
     the aMessage for a saving at the end of editing"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1511
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1512
    (imageEditView loadFromMessage: aMessage) notNil
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1513
    ifTrue:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1514
    [
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1515
        self listOfColors contents: self image usedColors asSet asOrderedCollection.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1516
        self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1517
    ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1518
    ifFalse:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1519
    [
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1520
        imageEditView resourceMessage: aMessage.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1521
    ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1522
    self updateLabelsAndHistory.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1523
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1524
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1525
!ImageEditor methodsFor:'menu modes'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1526
228524287573 intitial checkin
tz
parents:
diff changeset
  1527
colorMapMode: aMode
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1528
    "returns whether colorMapMode is equal to aMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1529
228524287573 intitial checkin
tz
parents:
diff changeset
  1530
    ^colorMapMode = aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1531
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1532
228524287573 intitial checkin
tz
parents:
diff changeset
  1533
editMode: aMode
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1534
    "returns whether editMode is equal to aMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1535
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1536
    ^ imageEditView notNil and:[imageEditView editMode = aMode]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1537
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1538
228524287573 intitial checkin
tz
parents:
diff changeset
  1539
editMode: aMode value: aValue
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1540
    "sets the editMode to aMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1541
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1542
    imageEditView editMode: aMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1543
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1544
228524287573 intitial checkin
tz
parents:
diff changeset
  1545
mouseKeyColorMode: aMode
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1546
    "sets the mouseKeyColorMode to aMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1547
956
dc4df8952e82 check whether imageEditView is nil
ca
parents: 951
diff changeset
  1548
    imageEditView isNil ifTrue:[
dc4df8952e82 check whether imageEditView is nil
ca
parents: 951
diff changeset
  1549
        ^ true
dc4df8952e82 check whether imageEditView is nil
ca
parents: 951
diff changeset
  1550
    ].
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1551
    ^imageEditView mouseKeyColorMode = aMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1552
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1553
228524287573 intitial checkin
tz
parents:
diff changeset
  1554
mouseKeyColorMode: aMode value: aValue
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1555
    "sets the mouseKeyColorMode to aMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1556
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1557
    imageEditView mouseKeyColorMode: aMode.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1558
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1559
    self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1560
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1561
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1562
!ImageEditor methodsFor:'queries'!
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1563
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1564
hasMask
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1565
    ^ colorMapMode notNil and:[colorMapMode endsWith:'mask']
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1566
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1567
    "Created: / 18.8.1998 / 17:17:38 / cg"
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1568
!
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1569
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1570
preferredExtent
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1571
    "returns the preferred extent"
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1572
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1573
    ^super preferredExtent max: (Screen current width//3)@(Screen current height//3.5)
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1574
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1575
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1576
! !
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1577
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1578
!ImageEditor methodsFor:'selection'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1579
228524287573 intitial checkin
tz
parents:
diff changeset
  1580
magnification
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1581
    "returns the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1582
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1583
    self imageEditView isNil ifTrue: [^1].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1584
    ^imageEditView magnification x
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1585
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1586
228524287573 intitial checkin
tz
parents:
diff changeset
  1587
magnification: aValue
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1588
    "sets the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1589
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1590
    |magnification|        
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1591
    magnification := (aValue ? 1) asPoint.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1592
    (magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1593
    imageEditView magnification: magnification
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1594
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1595
228524287573 intitial checkin
tz
parents:
diff changeset
  1596
selectedColorIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1597
    "returns the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1598
228524287573 intitial checkin
tz
parents:
diff changeset
  1599
    ^selectedColorIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  1600
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1601
228524287573 intitial checkin
tz
parents:
diff changeset
  1602
selectedColorIndex: anIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1603
    "sets the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1604
228524287573 intitial checkin
tz
parents:
diff changeset
  1605
    selectedColorIndex := anIndex.    
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1606
    imageEditView selectedColor: (self listOfColors at: anIndex ifAbsent: [^nil])
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1607
228524287573 intitial checkin
tz
parents:
diff changeset
  1608
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1609
228524287573 intitial checkin
tz
parents:
diff changeset
  1610
!ImageEditor methodsFor:'startup / release'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1611
228524287573 intitial checkin
tz
parents:
diff changeset
  1612
closeRequest
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1613
    "close request"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1614
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1615
    imageEditView checkModified ifTrue:[super closeRequest]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1616
228524287573 intitial checkin
tz
parents:
diff changeset
  1617
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1618
228524287573 intitial checkin
tz
parents:
diff changeset
  1619
open
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1620
    "after opening, sets the masterApplication of the imageEditView to self"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1621
228524287573 intitial checkin
tz
parents:
diff changeset
  1622
    super open.
444
cd7959cb70dd some clean ups
tz
parents: 420
diff changeset
  1623
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1624
    imageEditView := (builder componentAt: #imageEditView) subViews first.
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1625
    imageEditView masterApplication: self
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1626
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1627
228524287573 intitial checkin
tz
parents:
diff changeset
  1628
postOpenWith:aBuilder
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1629
    "after opening, sets the masterApplication of the imageEditView to self;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1630
     evaluate the postOpenAction"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1631
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1632
    imageEditView masterApplication: self.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1633
    imageEditView imageInfoHolder:(self imageInfoHolder).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1634
    imageEditView activityInfoHolder:(self activityInfoHolder).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1635
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1636
    postOpenAction notNil ifTrue: [postOpenAction value].
228524287573 intitial checkin
tz
parents:
diff changeset
  1637
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1638
    super postOpenWith:aBuilder
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1639
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1640
    "Modified: / 29.7.1998 / 18:49:20 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1641
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1642
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1643
!ImageEditor methodsFor:'user actions - colormap'!
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1644
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1645
colorMapChanged
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1646
    |img|
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1647
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1648
    img := self image.
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1649
    img release.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1650
    imageEditView invalidate.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1651
    self imagePreView invalidate.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1652
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1653
"/    (imageEditView image:img) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1654
"/        self updateLabelsAndHistory.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1655
"/        self imagePreView image:img
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1656
"/    ]
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1657
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1658
    "Created: / 7.8.1998 / 22:26:10 / cg"
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1659
    "Modified: / 18.8.1998 / 17:08:55 / cg"
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1660
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1661
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1662
colorMapMode:aMode value: aValue
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1663
    "calculates a new color map for the image from aMode"
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1664
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1665
    |depth numColors newColorMap newImage 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1666
     oldImage image newColors realColorMap oldFileName
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1667
     usedColors useNearest usageCounts tmpBits tmpMap quest| 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1668
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1669
    self withExecuteCursorDo:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1670
        oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1671
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1672
        newColorMap := self class listOfColorMaps at:aMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1673
        depth       := (newColorMap size log: 2) asInteger. 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1674
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1675
        useNearest := false.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1676
        depth == 1 ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1677
            quest := 'Keep colormap (or use standard B&W)'
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1678
        ] ifFalse:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1679
            quest := 'Keep colormap (or use standard)'
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1680
        ].
958
14088f998b72 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1681
        ((colorMapMode == aMode)
14088f998b72 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1682
        or:[self confirm:(resources string:quest)]) ifTrue:[
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1683
            "/ keep the colormap
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1684
            depth > oldImage depth ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1685
                "/ easy - simply copy the part
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1686
                numColors := 1 bitShift:oldImage depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1687
                0 to:numColors-1 do:[:pixel |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1688
                    newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1689
                ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1690
            ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1691
                "/ see if all used color fit the new colormap
920
bde5b9369ef8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  1692
                usedColors := oldImage usedColors asArray.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1693
                usedColors size <= (1 bitShift:depth) ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1694
                    "/ yea - just install them
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1695
                    usedColors keysAndValuesDo:[:idx :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1696
                        newColorMap at:idx put:clr
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1697
                    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1698
                ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1699
                    "/ copy over those that are most often used.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1700
                    oldImage depth ~~ 8 ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1701
                        tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1702
                        oldImage bits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1703
                            expandPixels:(oldImage depth)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1704
                            width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1705
                            height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1706
                            into:tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1707
                            mapping:nil.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1708
                    ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1709
                        tmpBits := oldImage bits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1710
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1711
                    usageCounts := tmpBits usageCounts.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1712
                    tmpMap := Array new:usageCounts size.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1713
                    oldImage colorMap asArray keysAndValuesDo:[:i :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1714
                        tmpMap at:i put:clr
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1715
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1716
                    usageCounts sort:[:a :b | a > b] with:tmpMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1717
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1718
                    1 to:(1 bitShift:depth) do:[:idx |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1719
                        newColorMap at:idx put:(tmpMap at:idx)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1720
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1721
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1722
                    useNearest := Dialog 
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1723
                                        confirmWithCancel:(resources 
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1724
                                                              string:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?'
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1725
                                                              with:usedColors size
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1726
                                                              with:(1 bitShift:depth)) withCRs
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1727
                                        labels:(resources array:#('cancel' 'first' 'nearest')).
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1728
                    useNearest isNil ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1729
                        ^ self   "/ cancel
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1730
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1731
                ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1732
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1733
        ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1734
            "/ standard colormap
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1735
            usedColors := oldImage usedColors.
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1736
            (usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1737
                useNearest := Dialog 
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1738
                                    confirmWithCancel:(resources 
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1739
                                                           string:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?'
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1740
                                                       ) withCRs
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1741
                                    labels:(resources string:#('cancel' 'first' 'nearest')).
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1742
                useNearest isNil ifTrue:[
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1743
                    ^ self   "/ cancel
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1744
                ].
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1745
            ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1746
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1747
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1748
        imageEditView makeUndo.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1749
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1750
        newImage    := (Image implementorForDepth: depth) new.  
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1751
        oldFileName := oldImage fileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1752
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1753
        Object errorSignal handle:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1754
        [:ex|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1755
            Object errorSignal handle:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1756
            [:ex|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1757
                imageEditView undo.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1758
                ^self warn:(resources string:'Conversion failed !!')
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1759
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1760
            do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1761
            [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1762
                newImage := (Image implementorForDepth: depth) new.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1763
                newImage width:oldImage width height:oldImage height depth:depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1764
                newImage colorMap:newColorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1765
                newImage photometric:#palette.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1766
                newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1767
            
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1768
                oldImage colorsFromX:0 y:0 toX:(oldImage width-1) y:(oldImage height-1) do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1769
                [:x :y :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1770
                    |newColor|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1771
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1772
                    (newColorMap includes:clr)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1773
                        ifTrue: [newColor := clr]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1774
                        ifFalse: [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1775
                            useNearest ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1776
                                newColor := clr nearestIn:newColorMap
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1777
                            ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1778
                                newColor := oldImage colorMap first
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1779
                            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1780
                        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1781
                    newImage colorAtX:x y:y put:newColor.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1782
                ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1783
                image := newImage
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1784
            ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1785
        ] 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1786
        do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1787
        [ 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1788
            image := newImage fromImage: oldImage
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1789
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1790
937
8e4b1a548d89 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  1791
        (aMode asString endsWith:'mask')
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1792
        ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1793
        [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1794
            image mask isNil
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1795
            ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1796
            [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1797
                image mask: (Depth1Image fromImage: (image asThresholdMonochromeImage: 0.1)). 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1798
            ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1799
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1800
        ifFalse:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1801
        [ 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1802
            image mask: nil.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1803
        ]. 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1804
        realColorMap := OrderedCollection new.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1805
        image realColorMap do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1806
        [:clr|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1807
            (realColorMap includes: clr) ifFalse: [realColorMap add: clr]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1808
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1809
        newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1810
        newColorMap do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1811
        [:clr|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1812
            ((newColors size < newColorMap size) and: [(newColors includes: clr) not]) 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1813
            ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1814
            [      
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1815
                newColors add: clr
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1816
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1817
        ].                  
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1818
        image colorMap: newColors.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1819
        colorMapMode := aMode.            
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1820
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1821
        (imageEditView image: image) notNil ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1822
        [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1823
            image fileName: oldFileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1824
            self listOfColors contents: image colorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1825
            self findColorMapMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1826
            self updateLabelsAndHistory.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1827
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1828
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1829
958
14088f998b72 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1830
    "Modified: / 17.8.1998 / 10:22:15 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1831
!
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1832
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1833
compressColorMap
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1834
    "calculates a new color map for the image, using only used colors"
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1835
927
74a71f2c5ef8 obsolete locals removed
tz
parents: 926
diff changeset
  1836
    |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1837
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1838
    oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1839
    depth := oldImage depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1840
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1841
    oldImage photometric ~~ #palette ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1842
        self information:'Compress colorMap: Only palette images have colormaps.'.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1843
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1844
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1845
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1846
    usedColors := oldImage usedColors.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1847
    usedColors size == (1 bitShift:depth) ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1848
        self information:'Compress colorMap: All colors are used - no compression.'.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1849
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1850
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1851
    usedColors size == oldImage colorMap size ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1852
        self information:'Compress colorMap: Colormap already compressed - no compression.'.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1853
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1854
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1855
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1856
    imageEditView makeUndo.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1857
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1858
    self information:('Compress colorMap: %1 colors used.' bindWith:usedColors size).
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1859
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1860
    self withExecuteCursorDo:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1861
        newColorMap := Array new:usedColors size.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1862
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1863
        "/ translation table
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1864
        oldToNew := ByteArray new:(1 bitShift:depth).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1865
        newColorMap := usedColors asArray.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1866
        oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1867
            |newPixel|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1868
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1869
            (usedColors includes:clr) ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1870
                newPixel := newColorMap indexOf:clr.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1871
                oldToNew at:oldIdx put:newPixel-1.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1872
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1873
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1874
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1875
        oldBits := oldImage bits.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1876
        newBits := ByteArray new:(oldBits size).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1877
        depth ~~ 8 ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1878
            "/ expand/compress can only handle 8bits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1879
            tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1880
            oldBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1881
                expandPixels:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1882
                width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1883
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1884
                into:tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1885
                mapping:oldToNew.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1886
            tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1887
                compressPixels:depth 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1888
                width:oldImage width 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1889
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1890
                into:newBits 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1891
                mapping:nil
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1892
        ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1893
            oldBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1894
                expandPixels:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1895
                width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1896
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1897
                into:newBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1898
                mapping:oldToNew.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1899
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1900
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1901
        newImage := oldImage species new
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1902
                        width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1903
                        height:oldImage height
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1904
                        depth:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1905
                        fromArray:newBits.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1906
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1907
        newImage colorMap:newColorMap.  
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1908
        newImage fileName:oldImage fileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1909
        newImage mask:(oldImage mask copy).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1910
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1911
        (imageEditView image:newImage) notNil ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1912
        [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1913
            self listOfColors contents: newImage colorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1914
            self findColorMapMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1915
            self updateLabelsAndHistory.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1916
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1917
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1918
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1919
    "Created: / 28.7.1998 / 20:03:11 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1920
    "Modified: / 31.7.1998 / 01:13:57 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1921
! !
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1922
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1923
!ImageEditor methodsFor:'user actions - editing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1924
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1925
doBrowseClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1926
    "opens a System Browser on the resourceClass and the resourceSelector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1927
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1928
    |cls|
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1929
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1930
    cls := Smalltalk at:(imageEditView resourceClass) ifAbsent:nil.
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1931
    cls isNil ifTrue:[^ self warn:'No Class specified'].
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1932
    SystemBrowser 
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1933
        openInClass:cls class 
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1934
        selector:(imageEditView resourceSelector)
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1935
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1936
    "Modified: / 31.7.1998 / 02:01:15 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1937
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1938
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1939
doChangeGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1940
    "change grid magnification"
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1941
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1942
    imageEditView changeGridMagnification
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1943
!
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1944
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1945
doFlipHorizontal
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1946
    "flips horizontally current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1947
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1948
    imageEditView flipHorizontal
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1949
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1950
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1951
doFlipVertical
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1952
    "flips vertically current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1953
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1954
    imageEditView flipVertical
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1955
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1956
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1957
doMagnifyDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1958
    "magnifies current image one step down"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1959
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1960
    |magHolder mag|
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1961
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1962
    magHolder := self valueOfMagnification.
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1963
    (mag := magHolder value) > 1 ifTrue: [
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1964
        magHolder value: mag - 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1965
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1966
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1967
    "Modified: / 26.7.1998 / 20:24:08 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1968
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1969
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1970
doMagnifyImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1971
    "magnifies current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1972
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1973
    imageEditView magnifyImage.   
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1974
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1975
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1976
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1977
doMagnifyUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1978
    "magnifies current image one step up"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1979
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1980
    |magHolder mag|
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1981
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1982
    magHolder := self valueOfMagnification.
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1983
    (mag := magHolder value) < 99 ifTrue: [
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1984
        magHolder value: mag + 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1985
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1986
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1987
    "Modified: / 26.7.1998 / 20:23:52 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1988
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1989
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1990
doNegativeImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1991
    "negates current image by negating the color map"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1992
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1993
    imageEditView negativeImage.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1994
    self listOfColors removeAll.
901
ce482227787d several undos
tz
parents: 900
diff changeset
  1995
    self findColorMapMode.     
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1996
    imageEditView undoImages removeLast
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1997
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1998
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1999
doResizeImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2000
    "resizes current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2001
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2002
    imageEditView resizeImage.   
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2003
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  2004
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2005
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2006
doRotateImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2007
    "rotates current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2008
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2009
    imageEditView rotateImage.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2010
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  2011
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2012
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2013
doUndo
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2014
    "reverses last edit action"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2015
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2016
    imageEditView undo
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2017
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2018
228524287573 intitial checkin
tz
parents:
diff changeset
  2019
!ImageEditor methodsFor:'user actions - loading'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2020
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2021
doLoadFromClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2022
    "opens a dialog for loading an image from class and a (resource-) selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2023
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2024
    (imageEditView loadFromClass) notNil
574
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2025
    ifTrue:
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2026
    [
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2027
        self image notNil
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2028
        ifTrue:
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2029
        [
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2030
            self listOfColors contents: self image usedColors asSet asOrderedCollection.
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2031
            self findColorMapMode.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2032
            self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2033
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2034
        ifFalse:
228524287573 intitial checkin
tz
parents:
diff changeset
  2035
        [
461
aed297a2d395 load errors removed
tz
parents: 460
diff changeset
  2036
            self updateForNoneImage
aed297a2d395 load errors removed
tz
parents: 460
diff changeset
  2037
        ]
449
dac8dc1f9dc8 if none image found for loading clear all
tz
parents: 444
diff changeset
  2038
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2039
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2040
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2041
doLoadFromFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2042
    "opens a dialog for loading an image from a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2043
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2044
    self loadFromFile:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2045
        (FileSelectionBrowser
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2046
            request: 'Load Image From'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2047
            fileName: (self image notNil ifTrue: [self image fileName] ifFalse: [nil])
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2048
            withFileFilters: FileSelectionBrowser loadImageFileNameFilters)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2049
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2050
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2051
doNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2052
    "opens a dialog with choices of size and color map for creating a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2053
228524287573 intitial checkin
tz
parents:
diff changeset
  2054
    |aspects|
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2055
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2056
    aspects  := IdentityDictionary new
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2057
        at:#listOfSizes         put: self class listOfDefaultSizes asValue;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2058
        at:#listOfColorMaps     put: self class listOfColorMaps keys asSortedCollection asValue;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2059
        at:#selectionOfSize     put: self class listOfDefaultSizes first copy asValue;
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2060
        at:#selectionOfColorMap put: self class listOfColorMaps keys asSortedCollection first asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  2061
        yourself.
228524287573 intitial checkin
tz
parents:
diff changeset
  2062
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2063
    (self openDialogInterface:#dialogSpecForNewImage withBindings:aspects)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2064
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2065
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  2066
        |width height cMap imageClass image|
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2067
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2068
        width  := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value upTo: $x) onError:[24]).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2069
        height := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value copy reverse upTo: $x) reverse onError:[24]).
228524287573 intitial checkin
tz
parents:
diff changeset
  2070
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2071
        cMap       := (self class listOfColorMaps at: (colorMapMode := (aspects at:#selectionOfColorMap) value)).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2072
        imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2073
        image      := imageClass width: width height: height fromArray: (ByteArray new: width*height).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2074
228524287573 intitial checkin
tz
parents:
diff changeset
  2075
        (colorMapMode copy reverse readStream nextWord reverse = 'mask')
228524287573 intitial checkin
tz
parents:
diff changeset
  2076
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2077
        [
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2078
            image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2079
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  2080
        image colorMap: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  2081
        image fillRectangleX:0 y:0 width:width height:height with:Color white.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2082
        (imageEditView image: image) notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2083
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2084
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  2085
            self listOfColors contents: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  2086
            self findColorMapMode.
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2087
            self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2088
        ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2089
    ]
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2090
!
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2091
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2092
grabScreenImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2093
    "let user choose an area and grab that are for editing"
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2094
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2095
    |image img|
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2096
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2097
    image := Image fromUser.
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2098
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2099
    image depth > 8 ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2100
        Object errorSignal handle:[:ex |
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2101
            self warn:'Could not convert to depth8 image (too many colors)'.
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2102
            ^ self
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2103
        ] do:[
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2104
            image := Depth8Image fromImage:image.
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2105
        ]
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2106
    ].
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2107
    (imageEditView image: image) notNil
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2108
    ifTrue:
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2109
    [
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2110
        self listOfColors contents:(image colorMap).
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2111
        self findColorMapMode.
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2112
        self updateLabelsAndHistory.
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2113
    ]
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2114
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2115
    "Created: / 29.7.1998 / 21:24:42 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2116
    "Modified: / 31.7.1998 / 01:14:33 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2117
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2118
228524287573 intitial checkin
tz
parents:
diff changeset
  2119
!ImageEditor methodsFor:'user actions - saving'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2120
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2121
doPrint
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2122
    "prints current image on the current printer"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2123
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2124
    imageEditView print
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2125
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2126
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2127
doSaveImageFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2128
    "saves current image to current file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2129
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2130
    imageEditView save
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2131
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2132
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2133
doSaveImageFileAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2134
    "opens a dialog for saving current image to a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2135
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2136
    imageEditView saveImageFileAs.
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2137
    self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2138
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2139
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2140
doSaveImageMaskFileAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2141
    "opens a dialog for saving mask of current image to a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2142
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2143
    imageEditView saveImageMaskFileAs
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2144
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2145
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2146
doSaveMethod
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2147
    "saves current image on current class and selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2148
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2149
    imageEditView saveMethod notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2150
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2151
    [
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2152
        self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2153
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2154
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2155
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2156
doSaveMethodAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2157
    "opens a dialog for saving current image on a class and a selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2158
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2159
    imageEditView saveMethodAs notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2160
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2161
    [
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2162
        self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2163
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2164
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2165
228524287573 intitial checkin
tz
parents:
diff changeset
  2166
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2167
228524287573 intitial checkin
tz
parents:
diff changeset
  2168
version
228524287573 intitial checkin
tz
parents:
diff changeset
  2169
    ^ '$Header$'
228524287573 intitial checkin
tz
parents:
diff changeset
  2170
! !