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