ImageEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 24 Nov 1998 17:56:30 +0100
changeset 1018 d578841e9e96
parent 1008 327f93d57c7b
child 1033 21b3bc025e0c
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
400
228524287573 intitial checkin
tz
parents:
diff changeset
     1
"
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
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
    14
	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
    15
		selectedColorIndex postOpenAction'
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    16
	classVariableNames:''
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    17
	poolDictionaries:''
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
    18
	category:'Interface-UIPainter'
400
228524287573 intitial checkin
tz
parents:
diff changeset
    19
!
228524287573 intitial checkin
tz
parents:
diff changeset
    20
228524287573 intitial checkin
tz
parents:
diff changeset
    21
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    22
228524287573 intitial checkin
tz
parents:
diff changeset
    23
copyright
228524287573 intitial checkin
tz
parents:
diff changeset
    24
"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    25
 COPYRIGHT (c) 1997-1998 by eXept Software AG
400
228524287573 intitial checkin
tz
parents:
diff changeset
    26
              All Rights Reserved
228524287573 intitial checkin
tz
parents:
diff changeset
    27
228524287573 intitial checkin
tz
parents:
diff changeset
    28
 This software is furnished under a license and may be used
228524287573 intitial checkin
tz
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    30
 inclusion of the above copyright notice. This software may not
400
228524287573 intitial checkin
tz
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    32
 other person. No title to or ownership of the software is
400
228524287573 intitial checkin
tz
parents:
diff changeset
    33
 hereby transferred.
228524287573 intitial checkin
tz
parents:
diff changeset
    34
"
228524287573 intitial checkin
tz
parents:
diff changeset
    35
!
228524287573 intitial checkin
tz
parents:
diff changeset
    36
228524287573 intitial checkin
tz
parents:
diff changeset
    37
documentation
228524287573 intitial checkin
tz
parents:
diff changeset
    38
"
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
    39
    Image Editor allows you to create, design, modify or just inspect images.
400
228524287573 intitial checkin
tz
parents:
diff changeset
    40
228524287573 intitial checkin
tz
parents:
diff changeset
    41
    [start with:]
228524287573 intitial checkin
tz
parents:
diff changeset
    42
        ImageEditor open
941
6d75430a8120 fixed start call in docu
tz
parents: 937
diff changeset
    43
        ImageEditor openOnClass:Icon andSelector:#startIcon
400
228524287573 intitial checkin
tz
parents:
diff changeset
    44
228524287573 intitial checkin
tz
parents:
diff changeset
    45
    [see also:]
228524287573 intitial checkin
tz
parents:
diff changeset
    46
        ImageEditView Image
228524287573 intitial checkin
tz
parents:
diff changeset
    47
228524287573 intitial checkin
tz
parents:
diff changeset
    48
    [author:]
544
8fa6ee20c3cd help menu item aligned to the right
tz
parents: 535
diff changeset
    49
        Thomas Zwick, eXept Software AG
400
228524287573 intitial checkin
tz
parents:
diff changeset
    50
"
228524287573 intitial checkin
tz
parents:
diff changeset
    51
! !
228524287573 intitial checkin
tz
parents:
diff changeset
    52
228524287573 intitial checkin
tz
parents:
diff changeset
    53
!ImageEditor class methodsFor:'instance creation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    54
228524287573 intitial checkin
tz
parents:
diff changeset
    55
openModalOnClass: aClass andSelector: aSelector
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    56
    "opens modal a Image Editor on aClass and aSelector"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    57
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    58
     self openModalOnClass: self andSelector: #leftMouseKeyIcon
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    59
    "
400
228524287573 intitial checkin
tz
parents:
diff changeset
    60
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    61
    |imageEditor imageEditView className resourceClassName resourceSelector| 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    62
400
228524287573 intitial checkin
tz
parents:
diff changeset
    63
    imageEditor := self new.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    64
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    65
    aClass isClass  ifTrue: [className := aClass name].
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    66
    aClass isString ifTrue: [className := aClass].      
903
63203d996e61 openModal bug fixed
tz
parents: 901
diff changeset
    67
    aClass isNil    ifTrue: [className := ''].      
400
228524287573 intitial checkin
tz
parents:
diff changeset
    68
688
788fe83ab3c0 time clock removed
tz
parents: 679
diff changeset
    69
    imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. imageEditor loadFromOrPrepareForMessage: className, ' ', aSelector].
400
228524287573 intitial checkin
tz
parents:
diff changeset
    70
    imageEditor openModal.
228524287573 intitial checkin
tz
parents:
diff changeset
    71
688
788fe83ab3c0 time clock removed
tz
parents: 679
diff changeset
    72
    resourceClassName := imageEditView resourceClass.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    73
    resourceSelector  := imageEditView resourceSelector.
415
f792d83774b3 with modal support
tz
parents: 405
diff changeset
    74
815
b2b9356a648c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
    75
    ((className asString ~= resourceClassName) 
b2b9356a648c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
    76
    or:[aSelector asString ~= resourceSelector])
415
f792d83774b3 with modal support
tz
parents: 405
diff changeset
    77
        ifTrue: [^resourceClassName, ' ', resourceSelector]
f792d83774b3 with modal support
tz
parents: 405
diff changeset
    78
        ifFalse:[^nil]
400
228524287573 intitial checkin
tz
parents:
diff changeset
    79
!
228524287573 intitial checkin
tz
parents:
diff changeset
    80
228524287573 intitial checkin
tz
parents:
diff changeset
    81
openOnClass: aClass andSelector: aSelector
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    82
    "opens a Image Editor on aClass and aSelector"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    83
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    84
     self openOnClass: self andSelector: #leftMouseKeyIcon
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    85
    "
400
228524287573 intitial checkin
tz
parents:
diff changeset
    86
228524287573 intitial checkin
tz
parents:
diff changeset
    87
    ^self open loadFromMessage: aClass name, ' ', aSelector
228524287573 intitial checkin
tz
parents:
diff changeset
    88
!
228524287573 intitial checkin
tz
parents:
diff changeset
    89
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    90
openOnFile: aFileName
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
    91
    "opens a Image Editor on aFileName"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    92
    "
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    93
     self openOnFile: 'bitmaps/SmalltalkX.xbm'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    94
    "
400
228524287573 intitial checkin
tz
parents:
diff changeset
    95
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    96
    ^self open loadFromFile: aFileName
400
228524287573 intitial checkin
tz
parents:
diff changeset
    97
!
228524287573 intitial checkin
tz
parents:
diff changeset
    98
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
    99
openOnImage: anImage
900
5dd8303a9bb5 opens an Image Editor in any case
tz
parents: 899
diff changeset
   100
    "opens a Image Editor on anImage"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   101
    "
895
69269bc88320 checkin from browser
tz
parents: 880
diff changeset
   102
     self openOnImage: Icon startIcon
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   103
    "
400
228524287573 intitial checkin
tz
parents:
diff changeset
   104
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   105
    ^self open loadFromImage: anImage
400
228524287573 intitial checkin
tz
parents:
diff changeset
   106
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   107
228524287573 intitial checkin
tz
parents:
diff changeset
   108
!ImageEditor class methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
   109
228524287573 intitial checkin
tz
parents:
diff changeset
   110
listOfColorMaps
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   111
    "returns the list of default color maps for a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   112
228524287573 intitial checkin
tz
parents:
diff changeset
   113
    |colorMap|
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   114
400
228524287573 intitial checkin
tz
parents:
diff changeset
   115
    (colorMap := OrderedCollection new)
228524287573 intitial checkin
tz
parents:
diff changeset
   116
        add: Color black;
228524287573 intitial checkin
tz
parents:
diff changeset
   117
        add: Color white;
228524287573 intitial checkin
tz
parents:
diff changeset
   118
        add: Color red;
228524287573 intitial checkin
tz
parents:
diff changeset
   119
        add: Color green;
228524287573 intitial checkin
tz
parents:
diff changeset
   120
        add: Color blue;
228524287573 intitial checkin
tz
parents:
diff changeset
   121
        add: Color cyan;
228524287573 intitial checkin
tz
parents:
diff changeset
   122
        add: Color yellow;
228524287573 intitial checkin
tz
parents:
diff changeset
   123
        add: Color magenta;
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   124
        add: (Color redByte: 127 greenByte:   0 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   125
        add: (Color redByte:   0 greenByte: 127 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   126
        add: (Color redByte:   0 greenByte:   0 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   127
        add: (Color redByte:   0 greenByte: 127 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   128
        add: (Color redByte: 127 greenByte: 127 blueByte:   0);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   129
        add: (Color redByte: 127 greenByte:   0 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   130
        add: (Color redByte: 127 greenByte: 127 blueByte: 127);
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   131
        add: (Color redByte: 170 greenByte: 170 blueByte: 170).
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   132
400
228524287573 intitial checkin
tz
parents:
diff changeset
   133
    0 to: 5 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   134
    [:r|                                                    
228524287573 intitial checkin
tz
parents:
diff changeset
   135
        0 to: 5 do:         
228524287573 intitial checkin
tz
parents:
diff changeset
   136
        [:g|
228524287573 intitial checkin
tz
parents:
diff changeset
   137
            0 to: 5 do:                             
228524287573 intitial checkin
tz
parents:
diff changeset
   138
            [:b|
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   139
                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
   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
228524287573 intitial checkin
tz
parents:
diff changeset
   144
    1 to: 25 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   145
    [:g|                             
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
   146
        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
   147
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
   148
228524287573 intitial checkin
tz
parents:
diff changeset
   149
    ^Dictionary new
228524287573 intitial checkin
tz
parents:
diff changeset
   150
        at: '8-plane' put: colorMap;
228524287573 intitial checkin
tz
parents:
diff changeset
   151
        at: '8-plane + mask' put: colorMap;
228524287573 intitial checkin
tz
parents:
diff changeset
   152
        at: '4-plane' put: (colorMap copyFrom: 1 to: 16);
228524287573 intitial checkin
tz
parents:
diff changeset
   153
        at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16);
228524287573 intitial checkin
tz
parents:
diff changeset
   154
        at: '2-plane' put: (colorMap copyFrom: 1 to: 4);
228524287573 intitial checkin
tz
parents:
diff changeset
   155
        at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4);
228524287573 intitial checkin
tz
parents:
diff changeset
   156
        at: '1-plane' put: (colorMap copyFrom: 1 to: 2);
228524287573 intitial checkin
tz
parents:
diff changeset
   157
        at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2);
228524287573 intitial checkin
tz
parents:
diff changeset
   158
        yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   159
!
228524287573 intitial checkin
tz
parents:
diff changeset
   160
228524287573 intitial checkin
tz
parents:
diff changeset
   161
listOfDefaultSizes
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   162
    "returns the list of default sizes for a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   163
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   164
    ^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64')
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   165
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   166
    "Modified: / 31.7.1998 / 01:57:34 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
   167
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   168
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   169
!ImageEditor class methodsFor:'help specs'!
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   170
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   171
helpSpec
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   172
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   173
     by the UIHelpTool of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   174
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   175
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   176
     the UIHelpTool may not be able to read the specification."
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   177
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   178
    "
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   179
     UIHelpTool openOnClass:ImageEditor    
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   180
    "
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   181
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   182
    <resource: #help>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   183
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   184
    ^super helpSpec addPairsFrom:#(
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   185
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   186
#colorMap
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   187
'ColorMap functions.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   188
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   189
#colorMap1
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   190
'Convert to depth-1 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   191
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   192
#colorMap1M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   193
'Convert to depth-1 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   194
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   195
#colorMap2
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   196
'Convert to depth-2 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   197
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   198
#colorMap2M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   199
'Convert to depth-2 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   200
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   201
#colorMap4
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   202
'Convert to depth-4 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   203
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   204
#colorMap4M
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   205
'Convert to depth-4 image plus mask.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   206
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   207
#colorMap8
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   208
'Convert to depth-8 image.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   209
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   210
#colorMap8M
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   211
'Convert to depth-8 image plus mask.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   212
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   213
#colorMapTable
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   214
'Shows a list of used colors of the image.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   215
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   216
#compressColormap
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   217
'Remove unneeded entries from the colorMap.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   218
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   219
#crobAll
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   220
'Find and remove all borders.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   221
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   222
#crobBottom
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   223
'Find and remove bottom border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   224
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   225
#crobLeft
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   226
'Find and remove left border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   227
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   228
#crobManual
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   229
'Specify border(s) to remove.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   230
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   231
#crobRight
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   232
'Find and remove right border.'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   233
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   234
#crobTop
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   235
'Find and remove top border.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   236
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   237
#drawModeBox
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   238
'Switches to box-drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   239
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   240
#drawModeCopy
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   241
'Switches to area-copy mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   242
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   243
#drawModeFill
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   244
'Switches to flood-fill mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   245
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   246
#drawModeFilledBox
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   247
'Switches to filled-box drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   248
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   249
#drawModePaste
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   250
'Switches to paste mode.'
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   251
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   252
#drawModePasteUnder
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   253
'Switches to paste under mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   254
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   255
#drawModePoint
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   256
'Switches to point-drawing mode.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   257
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   258
#editFlipHorizontal
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   259
'Flips the image horizontally.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   260
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   261
#editFlipVertical
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   262
'Flips the image vertically.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   263
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   264
#editMagnifyImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   265
'Magnify the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   266
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   267
#editNegate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   268
'Invert the images colors.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   269
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   270
#editResize
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   271
'Resize the image (preserving the old image).'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   272
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   273
#editRotate
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   274
'Rotate the image.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   275
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   276
#fileGrabImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   277
'Pick an image from the screen.'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   278
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   279
#fileLoadFromClass
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   280
'Select and load an image from a resource method.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   281
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   282
#fileLoadFromFile
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   283
'Select and load an image from a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   284
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   285
#fileNewImage
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   286
'Create a new image'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   287
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   288
#filePrint
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   289
'Print the image on a postscript printer.'
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   290
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   291
#fileSaveAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   292
'Save the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   293
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   294
#fileSaveMaskAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   295
'Save the mask of the image to a file.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   296
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   297
#fileSaveMethod
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   298
'Save the image as resource method in the current class and selector.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   299
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   300
#fileSaveMethodAs
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   301
'Save the image as resource method in a class.'
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   302
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   303
#magnificationNumber
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   304
'Shows the current magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   305
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   306
#magnifyImageDown
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   307
'Decrease magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   308
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   309
#magnifyImageUp
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   310
'Increase magnification.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   311
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   312
#mouseKeyColorMode
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   313
'Toggles between left and right mouse button color.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   314
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   315
#previewView
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   316
'Shows a preview of the image.'
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
   317
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   318
#settingsGridMagnification
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   319
'Change the grid magnification of the edit view.'
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   320
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   321
)
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
   322
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   323
    "Modified: / 7.9.1998 / 18:20:26 / cg"
460
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   324
! !
9d141cb07d5e help texts added
tz
parents: 450
diff changeset
   325
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   326
!ImageEditor class methodsFor:'image specs'!
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   327
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   328
leftMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   329
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   330
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   331
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   332
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   333
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   334
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   335
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   336
     ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   337
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   338
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   339
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   340
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   341
    ^Icon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   342
        constantNamed:#'ImageEditor leftMouseKeyIcon'
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   343
        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
   344
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   345
rightMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   346
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   347
     by the ImageEditor of ST/X."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   348
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   349
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   350
     the ImageEditor may not be able to read the specification."
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   351
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   352
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   353
     ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   354
    "
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   355
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   356
    <resource: #image>
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   357
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   358
    ^Icon
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   359
        constantNamed:#'ImageEditor rightMouseKeyIcon'
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   360
        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
   361
400
228524287573 intitial checkin
tz
parents:
diff changeset
   362
!ImageEditor class methodsFor:'interface specs'!
228524287573 intitial checkin
tz
parents:
diff changeset
   363
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   364
dialogSpecForNewImage
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   365
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   366
     by the UIPainter of ST/X."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   367
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   368
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   369
     the UIPainter may not be able to read the specification."
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   370
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   371
    "
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   372
     UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   373
     ImageEditor new openInterface:#dialogSpecForNewImage
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   374
    "
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   375
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   376
    <resource: #canvas>
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   377
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   378
    ^
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   379
     
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   380
       #(#FullSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   381
          #window: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   382
           #(#WindowSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   383
              #name: 'New Image'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
   384
              #layout: #(#LayoutFrame 81 0 288 0 381 0 406 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   385
              #label: 'New Image'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   386
              #min: #(#Point 10 10)
738210a2fa06 revised version
tz
parents: 651
diff changeset
   387
              #max: #(#Point 1152 900)
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
   388
              #bounds: #(#Rectangle 81 288 382 407)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   389
              #usePreferredExtent: false
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   390
          )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   391
          #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   392
           #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   393
              #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   394
               #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   395
                 #(#ViewSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   396
                    #name: 'View'
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   397
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   398
                    #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   399
                     #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   400
                        #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   401
                         #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   402
                           #(#FramedBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   403
                              #name: 'framedBox1'
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   404
                              #layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   405
                              #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   406
                               #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   407
                                  #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   408
                                   #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   409
                                     #(#ComboBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   410
                                        #name: 'defaultSizesComboBox'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
   411
                                        #layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   412
                                        #model: #selectionOfSize
738210a2fa06 revised version
tz
parents: 651
diff changeset
   413
                                        #type: #string
738210a2fa06 revised version
tz
parents: 651
diff changeset
   414
                                        #comboList: #listOfDefaultSizes
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   415
                                    )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   416
                                  )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   417
                              )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   418
                              #label: 'Size'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   419
                              #labelPosition: #topLeft
738210a2fa06 revised version
tz
parents: 651
diff changeset
   420
                              #style: #(#FontDescription #helvetica #medium #roman 12)
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   421
                          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   422
                           #(#FramedBoxSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   423
                              #name: 'framedBox2'
932
7111238cda23 fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   424
                              #layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   425
                              #component: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   426
                               #(#SpecCollection
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   427
                                  #collection: 
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   428
                                   #(
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   429
                                     #(#ComboListSpec
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   430
                                        #name: 'colorMapComboBox'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
   431
                                        #layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   432
                                        #model: #selectionOfColorMap
738210a2fa06 revised version
tz
parents: 651
diff changeset
   433
                                        #comboList: #listOfColorMaps
738210a2fa06 revised version
tz
parents: 651
diff changeset
   434
                                        #useIndex: false
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
                              )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   438
                              #label: 'Color Map'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   439
                              #labelPosition: #topLeft
738210a2fa06 revised version
tz
parents: 651
diff changeset
   440
                              #style: #(#FontDescription #helvetica #medium #roman 12)
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   441
                          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   442
                        )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   443
                    )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   444
                    #level: 1
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   445
                )
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   446
                 #(#UISubSpecification
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
   447
                    #name: 'windowSpecForCommitWithoutChannels'
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   448
                    #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   449
                    #minorKey: #windowSpecForCommitWithoutChannels
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   450
                )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   451
              )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   452
          )
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   453
      )
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   454
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   455
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   456
grobDialogSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   457
    "This resource specification was automatically generated
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   458
     by the UIPainter of ST/X."
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   459
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   460
    "Do not manually edit this!! If it is corrupted,
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   461
     the UIPainter may not be able to read the specification."
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   462
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   463
    "
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   464
     UIPainter new openOnClass:ImageEditor andSelector:#grobDialogSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   465
     ImageEditor new openInterface:#grobDialogSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   466
    "
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   467
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   468
    <resource: #canvas>
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   469
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   470
    ^
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   471
     
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   472
       #(#FullSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   473
          #window: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   474
           #(#WindowSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   475
              #name: 'Crob Borders'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   476
              #layout: #(#LayoutFrame 22 0 233 0 266 0 415 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   477
              #label: 'Crob Borders'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   478
              #min: #(#Point 10 10)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   479
              #max: #(#Point 800 478)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   480
              #bounds: #(#Rectangle 22 233 267 416)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   481
              #usePreferredExtent: false
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   482
          )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   483
          #component: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   484
           #(#SpecCollection
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   485
              #collection: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   486
               #(
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   487
                 #(#LabelSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   488
                    #name: 'Label1'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   489
                    #layout: #(#LayoutFrame 14 0 21 0 90 0 43 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   490
                    #label: 'Left:'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   491
                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   492
                    #adjust: #right
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   493
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   494
                 #(#InputFieldSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   495
                    #name: 'EntryField1'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   496
                    #layout: #(#LayoutFrame 95 0 21 0 132 0 43 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   497
                    #model: #left
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   498
                    #type: #number
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   499
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   500
                 #(#LabelSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   501
                    #name: 'Label2'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   502
                    #layout: #(#LayoutFrame 14 0 51 0 90 0 73 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   503
                    #label: 'Right:'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   504
                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   505
                    #adjust: #right
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   506
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   507
                 #(#InputFieldSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   508
                    #name: 'EntryField2'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   509
                    #layout: #(#LayoutFrame 95 0 51 0 132 0 73 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   510
                    #model: #right
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   511
                    #type: #number
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   512
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   513
                 #(#LabelSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   514
                    #name: 'Label3'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   515
                    #layout: #(#LayoutFrame 14 0 81 0 90 0 103 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   516
                    #label: 'Top:'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   517
                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   518
                    #adjust: #right
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   519
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   520
                 #(#InputFieldSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   521
                    #name: 'EntryField3'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   522
                    #layout: #(#LayoutFrame 95 0 81 0 132 0 103 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   523
                    #model: #top
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   524
                    #type: #number
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   525
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   526
                 #(#LabelSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   527
                    #name: 'Label4'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   528
                    #layout: #(#LayoutFrame 14 0 111 0 90 0 133 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   529
                    #label: 'Bottom:'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   530
                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   531
                    #adjust: #right
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   532
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   533
                 #(#InputFieldSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   534
                    #name: 'EntryField4'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   535
                    #layout: #(#LayoutFrame 95 0 111 0 132 0 133 0)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   536
                    #model: #bottom
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   537
                    #type: #number
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   538
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   539
                 #(#HorizontalPanelViewSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   540
                    #name: 'HorizontalPanel1'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   541
                    #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   542
                    #component: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   543
                     #(#SpecCollection
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   544
                        #collection: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   545
                         #(
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   546
                           #(#ActionButtonSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   547
                              #name: 'Button1'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   548
                              #label: 'Cancel'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   549
                              #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   550
                              #model: #cancel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   551
                              #extent: #(#Point 118 22)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   552
                          )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   553
                           #(#ActionButtonSpec
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   554
                              #name: 'Button2'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   555
                              #label: 'OK'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   556
                              #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   557
                              #model: #accept
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   558
                              #extent: #(#Point 118 22)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   559
                          )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   560
                        )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   561
                    )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   562
                    #horizontalLayout: #fitSpace
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   563
                    #verticalLayout: #center
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   564
                    #horizontalSpace: 3
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   565
                    #verticalSpace: 3
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   566
                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   567
              )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   568
          )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   569
      )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   570
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   571
    "Modified: / 7.9.1998 / 18:29:34 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   572
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   573
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   574
windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   575
    "This resource specification was automatically generated
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   576
     by the UIPainter of ST/X."
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   577
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   578
    "Do not manually edit this!! If it is corrupted,
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   579
     the UIPainter may not be able to read the specification."
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
     UIPainter new openOnClass:ImageEditor andSelector:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   583
     ImageEditor new openInterface:#windowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   584
     ImageEditor open
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
    <resource: #canvas>
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   588
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   589
    ^
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   590
     
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   591
       #(#FullSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   592
          #window: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   593
           #(#WindowSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   594
              #name: 'Image Editor'
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   595
              #layout: #(#LayoutFrame 176 0 156 0 675 0 501 0)
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   596
              #label: 'Image Editor'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   597
              #min: #(#Point 400 320)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   598
              #max: #(#Point 1152 900)
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   599
              #bounds: #(#Rectangle 176 156 676 502)
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   600
              #menu: #menu
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   601
              #usePreferredExtent: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   602
          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   603
          #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   604
           #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   605
              #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   606
               #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   607
                 #(#MenuPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   608
                    #name: 'menuToolbarView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   609
                    #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   610
                    #menu: #menuToolbar
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   611
                    #style: #(#FontDescription #helvetica #medium #roman 10)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   612
                    #showSeparatingLines: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   613
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   614
                 #(#VariableHorizontalPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   615
                    #name: 'variableHorizontalPanel1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   616
                    #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   617
                    #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   618
                     #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   619
                        #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   620
                         #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   621
                           #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   622
                              #name: 'view1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   623
                              #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   624
                               #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   625
                                  #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   626
                                   #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   627
                                     #(#VariableVerticalPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   628
                                        #name: 'VariableVerticalPanel1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   629
                                        #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   630
                                        #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   631
                                         #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   632
                                            #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   633
                                             #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   634
                                               #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   635
                                                  #name: 'View1'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   636
                                                  #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   637
                                                   #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   638
                                                      #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   639
                                                       #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   640
                                                         #(#MenuPanelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   641
                                                            #name: 'MouseButtonColorToolBar'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   642
                                                            #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   643
                                                            #menu: #menuMouseButtonColors
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   644
                                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   645
                                                         #(#DataSetSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   646
                                                            #name: 'colorDataSetView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   647
                                                            #layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   648
                                                            #activeHelpKey: #colorMapTable
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   649
                                                            #model: #selectionOfColor
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   650
                                                            #style: #(#FontDescription #helvetica #medium #roman 10)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   651
                                                            #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   652
                                                            #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   653
                                                            #miniScrollerHorizontal: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   654
                                                            #miniScrollerVertical: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   655
                                                            #dataList: #listOfColors
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   656
                                                            #has3Dsepartors: true
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   657
                                                            #has3Dseparators: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   658
                                                            #verticalSpacing: 1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   659
                                                            #columns: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   660
                                                             #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   661
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   662
                                                                  #rendererType: #rowSelector
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   663
                                                                  #backgroundSelector: #yourself
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   664
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   665
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   666
                                                                  #label: 'R'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   667
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   668
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   669
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   670
                                                                  #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
   671
                                                                  #model: #redFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   672
                                                                  #writeSelector: #redAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   673
                                                                  #selectSelector: #canSelectRedInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   674
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   675
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   676
                                                                  #label: 'G'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   677
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   678
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   679
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   680
                                                                  #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
   681
                                                                  #model: #greenFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   682
                                                                  #writeSelector: #greenAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   683
                                                                  #selectSelector: #canSelectGreenInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   684
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   685
                                                               #(#DataSetColumnSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   686
                                                                  #label: 'B'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   687
                                                                  #labelAlignment: #left
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   688
                                                                  #columnAlignment: #right
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   689
                                                                  #editorType: #InputField
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   690
                                                                  #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
   691
                                                                  #model: #blueFromColor:
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
   692
                                                                  #writeSelector: #blueAtColor:put:
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   693
                                                                  #selectSelector: #canSelectBlueInColor:
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   694
                                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   695
                                                            )
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
   696
                                                            #columnAdaptor: #colorColumnAdaptor
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   697
                                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   698
                                                      )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   699
                                                  )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   700
                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   701
                                               #(#ArbitraryComponentSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   702
                                                  #name: 'imagePreView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   703
                                                  #activeHelpKey: #previewView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   704
                                                  #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   705
                                                  #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   706
                                                  #miniScrollerHorizontal: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   707
                                                  #miniScrollerVertical: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   708
                                                  #component: #ImageView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   709
                                                  #hasBorder: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   710
                                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   711
                                            )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   712
                                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   713
                                        #handles: #(#Any 0.723776 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   714
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   715
                                  )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   716
                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   717
                          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   718
                           #(#ViewSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   719
                              #name: 'view2'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   720
                              #component: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   721
                               #(#SpecCollection
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   722
                                  #collection: 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   723
                                   #(
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   724
                                     #(#ArbitraryComponentSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   725
                                        #name: 'imageEditView'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   726
                                        #layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   727
                                        #hasHorizontalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   728
                                        #hasVerticalScrollBar: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   729
                                        #component: #ImageEditView
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   730
                                        #hasBorder: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   731
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   732
                                     #(#LabelSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   733
                                        #name: 'coordLabel'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   734
                                        #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
   735
                                        #labelChannel: #imageInfoHolder
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   736
                                        #level: -1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   737
                                        #adjust: #left
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   738
                                        #resizeForLabel: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   739
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   740
                                     #(#ArrowButtonSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   741
                                        #name: 'magnifyDownButton'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   742
                                        #layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   743
                                        #activeHelpKey: #magnifyImageDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   744
                                        #model: #doMagnifyDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   745
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   746
                                        #isTriggerOnDown: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   747
                                        #direction: #left
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   748
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   749
                                     #(#ArrowButtonSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   750
                                        #name: 'magnifyUpButton'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   751
                                        #layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   752
                                        #activeHelpKey: #magnifyImageUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   753
                                        #model: #doMagnifyUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   754
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   755
                                        #isTriggerOnDown: true
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   756
                                        #direction: #right
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   757
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   758
                                     #(#InputFieldSpec
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   759
                                        #name: 'magnificationInputField'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   760
                                        #layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   761
                                        #activeHelpKey: #magnificationNumber
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   762
                                        #enableChannel: #imageIsLoaded
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   763
                                        #model: #valueOfMagnification
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   764
                                        #type: #numberInRange
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   765
                                        #acceptOnReturn: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   766
                                        #acceptOnTab: false
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   767
                                        #numChars: 2
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   768
                                        #minValue: 1
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
   769
                                        #maxValue: 99
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   770
                                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   771
                                  )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   772
                              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   773
                              #level: -1
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   774
                          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   775
                        )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   776
                    )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   777
                    #handles: #(#Any 0.276 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   778
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   779
                 #(#UISubSpecification
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   780
                    #name: 'infoBarSubSpec'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   781
                    #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   782
                    #majorKey: #ToolApplicationModel
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   783
                    #minorKey: #windowSpecForInfoBar
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   784
                )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   785
              )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   786
          )
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   787
      )
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   788
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
   789
    "Modified: / 7.8.1998 / 22:52:28 / cg"
519
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   790
! !
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   791
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   792
!ImageEditor class methodsFor:'menu specs'!
085cf69fcd6c single lines in tool bar removed
tz
parents: 503
diff changeset
   793
400
228524287573 intitial checkin
tz
parents:
diff changeset
   794
menu
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   795
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   796
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
   797
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   798
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
   799
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
   800
228524287573 intitial checkin
tz
parents:
diff changeset
   801
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   802
     MenuEditor new openOnClass:ImageEditor andSelector:#menu
228524287573 intitial checkin
tz
parents:
diff changeset
   803
     (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
   804
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   805
228524287573 intitial checkin
tz
parents:
diff changeset
   806
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
   807
228524287573 intitial checkin
tz
parents:
diff changeset
   808
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   809
     
228524287573 intitial checkin
tz
parents:
diff changeset
   810
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   811
          
228524287573 intitial checkin
tz
parents:
diff changeset
   812
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
   813
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   814
                #label: 'About'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   815
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   816
                #activeHelpKey: #about
738210a2fa06 revised version
tz
parents: 651
diff changeset
   817
                #labelImage: #(#ResourceRetriever nil #menuIcon)
738210a2fa06 revised version
tz
parents: 651
diff changeset
   818
                #submenuChannel: #menuAbout
400
228524287573 intitial checkin
tz
parents:
diff changeset
   819
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   820
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   821
                #label: 'File'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   822
                #translateLabel: true
738210a2fa06 revised version
tz
parents: 651
diff changeset
   823
                #activeHelpKey: #file
738210a2fa06 revised version
tz
parents: 651
diff changeset
   824
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
   825
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   826
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   827
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   828
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   829
                          #label: 'New...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   830
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   831
                          #value: #doNewImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   832
                          #activeHelpKey: #fileNewImage
400
228524287573 intitial checkin
tz
parents:
diff changeset
   833
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   834
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   835
                          #label: '-'
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: 'Load...'
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: #doLoadFromClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   841
                          #activeHelpKey: #fileLoadFromClass
400
228524287573 intitial checkin
tz
parents:
diff changeset
   842
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   843
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   844
                          #label: 'Load From File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   845
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   846
                          #value: #doLoadFromFile
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   847
                          #activeHelpKey: #fileLoadFromFile
400
228524287573 intitial checkin
tz
parents:
diff changeset
   848
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   849
                       #(#MenuItem
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   850
                          #label: 'Grab From Screen'
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   851
                          #translateLabel: true
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   852
                          #value: #grabScreenImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   853
                          #activeHelpKey: #fileGrabImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   854
                      )
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
   855
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   856
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   857
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   858
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   859
                          #label: 'Save'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   860
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   861
                          #value: #doSaveMethod
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   862
                          #activeHelpKey: #fileSaveMethod
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   863
                          #enabled: #imageIsLoadedAndClassDefined
400
228524287573 intitial checkin
tz
parents:
diff changeset
   864
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   865
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   866
                          #label: 'Save As...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   867
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   868
                          #value: #doSaveMethodAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   869
                          #activeHelpKey: #fileSaveMethodAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   870
                          #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
   871
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
   872
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
   873
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   874
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   875
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   876
                          #label: 'Save To File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   877
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   878
                          #value: #doSaveImageFileAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   879
                          #activeHelpKey: #fileSaveAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   880
                          #enabled: #imageIsLoaded
400
228524287573 intitial checkin
tz
parents:
diff changeset
   881
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   882
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   883
                          #label: 'Save Mask To File...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   884
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   885
                          #value: #doSaveImageMaskFileAs
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   886
                          #activeHelpKey: #fileSaveMaskAs
738210a2fa06 revised version
tz
parents: 651
diff changeset
   887
                          #enabled: #imageIsLoaded
400
228524287573 intitial checkin
tz
parents:
diff changeset
   888
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   889
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   890
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   891
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   892
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   893
                          #label: 'Print'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   894
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   895
                          #value: #doPrint
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   896
                          #activeHelpKey: #filePrint
738210a2fa06 revised version
tz
parents: 651
diff changeset
   897
                          #enabled: #imageIsLoaded
400
228524287573 intitial checkin
tz
parents:
diff changeset
   898
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   899
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   900
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   901
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   902
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   903
                          #label: 'Browse Class'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   904
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   905
                          #value: #doBrowseClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   906
                          #activeHelpKey: #fileBrowseClass
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   907
                          #enabled: #hasClassDefined
400
228524287573 intitial checkin
tz
parents:
diff changeset
   908
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   909
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   910
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   911
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   912
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   913
                          #label: 'Exit'
738210a2fa06 revised version
tz
parents: 651
diff changeset
   914
                          #translateLabel: true
738210a2fa06 revised version
tz
parents: 651
diff changeset
   915
                          #value: #closeRequest
738210a2fa06 revised version
tz
parents: 651
diff changeset
   916
                          #activeHelpKey: #fileExit
400
228524287573 intitial checkin
tz
parents:
diff changeset
   917
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   918
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   919
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   920
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   921
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   922
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   923
                #label: 'Edit'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   924
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   925
                #activeHelpKey: #edit
738210a2fa06 revised version
tz
parents: 651
diff changeset
   926
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
   927
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
   928
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   929
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   930
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   931
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   932
                          #label: 'Undo'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   933
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   934
                          #value: #doUndo
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   935
                          #activeHelpKey: #editUndo
738210a2fa06 revised version
tz
parents: 651
diff changeset
   936
                          #enabled: #valueOfCanUndo
400
228524287573 intitial checkin
tz
parents:
diff changeset
   937
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   938
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   939
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   940
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   941
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   942
                          #label: 'Flip - Vertical'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   943
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   944
                          #value: #doFlipVertical
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   945
                          #activeHelpKey: #editFlipVertical
400
228524287573 intitial checkin
tz
parents:
diff changeset
   946
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   947
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   948
                          #label: 'Flip - Horizontal'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   949
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   950
                          #value: #doFlipHorizontal
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   951
                          #activeHelpKey: #editFlipHorizontal
400
228524287573 intitial checkin
tz
parents:
diff changeset
   952
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   953
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   954
                          #label: '-'
400
228524287573 intitial checkin
tz
parents:
diff changeset
   955
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   956
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   957
                          #label: 'Resize...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   958
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   959
                          #value: #doResizeImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   960
                          #activeHelpKey: #editResize
400
228524287573 intitial checkin
tz
parents:
diff changeset
   961
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   962
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   963
                          #label: 'Magnify...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   964
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   965
                          #value: #doMagnifyImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   966
                          #activeHelpKey: #editMagnifyImage
400
228524287573 intitial checkin
tz
parents:
diff changeset
   967
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   968
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   969
                          #label: 'Rotate...'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
   970
                          #translateLabel: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
   971
                          #value: #doRotateImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
   972
                          #activeHelpKey: #editRotate
400
228524287573 intitial checkin
tz
parents:
diff changeset
   973
                      )
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   974
                       #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   975
                          #label: '-'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   976
                      )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   977
                       #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   978
                          #label: 'Crob'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   979
                          #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   980
                          #submenu: 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   981
                           #(#Menu
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   982
                              
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   983
                               #(
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   984
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   985
                                    #label: 'All'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   986
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   987
                                    #value: #doCrobAll
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   988
                                    #activeHelpKey: #crobAll
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   989
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   990
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   991
                                    #label: '-'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   992
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   993
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   994
                                    #label: 'Left'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   995
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   996
                                    #value: #doCrobLeft
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   997
                                    #activeHelpKey: #crobLeft
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   998
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
   999
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1000
                                    #label: 'Right'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1001
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1002
                                    #value: #doCrobRight
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1003
                                    #activeHelpKey: #crobRight
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1004
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1005
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1006
                                    #label: 'Top'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1007
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1008
                                    #value: #doCrobTop
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1009
                                    #activeHelpKey: #crobTop
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1010
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1011
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1012
                                    #label: 'Bottom'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1013
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1014
                                    #value: #doCrobBottom
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1015
                                    #activeHelpKey: #crobBottom
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1016
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1017
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1018
                                    #label: '-'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1019
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1020
                                 #(#MenuItem
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1021
                                    #label: 'Manual...'
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1022
                                    #translateLabel: true
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1023
                                    #value: #doCrobManual
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1024
                                    #activeHelpKey: #crobManual
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1025
                                )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1026
                              ) nil
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1027
                              nil
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1028
                          )
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1029
                      )
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1030
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1031
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1032
                )
228524287573 intitial checkin
tz
parents:
diff changeset
  1033
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1034
             #(#MenuItem
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1035
                #label: 'ColorMap'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1036
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1037
                #activeHelpKey: #colorMap
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1038
                #enabled: #imageIsLoaded
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1039
                #submenu: 
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1040
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
  1041
                    
228524287573 intitial checkin
tz
parents:
diff changeset
  1042
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
  1043
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1044
                          #label: '8-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1045
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1046
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1047
                          #activeHelpKey: #colorMap8
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1048
                          #argument: '8-plane'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1049
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1050
                          #choiceValue: '8-plane'
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1051
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1052
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1053
                          #label: '4-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1054
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1055
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1056
                          #activeHelpKey: #colorMap4
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1057
                          #argument: '4-plane'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1058
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1059
                          #choiceValue: '4-plane'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1060
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1061
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1062
                          #label: '2-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1063
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1064
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1065
                          #activeHelpKey: #colorMap2
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1066
                          #argument: '2-plane'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1067
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1068
                          #choiceValue: '2-plane'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1069
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1070
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1071
                          #label: '1-Plane'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1072
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1073
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1074
                          #activeHelpKey: #colorMap1
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1075
                          #argument: '1-plane'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1076
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1077
                          #choiceValue: '1-plane'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1078
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1079
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1080
                          #label: '-'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1081
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1082
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1083
                          #label: '8-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1084
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1085
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1086
                          #activeHelpKey: #colorMap8M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1087
                          #argument: '8-plane + mask'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1088
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1089
                          #choiceValue: '8-plane + mask'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1090
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1091
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1092
                          #label: '4-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1093
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1094
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1095
                          #activeHelpKey: #colorMap4M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1096
                          #argument: '4-plane + mask'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1097
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1098
                          #choiceValue: '4-plane + mask'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1099
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1100
                       #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1101
                          #label: '2-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1102
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1103
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1104
                          #activeHelpKey: #colorMap2M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1105
                          #argument: '2-plane + mask'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1106
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1107
                          #choiceValue: '2-plane + mask'
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1108
                      )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1109
                       #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1110
                          #label: '1-Plane + Mask'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1111
                          #translateLabel: true
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1112
                          #value: #colorMapMode:
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1113
                          #activeHelpKey: #colorMap1M
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1114
                          #argument: '1-plane + mask'
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1115
                          #choice: #colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1116
                          #choiceValue: '1-plane + mask'
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1117
                      )
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1118
                       #(#MenuItem
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1119
                          #label: '-'
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1120
                      )
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1121
                       #(#MenuItem
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1122
                          #label: 'Compress colormap'
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1123
                          #translateLabel: true
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1124
                          #value: #compressColorMap
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  1125
                          #activeHelpKey: #compressColormap
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1126
                          #enabled: #hasColormap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1127
                      )
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1128
                       #(#MenuItem
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1129
                          #label: 'Sort colormap'
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1130
                          #translateLabel: true
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1131
                          #value: #sortColorMap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1132
                          #enabled: #hasColormap
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1133
                      )
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1134
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1135
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1136
                )
228524287573 intitial checkin
tz
parents:
diff changeset
  1137
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1138
             #(#MenuItem
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1139
                #label: 'Settings'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1140
                #translateLabel: true
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1141
                #submenu: 
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1142
                 #(#Menu
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1143
                    
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1144
                     #(
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1145
                       #(#MenuItem
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1146
                          #label: 'Grid Magnification...'
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1147
                          #translateLabel: true
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1148
                          #value: #doChangeGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1149
                          #activeHelpKey: #settingsGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1150
                      )
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1151
                       #(#MenuItem
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1152
                          #label: '-'
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1153
                      )
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1154
                       #(#MenuItem
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1155
                          #label: 'Fonts'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1156
                          #translateLabel: true
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1157
                          #submenuChannel: #menuFont
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1158
                      )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1159
                    ) nil
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1160
                    nil
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1161
                )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1162
            )
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1163
             #(#MenuItem
756
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
  1164
                #label: 'History'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1165
                #translateLabel: true
756
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
  1166
                #activeHelpKey: #history
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
  1167
                #submenuChannel: #menuHistory
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
  1168
            )
52a76ec8828d (image with colorMap size = 1)-bug fixed
tz
parents: 737
diff changeset
  1169
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1170
                #label: 'Help'
843
273d9a7c2712 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 815
diff changeset
  1171
                #translateLabel: true
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1172
                #startGroup: #right
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1173
                #activeHelpKey: #help
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1174
                #submenuChannel: #menuHelp
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1175
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1176
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1177
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1178
      )
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1179
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1180
    "Modified: / 30.9.1998 / 23:53:12 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1181
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1182
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1183
menuMouseButtonColors
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1184
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1185
     by the MenuEditor of ST/X."
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1186
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1187
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1188
     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
  1189
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1190
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1191
     MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1192
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1193
    "
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1194
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1195
    <resource: #menu>
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1196
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1197
    ^
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1198
     
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1199
       #(#Menu
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1200
          
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1201
           #(
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1202
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1203
                #label: 'Left Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1204
                #nameKey: #leftMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1205
                #activeHelpKey: #mouseKeyColorMode
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1206
                #enabled: #imageIsLoaded
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1207
                #labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon)
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1208
                #choice: #mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1209
                #choiceValue: 1
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1210
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1211
             #(#MenuItem
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1212
                #label: 'Right Mouse Button'
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1213
                #nameKey: #rightMouseKeyButton
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1214
                #activeHelpKey: #mouseKeyColorMode
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1215
                #enabled: #imageIsLoaded
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1216
                #labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon)
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1217
                #choice: #mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1218
                #choiceValue: 2
679
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1219
            )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1220
          ) nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1221
          nil
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1222
      )
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1223
!
9cd2115ac627 mouse button color menu readded below the color map
tz
parents: 676
diff changeset
  1224
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1225
menuToolbar
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1226
    "This resource specification was automatically generated
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1227
     by the MenuEditor of ST/X."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1228
737
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1229
    "Do not manually edit this!! If it is corrupted,
ed5b109a0f91 user can define own fonts
tz
parents: 732
diff changeset
  1230
     the MenuEditor may not be able to read the specification."
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1231
228524287573 intitial checkin
tz
parents:
diff changeset
  1232
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1233
     MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
  1234
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
  1235
    "
228524287573 intitial checkin
tz
parents:
diff changeset
  1236
228524287573 intitial checkin
tz
parents:
diff changeset
  1237
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
  1238
228524287573 intitial checkin
tz
parents:
diff changeset
  1239
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
  1240
     
228524287573 intitial checkin
tz
parents:
diff changeset
  1241
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
  1242
          
228524287573 intitial checkin
tz
parents:
diff changeset
  1243
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
  1244
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1245
                #label: 'newImage'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1246
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1247
                #value: #doNewImage
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1248
                #activeHelpKey: #fileNewImage
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1249
                #labelImage: #(#ResourceRetriever #Icon #newIcon)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1250
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1251
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1252
                #label: 'loadFromClass'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1253
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1254
                #value: #doLoadFromClass
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1255
                #activeHelpKey: #fileLoadFromClass
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1256
                #labelImage: #(#ResourceRetriever #Icon #loadIcon)
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1257
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1258
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1259
                #label: 'saveMethod'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1260
                #isButton: true
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1261
                #value: #doSaveMethod
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1262
                #activeHelpKey: #fileSaveMethod
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1263
                #enabled: #imageIsLoaded
880
a344e9ef09dc images moved to class Icon
tz
parents: 843
diff changeset
  1264
                #labelImage: #(#ResourceRetriever #Icon #saveIcon)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1265
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1266
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1267
                #label: ''
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1268
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1269
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1270
                #label: ''
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1271
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1272
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1273
                #label: ''
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1274
            )
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1275
             #(#MenuItem
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1276
                #label: ''
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1277
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1278
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1279
                #label: 'Point'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1280
                #activeHelpKey: #drawModePoint
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1281
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1282
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1283
                #choiceValue: #point
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1284
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1285
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1286
                #label: 'Box'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1287
                #activeHelpKey: #drawModeBox
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1288
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1289
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1290
                #choiceValue: #box
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1291
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1292
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1293
                #label: 'Filled Box'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1294
                #activeHelpKey: #drawModeFilledBox
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1295
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1296
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1297
                #choiceValue: #filledBox
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1298
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1299
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1300
                #label: 'Fill'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1301
                #activeHelpKey: #drawModeFill
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1302
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1303
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1304
                #choiceValue: #fill
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1305
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1306
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1307
                #label: 'Copy'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1308
                #activeHelpKey: #drawModeCopy
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1309
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1310
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1311
                #choiceValue: #copy
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1312
            )
228524287573 intitial checkin
tz
parents:
diff changeset
  1313
             #(#MenuItem
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1314
                #label: 'Paste'
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1315
                #activeHelpKey: #drawModePaste
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1316
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1317
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1318
                #choiceValue: #paste
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1319
            )
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1320
             #(#MenuItem
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1321
                #label: 'Paste Under'
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1322
                #activeHelpKey: #drawModePasteUnder
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1323
                #enabled: #imageIsLoaded
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1324
                #choice: #editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1325
                #choiceValue: #pasteUnder
914
b4f32d092c8b added paste-under;
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
  1326
            )
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1327
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1328
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1329
      )
228524287573 intitial checkin
tz
parents:
diff changeset
  1330
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1331
228524287573 intitial checkin
tz
parents:
diff changeset
  1332
!ImageEditor methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1333
228524287573 intitial checkin
tz
parents:
diff changeset
  1334
image
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1335
    "returns the current editing image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1336
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1337
    ^imageEditView image
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1338
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1339
228524287573 intitial checkin
tz
parents:
diff changeset
  1340
postOpenAction: anAction
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1341
   "sets an action which is evaluated after opening"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1342
228524287573 intitial checkin
tz
parents:
diff changeset
  1343
    postOpenAction := anAction
228524287573 intitial checkin
tz
parents:
diff changeset
  1344
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1345
228524287573 intitial checkin
tz
parents:
diff changeset
  1346
!ImageEditor methodsFor:'accessing - views'!
228524287573 intitial checkin
tz
parents:
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
colorDataSetView
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1349
    "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
  1350
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1351
    ^(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
  1352
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1353
    "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
  1354
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1355
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1356
coordLabel
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1357
    "returns the view the coord label"
487
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1358
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1359
    ^builder componentAt: #coordLabel
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1360
!
6c336c183330 info bar as subSpec to class ToolApplicationModel moved
tz
parents: 475
diff changeset
  1361
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1362
imageEditView
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1363
    "returns the view of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1364
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1365
    ^imageEditView := (builder componentAt: #imageEditView) subViews first 
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1366
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1367
228524287573 intitial checkin
tz
parents:
diff changeset
  1368
imagePreView
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1369
    "returns the preview of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1370
228524287573 intitial checkin
tz
parents:
diff changeset
  1371
    ^(builder componentAt: #imagePreView) subViews first 
475
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  1372
! !
0d5a50fe59f4 default value of info label set
tz
parents: 468
diff changeset
  1373
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1374
!ImageEditor methodsFor:'aspects'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1375
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1376
activityInfoHolder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1377
    ^ self valueOfInfoLabel
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1378
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1379
    "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
  1380
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1381
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1382
colorColumnAdaptor
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1383
    ^ self
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1384
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1385
    "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
  1386
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1387
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1388
hasClassAndSelectorDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1389
    ^ [(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
  1390
       and:[imageEditView resourceSelector notNil]]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1391
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1392
    "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
  1393
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1394
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1395
hasClassDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1396
    ^ [(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
  1397
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1398
    "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
  1399
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1400
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1401
hasColormap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1402
    ^ [self image notNil and:[self image colorMap notNil]]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1403
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1404
    "Created: / 30.9.1998 / 23:53:55 / cg"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1405
!
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1406
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1407
imageInfoHolder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1408
    |holder|
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1409
    (holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1410
        builder aspectAt:#imageInfoHolder put:(holder :=  '' asValue).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1411
    ].
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1412
    ^ holder
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1413
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1414
    "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
  1415
!
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1416
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1417
imageIsLoaded
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1418
    "returns whether an image is loaded as value holder"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1419
228524287573 intitial checkin
tz
parents:
diff changeset
  1420
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1421
    (holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1422
        builder aspectAt:#imageIsLoaded put:(holder :=  false asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1423
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1424
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1425
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1426
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1427
imageIsLoadedAndClassDefined
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1428
    "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
  1429
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1430
    ^ [self hasClassAndSelectorDefined value
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1431
       and:[self imageIsLoaded value]]
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1432
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1433
    "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
  1434
!
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1435
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1436
listOfColors
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1437
    "returns the list of colors in a List"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1438
228524287573 intitial checkin
tz
parents:
diff changeset
  1439
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1440
    (holder := builder bindingAt:#listOfColors) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1441
        builder aspectAt:#listOfColors put:(holder :=  List new).
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1442
        holder addDependent:self.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1443
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1444
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1445
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1446
228524287573 intitial checkin
tz
parents:
diff changeset
  1447
selectionOfColor
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1448
    "returns current selection of the edit color as an AspectAdaptor"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1449
228524287573 intitial checkin
tz
parents:
diff changeset
  1450
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1451
    (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1452
        builder aspectAt:#selectionOfColor put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1453
        holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex).
228524287573 intitial checkin
tz
parents:
diff changeset
  1454
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1455
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1456
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1457
228524287573 intitial checkin
tz
parents:
diff changeset
  1458
valueOfMagnification
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1459
    "returns current magnification of the image as an AspectAdaptor"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1460
228524287573 intitial checkin
tz
parents:
diff changeset
  1461
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1462
    (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1463
        builder aspectAt:#valueOfMagnification put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1464
        holder := AspectAdaptor new subject:self; forAspect:#magnification)
228524287573 intitial checkin
tz
parents:
diff changeset
  1465
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1466
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1467
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1468
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1469
!ImageEditor methodsFor:'change & update'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1470
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1471
findColorMapMode
899
43b744c647ba comment grammar
tz
parents: 898
diff changeset
  1472
    "finds the colorMapMode for a new image"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1473
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1474
    self image depth > 8 ifTrue: [colorMapMode value: ''. self listOfColors removeAll. ^nil].
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1475
976
abd5f51e3e64 use radio buttons (2)
tz
parents: 975
diff changeset
  1476
    colorMapMode value: self image depth printString, '-plane'.
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1477
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1478
    self listOfColors isEmpty
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1479
    ifTrue:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1480
    [   
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1481
         self colorMapMode: colorMapMode value
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1482
    ].                               
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1483
    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
  1484
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1485
    self image mask notNil
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1486
    ifTrue:
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1487
    [             
976
abd5f51e3e64 use radio buttons (2)
tz
parents: 975
diff changeset
  1488
        colorMapMode value: colorMapMode value, ' + mask'.
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1489
898
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1490
        (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
  1491
        ifTrue:
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1492
        [
d2ae6ce33fec bugs fixed in undo/mask and pasting
tz
parents: 895
diff changeset
  1493
            self listOfColors addFirst: (Color basicNew setColorId:0).
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1494
            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
  1495
        ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1496
    ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1497
    self selectionOfColor value: 0.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1498
    self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1499
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1500
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1501
update:something with:aParameter from:changedObject
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1502
    |clrIndex|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1503
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1504
    changedObject == self listOfColors ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1505
        something == #at: ifTrue:[
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1506
            "/ colormap entry changed at aParameter
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1507
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1508
            clrIndex := aParameter.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1509
            (self hasMask) ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1510
                clrIndex := clrIndex - 1.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1511
            ].
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1512
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1513
            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
  1514
            self colorMapChanged.
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1515
            ^ self
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1516
        ].
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1517
    ].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1518
    super update:something with:aParameter from:changedObject
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1519
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1520
    "Modified: / 18.8.1998 / 17:18:42 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1521
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1522
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1523
updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1524
    "updates channels and view, if image is loaded"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1525
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1526
    self imageIsLoaded value: false.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1527
    self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1528
    self imagePreView image: nil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1529
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1530
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1531
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1532
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1533
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1534
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1535
updateLabelsAndHistory
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1536
    "updates labels and history, if something has changed"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1537
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1538
    self imageIsLoaded value: self image notNil.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1539
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1540
    self image isNil ifTrue: [^nil].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1541
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1542
    self updateInfoLabel.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1543
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1544
    imageEditView resourceMessage asCollectionOfWords size = 2
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1545
        ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1546
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1547
    self image fileName notNil
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1548
        ifTrue: [self addToHistory: self image fileName -> #loadFromFile:].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1549
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1550
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1551
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1552
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1553
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1554
!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
  1555
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1556
blueAtColor:aColor put:newBlue
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1557
    "helper used to return a new row element, when blue is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1558
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1559
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1560
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1561
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1562
    byte := newBlue clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1563
    byte = aColor blueByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1564
    ^ Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1565
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1566
    "Modified: / 18.8.1998 / 17:00:12 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1567
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1568
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1569
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
  1570
    "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
  1571
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1572
    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
  1573
    ^ 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
  1574
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1575
    "Created: / 26.7.1998 / 12:30:35 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1576
    "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
  1577
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1578
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1579
canSelectBlueInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1580
    ^ aColor blueByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1581
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1582
    "Created: / 7.8.1998 / 22:50:34 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1583
    "Modified: / 7.8.1998 / 22:52:57 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1584
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1585
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1586
canSelectGreenInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1587
    ^ aColor greenByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1588
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1589
    "Created: / 7.8.1998 / 22:50:22 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1590
    "Modified: / 7.8.1998 / 22:52:46 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1591
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1592
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1593
canSelectRedInColor:aColor
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1594
    ^ aColor redByte notNil
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1595
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1596
    "Created: / 7.8.1998 / 22:50:00 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1597
    "Modified: / 7.8.1998 / 22:51:03 / cg"
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1598
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1599
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1600
greenAtColor:aColor put:newGreen
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1601
    "helper used to return a new row element, when green is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1602
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1603
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1604
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1605
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1606
    byte := newGreen clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1607
    byte = aColor greenByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1608
    ^ Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1609
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1610
    "Modified: / 18.8.1998 / 17:00:38 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1611
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1612
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1613
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
  1614
    "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
  1615
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1616
    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
  1617
    ^ 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
  1618
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1619
    "Created: / 26.7.1998 / 12:30:29 / cg"
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1620
    "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
  1621
!
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1622
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1623
redAtColor:aColor put:newRed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1624
    "helper used to return a new row element, when red is changed"
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1625
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1626
    |byte|
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1627
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1628
    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1629
    byte := newRed clampBetween:0 and:255.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1630
    byte = aColor redByte ifTrue:[^ aColor].
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1631
    ^ Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1632
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1633
    "Modified: / 18.8.1998 / 17:00:49 / cg"
942
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1634
!
4b47d3d652ad checkin from browser
tz
parents: 941
diff changeset
  1635
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1636
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
  1637
    "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
  1638
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1639
    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
  1640
    ^ 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
  1641
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  1642
    "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
  1643
! !
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  1644
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1645
!ImageEditor methodsFor:'help'!
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1646
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1647
defaultInfoLabel
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1648
    "returns the default info label"
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1649
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1650
    (imageEditView resourceClass isSymbol and: [(Smalltalk at: imageEditView resourceClass) isClass])
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1651
    ifTrue:
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1652
    [
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1653
        ^imageEditView resourceClass, ' >> ', imageEditView resourceSelector
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1654
    ].
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1655
    ^'No class and selector defined.'
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1656
!
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1657
702
c9de7a9bc416 docu call changed
tz
parents: 694
diff changeset
  1658
openDocumentation
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1659
    "opens the documentation file of the Image Editor"
674
d49e23b768e6 unused method found + help file access added
tz
parents: 673
diff changeset
  1660
763
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  1661
    self openHTMLDocument: 'tools/uipainter/ImageEditor.html'
19b3e479e0b8 docu call
tz
parents: 756
diff changeset
  1662
672
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1663
! !
738210a2fa06 revised version
tz
parents: 651
diff changeset
  1664
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1665
!ImageEditor methodsFor:'loading'!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1666
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1667
loadFromFile: aFileName
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1668
    "loads an image from aFileName and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1669
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1670
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1671
980
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1672
    self withCursor:Cursor wait do:[
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1673
        (imageEditView loadFromFile: aFileName) notNil ifTrue:[
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1674
            (img := self image) notNil ifTrue:[          
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1675
                img colorMap notNil ifTrue:[
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1676
                    self listOfColors contents:(img usedColors asSet asOrderedCollection).
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1677
                ] ifFalse:[
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1678
                    self listOfColors removeAll.
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1679
                ].
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1680
                self findColorMapMode.     
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1681
                self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1682
            ] ifFalse:[
980
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1683
                self updateForNoneImage
bd21079f40e1 show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
  1684
            ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1685
        ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1686
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1687
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1688
    "Modified: / 18.8.1998 / 17:03:54 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1689
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1690
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1691
loadFromImage:anImage
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1692
    "loads an image from anImage and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1693
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1694
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1695
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1696
    imageEditView image:anImage.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1697
    (img := self image) notNil ifTrue:[    
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1698
        img colorMap notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1699
            self listOfColors contents:(img usedColors asSet asOrderedCollection).
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1700
        ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1701
            self listOfColors removeAll.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1702
        ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1703
        self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1704
        self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1705
    ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1706
        self updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1707
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1708
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1709
    "Modified: / 18.8.1998 / 17:04:46 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1710
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1711
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1712
loadFromMessage: aMessage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1713
    "loads an image by evaluating aMessage and sets up color map list and other info labels"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1714
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1715
    |img|
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1716
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1717
    (imageEditView loadFromMessage: aMessage) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1718
        (img := self image) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1719
            self listOfColors contents:(img usedColors asSet asOrderedCollection).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1720
            self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1721
            self updateLabelsAndHistory.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1722
        ] ifFalse:[
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1723
            self updateForNoneImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1724
        ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1725
    ]
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1726
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1727
    "Modified: / 18.8.1998 / 17:03:01 / cg"
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1728
!
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1729
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1730
loadFromOrPrepareForMessage: aMessage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1731
    "loads an image by evaluating aMessage;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1732
     if no image could extract from aMessage; do set the class and the selector from 
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1733
     the aMessage for a saving at the end of editing"
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1734
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1735
    (imageEditView loadFromMessage: aMessage) notNil
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1736
    ifTrue:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1737
    [
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1738
        self listOfColors contents: self image usedColors asSet asOrderedCollection.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1739
        self findColorMapMode.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1740
    ]
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1741
    ifFalse:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1742
    [
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1743
        imageEditView resourceMessage: aMessage.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1744
    ].
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1745
    self updateLabelsAndHistory.
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1746
! !
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1747
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1748
!ImageEditor methodsFor:'menu modes'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1749
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1750
colorMapMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1751
    "returns colorMapMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1752
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1753
    colorMapMode isNil ifTrue: [colorMapMode := '' asValue].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1754
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1755
    ^colorMapMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1756
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1757
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1758
editMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1759
    "returns editMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1760
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1761
    editMode isNil
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1762
    ifTrue:
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1763
    [
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1764
        editMode := #point asValue.
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1765
        editMode onChangeSend: #value to: [imageEditView editMode: editMode value]
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1766
    ].
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1767
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1768
    ^editMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1769
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1770
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1771
mouseKeyColorMode
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1772
    "returns mouseKeyColorMode"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1773
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1774
    mouseKeyColorMode isNil
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1775
    ifTrue:
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1776
    [
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1777
        mouseKeyColorMode := 1 asValue.
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1778
        mouseKeyColorMode onChangeSend: #value to: [imageEditView mouseKeyColorMode: mouseKeyColorMode value. self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).]
956
dc4df8952e82 check whether imageEditView is nil
ca
parents: 951
diff changeset
  1779
    ].
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1780
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1781
    ^mouseKeyColorMode
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1782
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1783
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1784
!ImageEditor methodsFor:'queries'!
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1785
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1786
hasMask
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1787
    ^ colorMapMode notNil and:[colorMapMode value endsWith:'mask']
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1788
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1789
    "Created: / 18.8.1998 / 17:17:38 / cg"
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1790
!
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1791
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1792
preferredExtent
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1793
    "returns the preferred extent"
535
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1794
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1795
    ^super preferredExtent max: (Screen current width//3)@(Screen current height//3.5)
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1796
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1797
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1798
! !
1caf545614c5 info bar subspec changed
tz
parents: 519
diff changeset
  1799
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1800
!ImageEditor methodsFor:'selection'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1801
228524287573 intitial checkin
tz
parents:
diff changeset
  1802
magnification
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1803
    "returns the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1804
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1805
    self imageEditView isNil ifTrue: [^1].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1806
    ^imageEditView magnification x
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1807
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1808
228524287573 intitial checkin
tz
parents:
diff changeset
  1809
magnification: aValue
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1810
    "sets the magnification of the image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1811
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1812
    |magnification|        
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  1813
    magnification := (aValue ? 1) asPoint.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1814
    (magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil].
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1815
    imageEditView magnification: magnification
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1816
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1817
228524287573 intitial checkin
tz
parents:
diff changeset
  1818
selectedColorIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1819
    "returns the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1820
228524287573 intitial checkin
tz
parents:
diff changeset
  1821
    ^selectedColorIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  1822
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1823
228524287573 intitial checkin
tz
parents:
diff changeset
  1824
selectedColorIndex: anIndex
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1825
    "sets the index of the selected color"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1826
228524287573 intitial checkin
tz
parents:
diff changeset
  1827
    selectedColorIndex := anIndex.    
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1828
    imageEditView selectedColor: (self listOfColors at: anIndex ifAbsent: [^nil])
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1829
228524287573 intitial checkin
tz
parents:
diff changeset
  1830
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1831
228524287573 intitial checkin
tz
parents:
diff changeset
  1832
!ImageEditor methodsFor:'startup / release'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1833
228524287573 intitial checkin
tz
parents:
diff changeset
  1834
closeRequest
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1835
    "close request"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1836
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1837
    imageEditView checkModified ifTrue:[super closeRequest]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1838
228524287573 intitial checkin
tz
parents:
diff changeset
  1839
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1840
228524287573 intitial checkin
tz
parents:
diff changeset
  1841
open
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1842
    "after opening, sets the masterApplication of the imageEditView to self"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1843
228524287573 intitial checkin
tz
parents:
diff changeset
  1844
    super open.
444
cd7959cb70dd some clean ups
tz
parents: 420
diff changeset
  1845
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1846
    imageEditView := (builder componentAt: #imageEditView) subViews first.
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1847
    imageEditView masterApplication: self.
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1848
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1849
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1850
228524287573 intitial checkin
tz
parents:
diff changeset
  1851
postOpenWith:aBuilder
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1852
    "after opening, sets the masterApplication of the imageEditView to self;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1853
     evaluate the postOpenAction"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1854
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  1855
    imageEditView masterApplication: self.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1856
    imageEditView imageInfoHolder:(self imageInfoHolder).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1857
    imageEditView activityInfoHolder:(self activityInfoHolder).
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1858
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1859
    postOpenAction notNil ifTrue: [postOpenAction value].
228524287573 intitial checkin
tz
parents:
diff changeset
  1860
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  1861
    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
  1862
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1863
    "Modified: / 29.7.1998 / 18:49:20 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1864
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1865
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1866
!ImageEditor methodsFor:'user actions - colormap'!
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1867
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1868
colorMapChanged
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1869
    |img|
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1870
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1871
    img := self image.
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1872
    img release.
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1873
    imageEditView invalidate.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1874
    self imagePreView invalidate.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1875
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1876
"/    (imageEditView image:img) notNil ifTrue:[
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1877
"/        self updateLabelsAndHistory.
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1878
"/        self imagePreView image:img
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1879
"/    ]
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1880
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1881
    "Created: / 7.8.1998 / 22:26:10 / cg"
960
6196f12b97f6 fixed color editing
Claus Gittinger <cg@exept.de>
parents: 958
diff changeset
  1882
    "Modified: / 18.8.1998 / 17:08:55 / cg"
945
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1883
!
cb689f3971ab allow editing of color values;
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1884
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  1885
colorMapMode:aMode
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1886
    "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
  1887
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1888
    |depth numColors newColorMap newImage 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1889
     oldImage image newColors realColorMap oldFileName
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1890
     usedColors useNearest usageCounts tmpBits tmpMap quest
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1891
     prevMode maskThreshold maskImage| 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1892
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1893
    self withExecuteCursorDo:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1894
        oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1895
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1896
        prevMode := colorMapMode.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1897
        oldImage depth > 8 ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1898
            prevMode := nil
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1899
        ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1900
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1901
        newColorMap := self class listOfColorMaps at:aMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1902
        depth       := (newColorMap size log: 2) asInteger. 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1903
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1904
        useNearest := false.
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1905
        depth == 1 ifTrue:[
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1906
            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
  1907
        ] ifFalse:[
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1908
            prevMode isNil ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1909
                quest := 'Compute colormap (or use standard)'
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1910
            ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1911
                quest := 'Keep colormap (or use standard)'
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1912
            ]
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1913
        ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1914
        ((prevMode = aMode)
958
14088f998b72 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1915
        or:[self confirm:(resources string:quest)]) ifTrue:[
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1916
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1917
            "/ keep the colormap
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1918
            newColorMap atAllPut:Color black.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1919
            depth > oldImage depth ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1920
                "/ easy - simply copy the part
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1921
                numColors := 1 bitShift:oldImage depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1922
                0 to:numColors-1 do:[:pixel |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1923
                    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
  1924
                ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1925
            ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1926
                "/ see if all used color fit the new colormap
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1927
                usedColors := oldImage usedColorsMax:(1 bitShift:depth).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1928
                (usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1929
                    "/ yea - just install them
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1930
                    usedColors asArray keysAndValuesDo:[:idx :clr |
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1931
                        newColorMap at:idx put:clr
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1932
                    ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1933
                ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1934
                    "/ copy over those that are most often used.
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1935
                    oldImage depth < 8 ifTrue:[
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1936
                        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
  1937
                        oldImage bits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1938
                            expandPixels:(oldImage depth)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1939
                            width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1940
                            height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1941
                            into:tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1942
                            mapping:nil.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1943
                    ] ifFalse:[
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1944
                        oldImage depth == 8 ifTrue:[
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1945
                            tmpBits := oldImage bits
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1946
                        ] ifFalse:[
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1947
                            self warn:'Too many colors in image.'.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1948
                            ^ self
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  1949
                        ]
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1950
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1951
                    usageCounts := tmpBits usageCounts.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1952
                    tmpMap := Array new:usageCounts size.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1953
                    oldImage colorMap asArray keysAndValuesDo:[:i :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1954
                        tmpMap at:i put:clr
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1955
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1956
                    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
  1957
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1958
                    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
  1959
                        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
  1960
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1961
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1962
                    useNearest := Dialog 
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1963
                                        confirmWithCancel:(resources 
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1964
                                                              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
  1965
                                                              with:usedColors size
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1966
                                                              with:(1 bitShift:depth)) withCRs
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1967
                                        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
  1968
                    useNearest isNil ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1969
                        ^ self   "/ cancel
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1970
                    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1971
                ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1972
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1973
        ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1974
            "/ standard colormap
921
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1975
            usedColors := oldImage usedColors.
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1976
            (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
  1977
                useNearest := Dialog 
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1978
                                    confirmWithCancel:(resources 
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1979
                                                           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
  1980
                                                       ) withCRs
928
89bd2304da33 cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
  1981
                                    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
  1982
                useNearest isNil ifTrue:[
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1983
                    ^ self   "/ cancel
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1984
                ].
a5aca21ea803 also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents: 920
diff changeset
  1985
            ].
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1986
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1987
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1988
        imageEditView makeUndo.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1989
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1990
        newImage    := (Image implementorForDepth: depth) new.  
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1991
        oldFileName := oldImage fileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1992
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1993
        Image imageErrorSignal handle:[:ex|
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1994
            Color colorErrorSignal handle:[:ex|
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1995
                imageEditView undo.
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1996
                ^ self warn:(resources string:'Conversion failed !!')
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  1997
            ] do:[
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1998
                newImage := (Image implementorForDepth: depth) new.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1999
                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
  2000
                newImage colorMap:newColorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2001
                newImage photometric:#palette.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2002
                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
  2003
            
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2004
                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
  2005
                [:x :y :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2006
                    |newColor|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2007
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2008
                    (newColorMap includes:clr)
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2009
                        ifTrue: [newColor := clr]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2010
                        ifFalse: [
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2011
                            newColor := clr nearestIn:newColorMap.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2012
                            useNearest ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2013
                                (newColor deltaFrom:clr) > 0.5 ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2014
                                    newColor := oldImage colorFromValue:0
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2015
                                ]
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2016
                            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2017
                        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2018
                    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
  2019
                ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2020
                image := newImage
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2021
            ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2022
        ] do:[ 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2023
            image := newImage fromImage:oldImage
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2024
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2025
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2026
        (aMode asString endsWith:'mask') ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2027
            image mask isNil ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2028
                (self confirm:'Generate mask from black ?') ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2029
                    maskThreshold := 0.1.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2030
                    maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2031
                ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2032
                    maskImage := Depth1Image extent:image extent.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2033
                    maskImage data:(ByteArray 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2034
                                        new:(maskImage bytesPerRow * maskImage height)
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2035
                                        withAll:16rFF).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2036
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2037
"/                    maskImage fillRectangle:(image bounds) withColor:(Color colorId:1).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2038
                ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2039
                image mask:maskImage.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2040
            ].
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2041
        ] ifFalse:[ 
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2042
            image mask: nil.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2043
        ]. 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2044
        realColorMap := OrderedCollection new.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2045
        image realColorMap do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2046
        [:clr|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2047
            (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
  2048
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2049
        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
  2050
        newColorMap do:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2051
        [:clr|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2052
            ((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
  2053
            ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2054
            [      
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2055
                newColors add: clr
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2056
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2057
        ].                  
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2058
        image colorMap: newColors.   
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2059
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2060
        (imageEditView image: image) notNil ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2061
        [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2062
            image fileName: oldFileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2063
            self listOfColors contents: image colorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2064
            self findColorMapMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2065
            self updateLabelsAndHistory.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2066
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2067
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2068
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2069
    "Modified: / 30.9.1998 / 23:44:19 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2070
!
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2071
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2072
compressColorMap
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2073
    "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
  2074
927
74a71f2c5ef8 obsolete locals removed
tz
parents: 926
diff changeset
  2075
    |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
  2076
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2077
    oldImage := self image.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2078
    depth := oldImage depth.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2079
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2080
    oldImage photometric ~~ #palette ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2081
        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
  2082
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2083
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2084
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2085
    usedColors := oldImage usedColors.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2086
    usedColors size == (1 bitShift:depth) ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2087
        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
  2088
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2089
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2090
    usedColors size == oldImage colorMap size ifTrue:[
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2091
        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
  2092
        ^ self
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2093
    ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2094
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2095
    imageEditView makeUndo.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2096
930
4cf126b710b3 handle errors when grabbing
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  2097
    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
  2098
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2099
    self withExecuteCursorDo:[
996
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2100
"/        newColorMap := Array new:usedColors size.
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2101
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2102
        "/ translation table
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2103
        oldToNew := ByteArray new:(1 bitShift:depth).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2104
        newColorMap := usedColors asArray.
996
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2105
        newColorMap sort:[:a :b |
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2106
                                a redByte == b redByte ifTrue:[
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2107
                                    a greenByte == b greenByte ifTrue:[
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2108
                                        a blueByte < b blueByte
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2109
                                    ] ifFalse:[
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2110
                                        a greenByte < b greenByte 
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2111
                                    ]
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2112
                                ] ifFalse:[
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2113
                                    a redByte < b redByte 
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2114
                                ]
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2115
                          ].
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2116
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2117
        oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr |
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2118
            |newPixel|
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2119
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2120
            (usedColors includes:clr) ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2121
                newPixel := newColorMap indexOf:clr.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2122
                oldToNew at:oldIdx put:newPixel-1.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2123
            ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2124
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2125
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2126
        oldBits := oldImage bits.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2127
        newBits := ByteArray new:(oldBits size).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2128
        depth ~~ 8 ifTrue:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2129
            "/ expand/compress can only handle 8bits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2130
            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
  2131
            oldBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2132
                expandPixels:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2133
                width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2134
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2135
                into:tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2136
                mapping:oldToNew.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2137
            tmpBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2138
                compressPixels:depth 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2139
                width:oldImage width 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2140
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2141
                into:newBits 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2142
                mapping:nil
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2143
        ] ifFalse:[
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2144
            oldBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2145
                expandPixels:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2146
                width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2147
                height:oldImage height 
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2148
                into:newBits
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2149
                mapping:oldToNew.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2150
        ].
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2151
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2152
        newImage := oldImage species new
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2153
                        width:oldImage width
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2154
                        height:oldImage height
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2155
                        depth:depth
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2156
                        fromArray:newBits.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2157
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2158
        newImage colorMap:newColorMap.  
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2159
        newImage fileName:oldImage fileName.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2160
        newImage mask:(oldImage mask copy).
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2161
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2162
        (imageEditView image:newImage) notNil ifTrue:
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2163
        [
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2164
            self listOfColors contents: newImage colorMap.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2165
            self findColorMapMode.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2166
            self updateLabelsAndHistory.
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2167
        ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2168
    ]
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2169
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2170
    "Created: / 28.7.1998 / 20:03:11 / cg"
996
9423ae277168 sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents: 990
diff changeset
  2171
    "Modified: / 15.9.1998 / 17:53:32 / cg"
1008
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2172
!
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2173
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2174
sortColorMap
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2175
    "calculates a new color map for the image, sorting colors"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2176
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2177
    |depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2178
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2179
    oldImage := self image.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2180
    depth := oldImage depth.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2181
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2182
    oldImage photometric ~~ #palette ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2183
        self information:'Compress colorMap: Only palette images have colormaps.'.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2184
        ^ self
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2185
    ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2186
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2187
    usedColors := oldImage realColorMap.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2188
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2189
    imageEditView makeUndo.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2190
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2191
    self withExecuteCursorDo:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2192
"/        newColorMap := Array new:usedColors size.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2193
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2194
        "/ translation table
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2195
        oldToNew := ByteArray new:(1 bitShift:depth).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2196
        newColorMap := usedColors asArray.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2197
        newColorMap sort:[:a :b |
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2198
                                a redByte == b redByte ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2199
                                    a greenByte == b greenByte ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2200
                                        a blueByte < b blueByte
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2201
                                    ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2202
                                        a greenByte < b greenByte 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2203
                                    ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2204
                                ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2205
                                    a redByte < b redByte 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2206
                                ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2207
                          ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2208
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2209
        oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr |
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2210
            |newPixel|
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2211
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2212
            (usedColors includes:clr) ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2213
                newPixel := newColorMap indexOf:clr.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2214
                oldToNew at:oldIdx put:newPixel-1.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2215
            ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2216
        ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2217
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2218
        oldBits := oldImage bits.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2219
        newBits := ByteArray new:(oldBits size).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2220
        depth ~~ 8 ifTrue:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2221
            "/ expand/compress can only handle 8bits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2222
            tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2223
            oldBits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2224
                expandPixels:depth
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2225
                width:oldImage width
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2226
                height:oldImage height 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2227
                into:tmpBits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2228
                mapping:oldToNew.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2229
            tmpBits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2230
                compressPixels:depth 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2231
                width:oldImage width 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2232
                height:oldImage height 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2233
                into:newBits 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2234
                mapping:nil
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2235
        ] ifFalse:[
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2236
            oldBits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2237
                expandPixels:depth
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2238
                width:oldImage width
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2239
                height:oldImage height 
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2240
                into:newBits
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2241
                mapping:oldToNew.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2242
        ].
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2243
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2244
        newImage := oldImage species new
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2245
                        width:oldImage width
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2246
                        height:oldImage height
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2247
                        depth:depth
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2248
                        fromArray:newBits.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2249
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2250
        newImage colorMap:newColorMap.  
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2251
        newImage fileName:oldImage fileName.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2252
        newImage mask:(oldImage mask copy).
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2253
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2254
        (imageEditView image:newImage) notNil ifTrue:
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2255
        [
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2256
            self listOfColors contents: newImage colorMap.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2257
            self findColorMapMode.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2258
            self updateLabelsAndHistory.
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2259
        ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2260
    ]
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2261
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2262
    "Modified: / 15.9.1998 / 17:53:32 / cg"
327f93d57c7b fixed d24 -> d8 conversion;
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
  2263
    "Created: / 30.9.1998 / 23:51:23 / cg"
919
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2264
! !
4e50c3164625 more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  2265
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2266
!ImageEditor methodsFor:'user actions - editing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2267
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2268
doBrowseClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2269
    "opens a System Browser on the resourceClass and the resourceSelector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2270
933
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2271
    |cls|
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2272
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2273
    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
  2274
    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
  2275
    SystemBrowser 
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2276
        openInClass:cls class 
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2277
        selector:(imageEditView resourceSelector)
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2278
f090206aadff disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  2279
    "Modified: / 31.7.1998 / 02:01:15 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2280
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2281
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  2282
doChangeGridMagnification
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  2283
    "change grid magnification"
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  2284
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2285
    imageEditView changeGridMagnification
905
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  2286
!
5f5d0a415c04 grid magnification can be changed
tz
parents: 903
diff changeset
  2287
986
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2288
doCrobAll
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2289
    "find all borders and cut them off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2290
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2291
    imageEditView crobLeft:true right:true top:true bottom:true.   
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2292
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2293
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2294
    "Modified: / 7.9.1998 / 14:26:23 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2295
    "Created: / 7.9.1998 / 16:33:43 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2296
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2297
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2298
doCrobBottom
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2299
    "find a bottom border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2300
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2301
    imageEditView crobLeft:false right:false top:false bottom:true.   
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2302
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2303
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2304
    "Created: / 7.9.1998 / 13:00:20 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2305
    "Modified: / 7.9.1998 / 14:26:23 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2306
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2307
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2308
doCrobLeft
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2309
    "find a left border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2310
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2311
    imageEditView crobLeft:true right:false top:false bottom:false.   
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2312
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2313
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2314
    "Created: / 7.9.1998 / 13:00:14 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2315
    "Modified: / 7.9.1998 / 14:26:34 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2316
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2317
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2318
doCrobManual
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2319
    "let user specify borders and cut them off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2320
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2321
    |bindings left top right bottom|
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2322
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2323
    bindings := IdentityDictionary new.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2324
    bindings at:#left put:(left := 0 asValue).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2325
    bindings at:#right put:(right := 0 asValue).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2326
    bindings at:#top put:(top := 0 asValue).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2327
    bindings at:#bottom put:(bottom := 0 asValue).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2328
    (self openDialogInterface:#grobDialogSpec withBindings:bindings)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2329
    ifTrue:[
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2330
        left := left value.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2331
        right := right value.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2332
        top := top value.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2333
        bottom := bottom value.
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2334
        imageEditView
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2335
            makeSubImageX:left y:top 
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2336
            width:(imageEditView image width - left - right)
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2337
            height:(imageEditView image height - top - bottom).
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2338
        self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2339
    ].
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2340
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2341
    "Created: / 7.9.1998 / 18:16:07 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2342
    "Modified: / 7.9.1998 / 18:20:42 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2343
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2344
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2345
doCrobRight
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2346
    "find a right border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2347
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2348
    imageEditView crobLeft:false right:true top:false bottom:false.   
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2349
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2350
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2351
    "Created: / 7.9.1998 / 13:00:14 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2352
    "Modified: / 7.9.1998 / 14:26:44 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2353
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2354
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2355
doCrobTop
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2356
    "find a top border and cut it off"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2357
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2358
    imageEditView crobLeft:false right:false top:true bottom:false.   
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2359
    self updateInfoLabel
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2360
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2361
    "Created: / 7.9.1998 / 13:00:19 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2362
    "Modified: / 7.9.1998 / 14:26:52 / cg"
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2363
!
4361ba4dbbdc added crob operations.
Claus Gittinger <cg@exept.de>
parents: 982
diff changeset
  2364
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2365
doFlipHorizontal
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2366
    "flips horizontally current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2367
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2368
    imageEditView flipHorizontal
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2369
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2370
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2371
doFlipVertical
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2372
    "flips vertically current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2373
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2374
    imageEditView flipVertical
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2375
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2376
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2377
doMagnifyDown
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2378
    "magnifies current image one step down"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2379
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2380
    |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
  2381
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2382
    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
  2383
    (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
  2384
        magHolder value: mag - 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2385
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2386
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2387
    "Modified: / 26.7.1998 / 20:24:08 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2388
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2389
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2390
doMagnifyImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2391
    "magnifies current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2392
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2393
    imageEditView magnifyImage.   
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2394
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  2395
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2396
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2397
doMagnifyUp
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2398
    "magnifies current image one step up"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2399
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2400
    |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
  2401
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2402
    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
  2403
    (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
  2404
        magHolder value: mag + 1
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2405
    ]
915
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2406
99f8e19aab3a better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents: 914
diff changeset
  2407
    "Modified: / 26.7.1998 / 20:23:52 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2408
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2409
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2410
doNegativeImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2411
    "negates current image by negating the color map"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2412
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2413
    imageEditView negativeImage.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2414
    self listOfColors removeAll.
901
ce482227787d several undos
tz
parents: 900
diff changeset
  2415
    self findColorMapMode.     
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2416
    imageEditView undoImages removeLast
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2417
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2418
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2419
doResizeImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2420
    "resizes current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2421
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2422
    imageEditView resizeImage.   
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2423
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  2424
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2425
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2426
doRotateImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2427
    "rotates current image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2428
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2429
    imageEditView rotateImage.
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2430
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  2431
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2432
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2433
doUndo
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2434
    "reverses last edit action"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2435
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2436
    imageEditView undo
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2437
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2438
228524287573 intitial checkin
tz
parents:
diff changeset
  2439
!ImageEditor methodsFor:'user actions - loading'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2440
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2441
doLoadFromClass
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2442
    "opens a dialog for loading an image from class and a (resource-) selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2443
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2444
    (imageEditView loadFromClass) notNil
574
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2445
    ifTrue:
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2446
    [
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2447
        self image notNil
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2448
        ifTrue:
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2449
        [
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2450
            self listOfColors contents: self image usedColors asSet asOrderedCollection.
8d82e8f101c1 undo disabling
tz
parents: 573
diff changeset
  2451
            self findColorMapMode.
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2452
            self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2453
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2454
        ifFalse:
228524287573 intitial checkin
tz
parents:
diff changeset
  2455
        [
461
aed297a2d395 load errors removed
tz
parents: 460
diff changeset
  2456
            self updateForNoneImage
aed297a2d395 load errors removed
tz
parents: 460
diff changeset
  2457
        ]
449
dac8dc1f9dc8 if none image found for loading clear all
tz
parents: 444
diff changeset
  2458
    ]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2459
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2460
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2461
doLoadFromFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2462
    "opens a dialog for loading an image from a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2463
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2464
    self loadFromFile:
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2465
        (FileSelectionBrowser
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2466
            request: 'Load Image From'
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2467
            fileName: (self image notNil ifTrue: [self image fileName] ifFalse: [nil])
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2468
            withFileFilters: FileSelectionBrowser loadImageFileNameFilters)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2469
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2470
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2471
doNewImage
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2472
    "opens a dialog with choices of size and color map for creating a new image"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2473
228524287573 intitial checkin
tz
parents:
diff changeset
  2474
    |aspects|
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2475
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2476
    aspects  := IdentityDictionary new
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2477
        at:#listOfSizes         put: self class listOfDefaultSizes asValue;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2478
        at:#listOfColorMaps     put: self class listOfColorMaps keys asSortedCollection asValue;
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2479
        at:#selectionOfSize     put: self class listOfDefaultSizes first copy asValue;
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2480
        at:#selectionOfColorMap put: self class listOfColorMaps keys asSortedCollection first asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  2481
        yourself.
228524287573 intitial checkin
tz
parents:
diff changeset
  2482
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2483
    (self openDialogInterface:#dialogSpecForNewImage withBindings:aspects)
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2484
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2485
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  2486
        |width height cMap imageClass image|
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2487
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2488
        width  := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value upTo: $x) onError:[24]).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2489
        height := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value copy reverse upTo: $x) reverse onError:[24]).
228524287573 intitial checkin
tz
parents:
diff changeset
  2490
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2491
        cMap       := (self class listOfColorMaps at: (colorMapMode value: (aspects at:#selectionOfColorMap) value) value).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2492
        imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger).
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2493
        image      := imageClass width: width height: height fromArray: (ByteArray new: width*height).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2494
975
ede3746e0dea use radio buttons
tz
parents: 960
diff changeset
  2495
        (colorMapMode value endsWith: 'mask')
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2496
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2497
        [
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2498
            image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2499
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  2500
        image colorMap: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  2501
        image fillRectangleX:0 y:0 width:width height:height with:Color white.
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2502
        (imageEditView image: image) notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2503
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2504
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  2505
            self listOfColors contents: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  2506
            self findColorMapMode.
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2507
            self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2508
        ]
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2509
    ]
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2510
!
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2511
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2512
grabScreenImage
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2513
    "let user choose an area and grab that are for editing"
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2514
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2515
    Processor 
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2516
        addTimedBlock:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2517
            |image d8image img|
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2518
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2519
            image := Image fromUser.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2520
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2521
            image depth > 8 ifTrue:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2522
                Object errorSignal handle:[:ex |
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2523
                    ex signal == Object haltSignal ifTrue:[ex reject].
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2524
                    ex signal == Signal noHandlerSignal ifTrue:[ex reject].
982
2dda94c7ff25 allow grabbing from depth>8 screens.
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2525
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2526
                    self warn:'Could not convert to depth8 image (too many colors)'.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2527
                    d8image := nil.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2528
                ] do:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2529
                    d8image := Depth8Image new.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2530
                    d8image fromImage:image.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2531
                ].
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2532
                d8image notNil ifTrue:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2533
                    image := d8image
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2534
                ]
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2535
            ].
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2536
            (imageEditView image:image) notNil ifTrue:[
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2537
                self listOfColors contents:(image colorMap).
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2538
                self findColorMapMode.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2539
                self updateLabelsAndHistory.
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2540
            ]
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2541
                      ] 
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2542
        afterSeconds:1
929
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2543
7be532d91b87 help spec.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2544
    "Created: / 29.7.1998 / 21:24:42 / cg"
990
4303f0064410 delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2545
    "Modified: / 10.9.1998 / 16:01:23 / cg"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2546
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2547
228524287573 intitial checkin
tz
parents:
diff changeset
  2548
!ImageEditor methodsFor:'user actions - saving'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2549
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2550
doPrint
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2551
    "prints current image on the current printer"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2552
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2553
    imageEditView print
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2554
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2555
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2556
doSaveImageFile
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2557
    "saves current image to current file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2558
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2559
    imageEditView save
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2560
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2561
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2562
doSaveImageFileAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2563
    "opens a dialog for saving current image to a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2564
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2565
    imageEditView saveImageFileAs.
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2566
    self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2567
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2568
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2569
doSaveImageMaskFileAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2570
    "opens a dialog for saving mask of current image to a file"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2571
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2572
    imageEditView saveImageMaskFileAs
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2573
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2574
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2575
doSaveMethod
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2576
    "saves current image on current class and selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2577
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2578
    imageEditView saveMethod notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2579
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2580
    [
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2581
        self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2582
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2583
!
228524287573 intitial checkin
tz
parents:
diff changeset
  2584
767
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2585
doSaveMethodAs
ed96f735dab1 comments added
tz
parents: 763
diff changeset
  2586
    "opens a dialog for saving current image on a class and a selector"
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2587
911
ec8db5b62352 unnecessary calls removed
tz
parents: 905
diff changeset
  2588
    imageEditView saveMethodAs notNil
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2589
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  2590
    [
694
88c7004cfb6c updateLabelsAndHistory
tz
parents: 688
diff changeset
  2591
        self updateLabelsAndHistory
400
228524287573 intitial checkin
tz
parents:
diff changeset
  2592
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  2593
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  2594
228524287573 intitial checkin
tz
parents:
diff changeset
  2595
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
  2596
228524287573 intitial checkin
tz
parents:
diff changeset
  2597
version
228524287573 intitial checkin
tz
parents:
diff changeset
  2598
    ^ '$Header$'
228524287573 intitial checkin
tz
parents:
diff changeset
  2599
! !