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