ImageEditor.st
author tz
Fri, 16 Jan 1998 15:03:04 +0100
changeset 407 578a7aaed19e
parent 405 8546da96ab11
child 415 f792d83774b3
permissions -rw-r--r--
totally revised version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
400
228524287573 intitial checkin
tz
parents:
diff changeset
     1
"
228524287573 intitial checkin
tz
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG / Thomas Zwick
228524287573 intitial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
228524287573 intitial checkin
tz
parents:
diff changeset
     4
228524287573 intitial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
228524287573 intitial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
     7
 inclusion of the above copyright notice. This software may not
400
228524287573 intitial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
     9
 other person. No title to or ownership of the software is
400
228524287573 intitial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
228524287573 intitial checkin
tz
parents:
diff changeset
    11
"
228524287573 intitial checkin
tz
parents:
diff changeset
    12
228524287573 intitial checkin
tz
parents:
diff changeset
    13
ToolApplicationModel subclass:#ImageEditor
228524287573 intitial checkin
tz
parents:
diff changeset
    14
	instanceVariableNames:'colorMapMode selectedColorIndex postOpenAction'
228524287573 intitial checkin
tz
parents:
diff changeset
    15
	classVariableNames:''
228524287573 intitial checkin
tz
parents:
diff changeset
    16
	poolDictionaries:''
228524287573 intitial checkin
tz
parents:
diff changeset
    17
	category:'Interface-Advanced-Tools'
228524287573 intitial checkin
tz
parents:
diff changeset
    18
!
228524287573 intitial checkin
tz
parents:
diff changeset
    19
228524287573 intitial checkin
tz
parents:
diff changeset
    20
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    21
228524287573 intitial checkin
tz
parents:
diff changeset
    22
copyright
228524287573 intitial checkin
tz
parents:
diff changeset
    23
"
228524287573 intitial checkin
tz
parents:
diff changeset
    24
 COPYRIGHT (c) 1997 by eXept Software AG / Thomas Zwick
228524287573 intitial checkin
tz
parents:
diff changeset
    25
              All Rights Reserved
228524287573 intitial checkin
tz
parents:
diff changeset
    26
228524287573 intitial checkin
tz
parents:
diff changeset
    27
 This software is furnished under a license and may be used
228524287573 intitial checkin
tz
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    29
 inclusion of the above copyright notice. This software may not
400
228524287573 intitial checkin
tz
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
    31
 other person. No title to or ownership of the software is
400
228524287573 intitial checkin
tz
parents:
diff changeset
    32
 hereby transferred.
228524287573 intitial checkin
tz
parents:
diff changeset
    33
"
228524287573 intitial checkin
tz
parents:
diff changeset
    34
!
228524287573 intitial checkin
tz
parents:
diff changeset
    35
228524287573 intitial checkin
tz
parents:
diff changeset
    36
documentation
228524287573 intitial checkin
tz
parents:
diff changeset
    37
"
228524287573 intitial checkin
tz
parents:
diff changeset
    38
    By the Image Editor you are able to create, design, modify or just inspect images.
228524287573 intitial checkin
tz
parents:
diff changeset
    39
228524287573 intitial checkin
tz
parents:
diff changeset
    40
    [start with:]
228524287573 intitial checkin
tz
parents:
diff changeset
    41
        ImageEditor open
228524287573 intitial checkin
tz
parents:
diff changeset
    42
        ImageEditor openOnClass:ImageEditor andSelector:#newImageIcon
228524287573 intitial checkin
tz
parents:
diff changeset
    43
228524287573 intitial checkin
tz
parents:
diff changeset
    44
    [see also:]
228524287573 intitial checkin
tz
parents:
diff changeset
    45
        ImageEditView Image
228524287573 intitial checkin
tz
parents:
diff changeset
    46
228524287573 intitial checkin
tz
parents:
diff changeset
    47
    [author:]
228524287573 intitial checkin
tz
parents:
diff changeset
    48
        Thomas Zwick
228524287573 intitial checkin
tz
parents:
diff changeset
    49
"
228524287573 intitial checkin
tz
parents:
diff changeset
    50
! !
228524287573 intitial checkin
tz
parents:
diff changeset
    51
228524287573 intitial checkin
tz
parents:
diff changeset
    52
!ImageEditor class methodsFor:'instance creation'!
228524287573 intitial checkin
tz
parents:
diff changeset
    53
228524287573 intitial checkin
tz
parents:
diff changeset
    54
openModalOnClass: aClass andSelector: aSelector
228524287573 intitial checkin
tz
parents:
diff changeset
    55
228524287573 intitial checkin
tz
parents:
diff changeset
    56
    "self openModalOnClass: self andSelector: #newImageIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
    57
228524287573 intitial checkin
tz
parents:
diff changeset
    58
    |imageEditor className resourceClassName resourceSelector|                          
228524287573 intitial checkin
tz
parents:
diff changeset
    59
    imageEditor := self new.
228524287573 intitial checkin
tz
parents:
diff changeset
    60
    aClass isClass ifTrue: [className := aClass name].
228524287573 intitial checkin
tz
parents:
diff changeset
    61
    aClass isString ifTrue: [className := aClass].      
228524287573 intitial checkin
tz
parents:
diff changeset
    62
228524287573 intitial checkin
tz
parents:
diff changeset
    63
    imageEditor postOpenAction: [imageEditor loadFromMessage: className printString, ' ', aSelector].
228524287573 intitial checkin
tz
parents:
diff changeset
    64
    imageEditor openModal.
228524287573 intitial checkin
tz
parents:
diff changeset
    65
228524287573 intitial checkin
tz
parents:
diff changeset
    66
    resourceClassName := imageEditor valueOfResourceClass value.
228524287573 intitial checkin
tz
parents:
diff changeset
    67
    resourceSelector := imageEditor valueOfResourceSelector value.
228524287573 intitial checkin
tz
parents:
diff changeset
    68
    ^resourceClassName, ' ', resourceSelector
228524287573 intitial checkin
tz
parents:
diff changeset
    69
!
228524287573 intitial checkin
tz
parents:
diff changeset
    70
228524287573 intitial checkin
tz
parents:
diff changeset
    71
openOnClass: aClass andSelector: aSelector
228524287573 intitial checkin
tz
parents:
diff changeset
    72
228524287573 intitial checkin
tz
parents:
diff changeset
    73
    "self openOnClass: self andSelector: #newImageIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
    74
228524287573 intitial checkin
tz
parents:
diff changeset
    75
    ^self open loadFromMessage: aClass name, ' ', aSelector
228524287573 intitial checkin
tz
parents:
diff changeset
    76
!
228524287573 intitial checkin
tz
parents:
diff changeset
    77
228524287573 intitial checkin
tz
parents:
diff changeset
    78
openOnFile: image
228524287573 intitial checkin
tz
parents:
diff changeset
    79
228524287573 intitial checkin
tz
parents:
diff changeset
    80
    "self openOnFile: 'bitmaps/SmalltalkX.xbm'"
228524287573 intitial checkin
tz
parents:
diff changeset
    81
228524287573 intitial checkin
tz
parents:
diff changeset
    82
    ^self open loadFromFile: image
228524287573 intitial checkin
tz
parents:
diff changeset
    83
!
228524287573 intitial checkin
tz
parents:
diff changeset
    84
228524287573 intitial checkin
tz
parents:
diff changeset
    85
openOnImage: image
228524287573 intitial checkin
tz
parents:
diff changeset
    86
228524287573 intitial checkin
tz
parents:
diff changeset
    87
    "self openOnImage: self stxIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
    88
228524287573 intitial checkin
tz
parents:
diff changeset
    89
    ^self open loadFromImage: image
228524287573 intitial checkin
tz
parents:
diff changeset
    90
! !
228524287573 intitial checkin
tz
parents:
diff changeset
    91
228524287573 intitial checkin
tz
parents:
diff changeset
    92
!ImageEditor class methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
    93
228524287573 intitial checkin
tz
parents:
diff changeset
    94
listOfColorMaps
228524287573 intitial checkin
tz
parents:
diff changeset
    95
228524287573 intitial checkin
tz
parents:
diff changeset
    96
    |colorMap|
228524287573 intitial checkin
tz
parents:
diff changeset
    97
    (colorMap := OrderedCollection new)
228524287573 intitial checkin
tz
parents:
diff changeset
    98
        add: Color black;
228524287573 intitial checkin
tz
parents:
diff changeset
    99
        add: Color white;
228524287573 intitial checkin
tz
parents:
diff changeset
   100
        add: Color red;
228524287573 intitial checkin
tz
parents:
diff changeset
   101
        add: Color green;
228524287573 intitial checkin
tz
parents:
diff changeset
   102
        add: Color blue;
228524287573 intitial checkin
tz
parents:
diff changeset
   103
        add: Color cyan;
228524287573 intitial checkin
tz
parents:
diff changeset
   104
        add: Color yellow;
228524287573 intitial checkin
tz
parents:
diff changeset
   105
        add: Color magenta;
228524287573 intitial checkin
tz
parents:
diff changeset
   106
        add: (Color red: 50 green: 0 blue: 0);
228524287573 intitial checkin
tz
parents:
diff changeset
   107
        add: (Color red: 0 green: 50 blue: 0);
228524287573 intitial checkin
tz
parents:
diff changeset
   108
        add: (Color red: 0 green: 0 blue: 50);
228524287573 intitial checkin
tz
parents:
diff changeset
   109
        add: (Color red: 0 green: 50 blue: 50);
228524287573 intitial checkin
tz
parents:
diff changeset
   110
        add: (Color red: 50 green: 50 blue: 0);
228524287573 intitial checkin
tz
parents:
diff changeset
   111
        add: (Color red: 50 green: 0 blue: 50);
228524287573 intitial checkin
tz
parents:
diff changeset
   112
        add: Color gray;
228524287573 intitial checkin
tz
parents:
diff changeset
   113
        add: Color lightGray.                                
228524287573 intitial checkin
tz
parents:
diff changeset
   114
    0 to: 5 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   115
    [:r|                                                    
228524287573 intitial checkin
tz
parents:
diff changeset
   116
        0 to: 5 do:         
228524287573 intitial checkin
tz
parents:
diff changeset
   117
        [:g|
228524287573 intitial checkin
tz
parents:
diff changeset
   118
            0 to: 5 do:                             
228524287573 intitial checkin
tz
parents:
diff changeset
   119
            [:b|
228524287573 intitial checkin
tz
parents:
diff changeset
   120
                colorMap add: (Color red: (r*100//5) ceiling green: (g*100//5) ceiling blue: (b*100//5) ceiling)
228524287573 intitial checkin
tz
parents:
diff changeset
   121
            ]
228524287573 intitial checkin
tz
parents:
diff changeset
   122
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
   123
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
   124
228524287573 intitial checkin
tz
parents:
diff changeset
   125
    1 to: 25 do:
228524287573 intitial checkin
tz
parents:
diff changeset
   126
    [:g|                             
228524287573 intitial checkin
tz
parents:
diff changeset
   127
        colorMap add: (Color gray: (g*100//26) ceiling)
228524287573 intitial checkin
tz
parents:
diff changeset
   128
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
   129
228524287573 intitial checkin
tz
parents:
diff changeset
   130
    ^Dictionary new
228524287573 intitial checkin
tz
parents:
diff changeset
   131
        at: '8-plane' put: colorMap;
228524287573 intitial checkin
tz
parents:
diff changeset
   132
        at: '8-plane + mask' put: colorMap;
228524287573 intitial checkin
tz
parents:
diff changeset
   133
        at: '4-plane' put: (colorMap copyFrom: 1 to: 16);
228524287573 intitial checkin
tz
parents:
diff changeset
   134
        at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16);
228524287573 intitial checkin
tz
parents:
diff changeset
   135
        at: '2-plane' put: (colorMap copyFrom: 1 to: 4);
228524287573 intitial checkin
tz
parents:
diff changeset
   136
        at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4);
228524287573 intitial checkin
tz
parents:
diff changeset
   137
        at: '1-plane' put: (colorMap copyFrom: 1 to: 2);
228524287573 intitial checkin
tz
parents:
diff changeset
   138
        at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2);
228524287573 intitial checkin
tz
parents:
diff changeset
   139
        yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   140
!
228524287573 intitial checkin
tz
parents:
diff changeset
   141
228524287573 intitial checkin
tz
parents:
diff changeset
   142
listOfDefaultSizes
228524287573 intitial checkin
tz
parents:
diff changeset
   143
228524287573 intitial checkin
tz
parents:
diff changeset
   144
    ^#('24x24' '16x16' '32x32')
228524287573 intitial checkin
tz
parents:
diff changeset
   145
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   146
228524287573 intitial checkin
tz
parents:
diff changeset
   147
!ImageEditor class methodsFor:'interface specs'!
228524287573 intitial checkin
tz
parents:
diff changeset
   148
228524287573 intitial checkin
tz
parents:
diff changeset
   149
menu
228524287573 intitial checkin
tz
parents:
diff changeset
   150
    "this window spec was automatically generated by the ST/X MenuEditor"
228524287573 intitial checkin
tz
parents:
diff changeset
   151
228524287573 intitial checkin
tz
parents:
diff changeset
   152
    "do not manually edit this - the builder may not be able to
228524287573 intitial checkin
tz
parents:
diff changeset
   153
     handle the specification if its corrupted."
228524287573 intitial checkin
tz
parents:
diff changeset
   154
228524287573 intitial checkin
tz
parents:
diff changeset
   155
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   156
     MenuEditor new openOnClass:ImageEditor andSelector:#menu
228524287573 intitial checkin
tz
parents:
diff changeset
   157
     (Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
   158
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   159
228524287573 intitial checkin
tz
parents:
diff changeset
   160
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
   161
228524287573 intitial checkin
tz
parents:
diff changeset
   162
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   163
     
228524287573 intitial checkin
tz
parents:
diff changeset
   164
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   165
          
228524287573 intitial checkin
tz
parents:
diff changeset
   166
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
   167
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   168
                #'label:' 'About'
228524287573 intitial checkin
tz
parents:
diff changeset
   169
                #'labelImage:' #(#ResourceRetriever #ImageEditor #icon)
228524287573 intitial checkin
tz
parents:
diff changeset
   170
                #'submenuChannel:' #menuAbout
228524287573 intitial checkin
tz
parents:
diff changeset
   171
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   172
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   173
                #'label:' 'File'
228524287573 intitial checkin
tz
parents:
diff changeset
   174
                #'translateLabel:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   175
                #'submenu:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   176
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   177
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   178
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   179
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   180
                          #'label:' 'New...'
228524287573 intitial checkin
tz
parents:
diff changeset
   181
                          #'value:' #newImage
228524287573 intitial checkin
tz
parents:
diff changeset
   182
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   183
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   184
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   185
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   186
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   187
                          #'label:' 'Load From File...'
228524287573 intitial checkin
tz
parents:
diff changeset
   188
                          #'value:' #loadFromFile
228524287573 intitial checkin
tz
parents:
diff changeset
   189
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   190
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   191
                          #'label:' 'Load From Class...'
228524287573 intitial checkin
tz
parents:
diff changeset
   192
                          #'value:' #loadFromClass
228524287573 intitial checkin
tz
parents:
diff changeset
   193
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   194
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   195
                          #'label:' 'Load From Class With Superclass...'
228524287573 intitial checkin
tz
parents:
diff changeset
   196
                          #'translateLabel:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   197
                          #'value:' #loadFromClassWithSuperclass
228524287573 intitial checkin
tz
parents:
diff changeset
   198
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   199
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   200
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   201
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   202
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   203
                          #'label:' 'Save'
228524287573 intitial checkin
tz
parents:
diff changeset
   204
                          #'value:' #saveImageFile
228524287573 intitial checkin
tz
parents:
diff changeset
   205
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   206
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   207
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   208
                          #'label:' 'Save As...'
228524287573 intitial checkin
tz
parents:
diff changeset
   209
                          #'value:' #saveImageFileAs
228524287573 intitial checkin
tz
parents:
diff changeset
   210
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   211
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   212
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   213
                          #'label:' 'Save Mask As...'
228524287573 intitial checkin
tz
parents:
diff changeset
   214
                          #'value:' #saveImageMaskFileAs
228524287573 intitial checkin
tz
parents:
diff changeset
   215
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   216
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   217
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   218
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   219
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   220
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   221
                          #'label:' 'Save Method'
228524287573 intitial checkin
tz
parents:
diff changeset
   222
                          #'value:' #saveMethod
228524287573 intitial checkin
tz
parents:
diff changeset
   223
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   224
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   225
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   226
                          #'label:' 'Save Method As...'
228524287573 intitial checkin
tz
parents:
diff changeset
   227
                          #'value:' #saveMethodAs
228524287573 intitial checkin
tz
parents:
diff changeset
   228
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   229
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   230
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   231
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   232
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   233
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   234
                          #'label:' 'Print'
228524287573 intitial checkin
tz
parents:
diff changeset
   235
                          #'value:' #print
228524287573 intitial checkin
tz
parents:
diff changeset
   236
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   237
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   238
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   239
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   240
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   241
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   242
                          #'label:' 'Browse Class'
228524287573 intitial checkin
tz
parents:
diff changeset
   243
                          #'value:' #browseClass
228524287573 intitial checkin
tz
parents:
diff changeset
   244
                          #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   245
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   246
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   247
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   248
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   249
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   250
                          #'label:' 'Exit'
228524287573 intitial checkin
tz
parents:
diff changeset
   251
                          #'translateLabel:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   252
                          #'value:' #closeRequest
228524287573 intitial checkin
tz
parents:
diff changeset
   253
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   254
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   255
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   256
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   257
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   258
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   259
                #'label:' 'Edit'
228524287573 intitial checkin
tz
parents:
diff changeset
   260
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   261
                #'submenu:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   262
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   263
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   264
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   265
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   266
                          #'label:' 'Undo'
228524287573 intitial checkin
tz
parents:
diff changeset
   267
                          #'value:' #undo
228524287573 intitial checkin
tz
parents:
diff changeset
   268
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   269
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   270
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   271
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   272
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   273
                          #'label:' 'Flip - Vertical'
228524287573 intitial checkin
tz
parents:
diff changeset
   274
                          #'value:' #flipVertical
228524287573 intitial checkin
tz
parents:
diff changeset
   275
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   276
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   277
                          #'label:' 'Flip - Horizontal'
228524287573 intitial checkin
tz
parents:
diff changeset
   278
                          #'value:' #flipHorizontal
228524287573 intitial checkin
tz
parents:
diff changeset
   279
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   280
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   281
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   282
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   283
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   284
                          #'label:' 'Resize...'
228524287573 intitial checkin
tz
parents:
diff changeset
   285
                          #'value:' #resizeImage
228524287573 intitial checkin
tz
parents:
diff changeset
   286
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   287
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   288
                          #'label:' 'Magnify...'
228524287573 intitial checkin
tz
parents:
diff changeset
   289
                          #'value:' #magnifyImage
228524287573 intitial checkin
tz
parents:
diff changeset
   290
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   291
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   292
                          #'label:' 'Rotate...'
228524287573 intitial checkin
tz
parents:
diff changeset
   293
                          #'value:' #rotateImage
228524287573 intitial checkin
tz
parents:
diff changeset
   294
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   295
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   296
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   297
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   298
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   299
                          #'label:' 'Negative'
228524287573 intitial checkin
tz
parents:
diff changeset
   300
                          #'value:' #negativeImage
228524287573 intitial checkin
tz
parents:
diff changeset
   301
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   302
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   303
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   304
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   305
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   306
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   307
                #'label:' 'Color Map'
228524287573 intitial checkin
tz
parents:
diff changeset
   308
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   309
                #'submenu:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   310
                 #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   311
                    
228524287573 intitial checkin
tz
parents:
diff changeset
   312
                     #(
228524287573 intitial checkin
tz
parents:
diff changeset
   313
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   314
                          #'label:' '8-Plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   315
                          #'argument:' '8-plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   316
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   317
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   318
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   319
                          #'label:' '4-Plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   320
                          #'argument:' '4-plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   321
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   322
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   323
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   324
                          #'label:' '2-Plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   325
                          #'argument:' '2-plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   326
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   327
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   328
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   329
                          #'label:' '1-Plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   330
                          #'argument:' '1-plane'
228524287573 intitial checkin
tz
parents:
diff changeset
   331
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   332
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   333
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   334
                          #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   335
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   336
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   337
                          #'label:' '8-Plane + Mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   338
                          #'argument:' '8-plane + mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   339
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   340
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   341
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   342
                          #'label:' '4-Plane + Mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   343
                          #'argument:' '4-plane + mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   344
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   345
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   346
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   347
                          #'label:' '2-Plane + Mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   348
                          #'argument:' '2-plane + mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   349
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   350
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   351
                       #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   352
                          #'label:' '1-Plane + Mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   353
                          #'argument:' '1-plane + mask'
228524287573 intitial checkin
tz
parents:
diff changeset
   354
                          #'indication:' #'colorMapMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   355
                      )
228524287573 intitial checkin
tz
parents:
diff changeset
   356
                    ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   357
                    nil
228524287573 intitial checkin
tz
parents:
diff changeset
   358
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   359
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   360
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   361
                #'label:' 'History'
228524287573 intitial checkin
tz
parents:
diff changeset
   362
                #'submenuChannel:' #menuHistory
228524287573 intitial checkin
tz
parents:
diff changeset
   363
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   364
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   365
                #'label:' 'Help'
228524287573 intitial checkin
tz
parents:
diff changeset
   366
                #'submenuChannel:' #menuHelp
228524287573 intitial checkin
tz
parents:
diff changeset
   367
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   368
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   369
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
   370
      )
228524287573 intitial checkin
tz
parents:
diff changeset
   371
!
228524287573 intitial checkin
tz
parents:
diff changeset
   372
228524287573 intitial checkin
tz
parents:
diff changeset
   373
menuColorAssignment
228524287573 intitial checkin
tz
parents:
diff changeset
   374
    "this window spec was automatically generated by the ST/X MenuEditor"
228524287573 intitial checkin
tz
parents:
diff changeset
   375
228524287573 intitial checkin
tz
parents:
diff changeset
   376
    "do not manually edit this - the builder may not be able to
228524287573 intitial checkin
tz
parents:
diff changeset
   377
     handle the specification if its corrupted."
228524287573 intitial checkin
tz
parents:
diff changeset
   378
228524287573 intitial checkin
tz
parents:
diff changeset
   379
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   380
     MenuEditor new openOnClass:ImageEditor andSelector:#menuColorAssignment
228524287573 intitial checkin
tz
parents:
diff changeset
   381
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuColorAssignment)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
   382
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   383
228524287573 intitial checkin
tz
parents:
diff changeset
   384
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
   385
228524287573 intitial checkin
tz
parents:
diff changeset
   386
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   387
     
228524287573 intitial checkin
tz
parents:
diff changeset
   388
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   389
          
228524287573 intitial checkin
tz
parents:
diff changeset
   390
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
   391
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   392
                #'label:' 'left'
228524287573 intitial checkin
tz
parents:
diff changeset
   393
                #'nameKey:' #leftMouseKeyButton
228524287573 intitial checkin
tz
parents:
diff changeset
   394
                #'argument:' '1'
228524287573 intitial checkin
tz
parents:
diff changeset
   395
                #'labelImage:' #(#ResourceRetriever nil #leftMouseKeyIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   396
                #'indication:' #'mouseKeyColorMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   397
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   398
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   399
                #'label:' 'right'
228524287573 intitial checkin
tz
parents:
diff changeset
   400
                #'nameKey:' #rightMouseKeyButton
228524287573 intitial checkin
tz
parents:
diff changeset
   401
                #'argument:' '2'
228524287573 intitial checkin
tz
parents:
diff changeset
   402
                #'labelImage:' #(#ResourceRetriever nil #rightMouseKeyIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   403
                #'indication:' #'mouseKeyColorMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   404
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   405
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   406
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
   407
      )
228524287573 intitial checkin
tz
parents:
diff changeset
   408
!
228524287573 intitial checkin
tz
parents:
diff changeset
   409
228524287573 intitial checkin
tz
parents:
diff changeset
   410
menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
   411
    "this window spec was automatically generated by the ST/X MenuEditor"
228524287573 intitial checkin
tz
parents:
diff changeset
   412
228524287573 intitial checkin
tz
parents:
diff changeset
   413
    "do not manually edit this - the builder may not be able to
228524287573 intitial checkin
tz
parents:
diff changeset
   414
     handle the specification if its corrupted."
228524287573 intitial checkin
tz
parents:
diff changeset
   415
228524287573 intitial checkin
tz
parents:
diff changeset
   416
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   417
     MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
   418
     (Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp
228524287573 intitial checkin
tz
parents:
diff changeset
   419
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   420
228524287573 intitial checkin
tz
parents:
diff changeset
   421
    <resource: #menu>
228524287573 intitial checkin
tz
parents:
diff changeset
   422
228524287573 intitial checkin
tz
parents:
diff changeset
   423
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   424
     
228524287573 intitial checkin
tz
parents:
diff changeset
   425
       #(#Menu
228524287573 intitial checkin
tz
parents:
diff changeset
   426
          
228524287573 intitial checkin
tz
parents:
diff changeset
   427
           #(
228524287573 intitial checkin
tz
parents:
diff changeset
   428
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   429
                #'label:' 'newImage'
228524287573 intitial checkin
tz
parents:
diff changeset
   430
                #'isButton:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   431
                #'value:' #newImage
228524287573 intitial checkin
tz
parents:
diff changeset
   432
                #'labelImage:' #(#ResourceRetriever nil #newImageIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   433
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   434
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   435
                #'label:' 'loadFromClass'
228524287573 intitial checkin
tz
parents:
diff changeset
   436
                #'isButton:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   437
                #'value:' #loadFromClass
228524287573 intitial checkin
tz
parents:
diff changeset
   438
                #'labelImage:' #(#ResourceRetriever nil #loadFromClassIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   439
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   440
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   441
                #'label:' 'loadFromFile'
228524287573 intitial checkin
tz
parents:
diff changeset
   442
                #'isButton:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   443
                #'value:' #loadFromFile
228524287573 intitial checkin
tz
parents:
diff changeset
   444
                #'labelImage:' #(#ResourceRetriever nil #loadFromFileIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   445
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   446
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   447
                #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   448
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   449
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   450
                #'label:' 'saveMethod'
228524287573 intitial checkin
tz
parents:
diff changeset
   451
                #'isButton:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   452
                #'value:' #saveMethod
228524287573 intitial checkin
tz
parents:
diff changeset
   453
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   454
                #'labelImage:' #(#ResourceRetriever nil #saveAsMethodIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   455
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   456
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   457
                #'label:' 'saveFile'
228524287573 intitial checkin
tz
parents:
diff changeset
   458
                #'isButton:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   459
                #'value:' #saveImageFile
228524287573 intitial checkin
tz
parents:
diff changeset
   460
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   461
                #'labelImage:' #(#ResourceRetriever nil #saveIcon)
228524287573 intitial checkin
tz
parents:
diff changeset
   462
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   463
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   464
                #'label:' '-'
228524287573 intitial checkin
tz
parents:
diff changeset
   465
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   466
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   467
                #'label:' 'Point'
228524287573 intitial checkin
tz
parents:
diff changeset
   468
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   469
                #'argument:' 'point'
228524287573 intitial checkin
tz
parents:
diff changeset
   470
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   471
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   472
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   473
                #'label:' 'Box'
228524287573 intitial checkin
tz
parents:
diff changeset
   474
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   475
                #'argument:' 'box'
228524287573 intitial checkin
tz
parents:
diff changeset
   476
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   477
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   478
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   479
                #'label:' 'Filled Box'
228524287573 intitial checkin
tz
parents:
diff changeset
   480
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   481
                #'argument:' 'filledBox'
228524287573 intitial checkin
tz
parents:
diff changeset
   482
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   483
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   484
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   485
                #'label:' 'Fill'
228524287573 intitial checkin
tz
parents:
diff changeset
   486
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   487
                #'argument:' 'fill'
228524287573 intitial checkin
tz
parents:
diff changeset
   488
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   489
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   490
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   491
                #'label:' 'Copy'
228524287573 intitial checkin
tz
parents:
diff changeset
   492
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   493
                #'argument:' 'copy'
228524287573 intitial checkin
tz
parents:
diff changeset
   494
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   495
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   496
             #(#MenuItem
228524287573 intitial checkin
tz
parents:
diff changeset
   497
                #'label:' 'Paste'
228524287573 intitial checkin
tz
parents:
diff changeset
   498
                #'enabled:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   499
                #'argument:' 'paste'
228524287573 intitial checkin
tz
parents:
diff changeset
   500
                #'indication:' #'editMode:value:'
228524287573 intitial checkin
tz
parents:
diff changeset
   501
            )
228524287573 intitial checkin
tz
parents:
diff changeset
   502
          ) nil
228524287573 intitial checkin
tz
parents:
diff changeset
   503
          nil
228524287573 intitial checkin
tz
parents:
diff changeset
   504
      )
228524287573 intitial checkin
tz
parents:
diff changeset
   505
!
228524287573 intitial checkin
tz
parents:
diff changeset
   506
228524287573 intitial checkin
tz
parents:
diff changeset
   507
windowSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   508
    "this window spec was automatically generated by the ST/X UIPainter"
228524287573 intitial checkin
tz
parents:
diff changeset
   509
228524287573 intitial checkin
tz
parents:
diff changeset
   510
    "do not manually edit this - the painter/builder may not be able to
228524287573 intitial checkin
tz
parents:
diff changeset
   511
     handle the specification if its corrupted."
228524287573 intitial checkin
tz
parents:
diff changeset
   512
228524287573 intitial checkin
tz
parents:
diff changeset
   513
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   514
     UIPainter new openOnClass:ImageEditor andSelector:#windowSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   515
     ImageEditor new openInterface:#windowSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   516
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   517
    "ImageEditor open"
228524287573 intitial checkin
tz
parents:
diff changeset
   518
228524287573 intitial checkin
tz
parents:
diff changeset
   519
    <resource: #canvas>
228524287573 intitial checkin
tz
parents:
diff changeset
   520
228524287573 intitial checkin
tz
parents:
diff changeset
   521
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   522
     
228524287573 intitial checkin
tz
parents:
diff changeset
   523
       #(#FullSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   524
          #'window:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   525
           #(#WindowSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   526
              #'name:' 'Image Editor'
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   527
              #'layout:' #(#LayoutFrame 368 0 254 0 867 0 599 0)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   528
              #'label:' 'Image Editor'
228524287573 intitial checkin
tz
parents:
diff changeset
   529
              #'min:' #(#Point 400 320)
228524287573 intitial checkin
tz
parents:
diff changeset
   530
              #'max:' #(#Point 1152 900)
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   531
              #'bounds:' #(#Rectangle 368 254 868 600)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   532
              #'menu:' #menu
228524287573 intitial checkin
tz
parents:
diff changeset
   533
              #'usePreferredExtent:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   534
          )
228524287573 intitial checkin
tz
parents:
diff changeset
   535
          #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   536
           #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   537
              #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   538
               #(
228524287573 intitial checkin
tz
parents:
diff changeset
   539
                 #(#MenuPanelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   540
                    #'name:' 'menuToolbarView'
228524287573 intitial checkin
tz
parents:
diff changeset
   541
                    #'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 34 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   542
                    #'menu:' #menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
   543
                    #'style:' #(#FontDescription #helvetica #medium #roman 10)
228524287573 intitial checkin
tz
parents:
diff changeset
   544
                    #'showSeparatingLines:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   545
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   546
                 #(#VariableHorizontalPanelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   547
                    #'name:' 'variableHorizontalPanel1'
228524287573 intitial checkin
tz
parents:
diff changeset
   548
                    #'layout:' #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -22 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   549
                    #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   550
                     #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   551
                        #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   552
                         #(
228524287573 intitial checkin
tz
parents:
diff changeset
   553
                           #(#ViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   554
                              #'name:' 'view1'
228524287573 intitial checkin
tz
parents:
diff changeset
   555
                              #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   556
                               #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   557
                                  #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   558
                                   #(
228524287573 intitial checkin
tz
parents:
diff changeset
   559
                                     #(#FramedBoxSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   560
                                        #'name:' 'framedBox1'
228524287573 intitial checkin
tz
parents:
diff changeset
   561
                                        #'layout:' #(#LayoutFrame 1 0.0 3 0.0 110 0 65 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   562
                                        #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   563
                                         #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   564
                                            #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   565
                                             #(
228524287573 intitial checkin
tz
parents:
diff changeset
   566
                                               #(#ArrowButtonSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   567
                                                  #'name:' 'magnifyDownButton'
228524287573 intitial checkin
tz
parents:
diff changeset
   568
                                                  #'layout:' #(#LayoutFrame 13 0 20 0 35 0 42 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   569
                                                  #'model:' #magnifyDown
228524287573 intitial checkin
tz
parents:
diff changeset
   570
                                                  #'enableChannel:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   571
                                                  #'isTriggerOnDown:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   572
                                                  #'direction:' #left
228524287573 intitial checkin
tz
parents:
diff changeset
   573
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   574
                                               #(#ArrowButtonSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   575
                                                  #'name:' 'magnifyUpButton'
228524287573 intitial checkin
tz
parents:
diff changeset
   576
                                                  #'layout:' #(#LayoutFrame 73 0 20 0 95 0 42 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   577
                                                  #'model:' #magnifyUp
228524287573 intitial checkin
tz
parents:
diff changeset
   578
                                                  #'enableChannel:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   579
                                                  #'isTriggerOnDown:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   580
                                                  #'direction:' #right
228524287573 intitial checkin
tz
parents:
diff changeset
   581
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   582
                                               #(#InputFieldSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   583
                                                  #'name:' 'magnificationInputField'
228524287573 intitial checkin
tz
parents:
diff changeset
   584
                                                  #'layout:' #(#LayoutFrame 36 0 20 0.0 72 0 42 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   585
                                                  #'enableChannel:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   586
                                                  #'model:' #valueOfMagnification
228524287573 intitial checkin
tz
parents:
diff changeset
   587
                                                  #'type:' #number
228524287573 intitial checkin
tz
parents:
diff changeset
   588
                                                  #'acceptOnReturn:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   589
                                                  #'acceptOnTab:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   590
                                                  #'numChars:' 2
228524287573 intitial checkin
tz
parents:
diff changeset
   591
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   592
                                            )
228524287573 intitial checkin
tz
parents:
diff changeset
   593
                                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   594
                                        #'label:' 'Magnification'
228524287573 intitial checkin
tz
parents:
diff changeset
   595
                                        #'labelPosition:' #topLeft
228524287573 intitial checkin
tz
parents:
diff changeset
   596
                                        #'style:' #(#FontDescription #helvetica #medium #roman 12)
228524287573 intitial checkin
tz
parents:
diff changeset
   597
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   598
                                     #(#FramedBoxSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   599
                                        #'name:' 'framedBox2'
228524287573 intitial checkin
tz
parents:
diff changeset
   600
                                        #'layout:' #(#LayoutFrame 1 0.0 68 0 0 1.0 -66 1)
228524287573 intitial checkin
tz
parents:
diff changeset
   601
                                        #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   602
                                         #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   603
                                            #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   604
                                             #(
228524287573 intitial checkin
tz
parents:
diff changeset
   605
                                               #(#DataSetSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   606
                                                  #'name:' 'colorDataSetView'
228524287573 intitial checkin
tz
parents:
diff changeset
   607
                                                  #'layout:' #(#LayoutFrame 11 0.0 19 0.0 20 1.0 -10 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   608
                                                  #'model:' #selectionOfColor
228524287573 intitial checkin
tz
parents:
diff changeset
   609
                                                  #'style:' #(#FontDescription #helvetica #medium #roman 12)
228524287573 intitial checkin
tz
parents:
diff changeset
   610
                                                  #'hasHorizontalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   611
                                                  #'hasVerticalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   612
                                                  #'miniScrollerHorizontal:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   613
                                                  #'miniScrollerVertical:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   614
                                                  #'dataList:' #listOfColors
228524287573 intitial checkin
tz
parents:
diff changeset
   615
                                                  #'has3Dsepartors:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   616
                                                  #'verticalSpacing:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   617
                                                  #'columns:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   618
                                                   #(
228524287573 intitial checkin
tz
parents:
diff changeset
   619
                                                     #(#DataSetColumnSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   620
                                                        #'rendererType:' #rowSelector
228524287573 intitial checkin
tz
parents:
diff changeset
   621
                                                        #'backgroundSelector:' #yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   622
                                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   623
                                                     #(#DataSetColumnSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   624
                                                        #'label:' ' Red'
228524287573 intitial checkin
tz
parents:
diff changeset
   625
                                                        #'model:' #rowRedByte
228524287573 intitial checkin
tz
parents:
diff changeset
   626
                                                        #'canSelect:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   627
                                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   628
                                                     #(#DataSetColumnSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   629
                                                        #'label:' ' Green'
228524287573 intitial checkin
tz
parents:
diff changeset
   630
                                                        #'model:' #rowGreenByte
228524287573 intitial checkin
tz
parents:
diff changeset
   631
                                                        #'canSelect:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   632
                                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   633
                                                     #(#DataSetColumnSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   634
                                                        #'label:' ' Blue'
228524287573 intitial checkin
tz
parents:
diff changeset
   635
                                                        #'model:' #rowBlueByte
228524287573 intitial checkin
tz
parents:
diff changeset
   636
                                                        #'canSelect:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   637
                                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   638
                                                  )
228524287573 intitial checkin
tz
parents:
diff changeset
   639
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   640
                                               #(#MenuPanelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   641
                                                  #'name:' 'menuColorAssignmentPanel'
228524287573 intitial checkin
tz
parents:
diff changeset
   642
                                                  #'layout:' #(#LayoutFrame 11 0 -10 1 18 1 17 1)
228524287573 intitial checkin
tz
parents:
diff changeset
   643
                                                  #'enableChannel:' #imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   644
                                                  #'menu:' #menuColorAssignment
228524287573 intitial checkin
tz
parents:
diff changeset
   645
                                                  #'style:' #(#FontDescription #helvetica #medium #roman 10)
228524287573 intitial checkin
tz
parents:
diff changeset
   646
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   647
                                            )
228524287573 intitial checkin
tz
parents:
diff changeset
   648
                                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   649
                                        #'label:' 'Color Map'
228524287573 intitial checkin
tz
parents:
diff changeset
   650
                                        #'labelPosition:' #topLeft
228524287573 intitial checkin
tz
parents:
diff changeset
   651
                                        #'style:' #(#FontDescription #helvetica #medium #roman 12)
228524287573 intitial checkin
tz
parents:
diff changeset
   652
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   653
                                     #(#VerticalPanelViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   654
                                        #'name:' 'verticalPanelView1'
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   655
                                        #'layout:' #(#LayoutFrame 1 0.0 -68 1 83 0 0 1.0)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   656
                                        #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   657
                                         #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   658
                                            #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   659
                                             #(
228524287573 intitial checkin
tz
parents:
diff changeset
   660
                                               #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   661
                                                  #'name:' 'classNameLabel'
228524287573 intitial checkin
tz
parents:
diff changeset
   662
                                                  #'label:' 'Class:'
228524287573 intitial checkin
tz
parents:
diff changeset
   663
                                                  #'adjust:' #right
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   664
                                                  #'extent:' #(#Point 82 21)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   665
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   666
                                               #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   667
                                                  #'name:' 'selectorLabel'
228524287573 intitial checkin
tz
parents:
diff changeset
   668
                                                  #'label:' 'Selector:'
228524287573 intitial checkin
tz
parents:
diff changeset
   669
                                                  #'adjust:' #right
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   670
                                                  #'extent:' #(#Point 82 20)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   671
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   672
                                               #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   673
                                                  #'name:' 'fileNameLabel'
228524287573 intitial checkin
tz
parents:
diff changeset
   674
                                                  #'label:' 'File Name:'
228524287573 intitial checkin
tz
parents:
diff changeset
   675
                                                  #'adjust:' #right
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   676
                                                  #'extent:' #(#Point 82 21)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   677
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   678
                                            )
228524287573 intitial checkin
tz
parents:
diff changeset
   679
                                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   680
                                        #'horizontalLayout:' #fit
228524287573 intitial checkin
tz
parents:
diff changeset
   681
                                        #'verticalLayout:' #fit
228524287573 intitial checkin
tz
parents:
diff changeset
   682
                                        #'horizontalSpace:' 3
228524287573 intitial checkin
tz
parents:
diff changeset
   683
                                        #'verticalSpace:' 3
228524287573 intitial checkin
tz
parents:
diff changeset
   684
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   685
                                     #(#VerticalPanelViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   686
                                        #'name:' 'verticalPanelView2'
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   687
                                        #'layout:' #(#LayoutFrame 85 0.0 -68 1 -6 1 0 1.0)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   688
                                        #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   689
                                         #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   690
                                            #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   691
                                             #(
228524287573 intitial checkin
tz
parents:
diff changeset
   692
                                               #(#InputFieldSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   693
                                                  #'name:' 'resourceClassInputField'
228524287573 intitial checkin
tz
parents:
diff changeset
   694
                                                  #'activeHelpKey:' #classNameInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   695
                                                  #'model:' #valueOfResourceClass
228524287573 intitial checkin
tz
parents:
diff changeset
   696
                                                  #'immediateAccept:' false
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   697
                                                  #'extent:' #(#Point 129 21)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   698
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   699
                                               #(#InputFieldSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   700
                                                  #'name:' 'resourceSelectorInputField'
228524287573 intitial checkin
tz
parents:
diff changeset
   701
                                                  #'activeHelpKey:' #selectorInputFieldHelp
228524287573 intitial checkin
tz
parents:
diff changeset
   702
                                                  #'model:' #valueOfResourceSelector
228524287573 intitial checkin
tz
parents:
diff changeset
   703
                                                  #'immediateAccept:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   704
                                                  #'acceptOnTab:' false
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   705
                                                  #'extent:' #(#Point 129 20)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   706
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   707
                                               #(#InputFieldSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   708
                                                  #'name:' 'fileNameInputField'
228524287573 intitial checkin
tz
parents:
diff changeset
   709
                                                  #'activeHelpKey:' #fileNameInputFieldHelp
228524287573 intitial checkin
tz
parents:
diff changeset
   710
                                                  #'model:' #valueOfFileName
228524287573 intitial checkin
tz
parents:
diff changeset
   711
                                                  #'immediateAccept:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   712
                                                  #'acceptOnTab:' false
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   713
                                                  #'extent:' #(#Point 129 21)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   714
                                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   715
                                            )
228524287573 intitial checkin
tz
parents:
diff changeset
   716
                                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   717
                                        #'horizontalLayout:' #fit
228524287573 intitial checkin
tz
parents:
diff changeset
   718
                                        #'verticalLayout:' #fit
228524287573 intitial checkin
tz
parents:
diff changeset
   719
                                        #'horizontalSpace:' 3
228524287573 intitial checkin
tz
parents:
diff changeset
   720
                                        #'verticalSpace:' 3
228524287573 intitial checkin
tz
parents:
diff changeset
   721
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   722
                                     #(#ArbitraryComponentSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   723
                                        #'name:' 'imagePreView'
228524287573 intitial checkin
tz
parents:
diff changeset
   724
                                        #'layout:' #(#LayoutFrame 111 0.0 9 0.0 -6 1 60 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   725
                                        #'hasHorizontalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   726
                                        #'hasVerticalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   727
                                        #'miniScrollerHorizontal:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   728
                                        #'miniScrollerVertical:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   729
                                        #'component:' #ImageView
228524287573 intitial checkin
tz
parents:
diff changeset
   730
                                        #'hasBorder:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   731
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   732
                                  )
228524287573 intitial checkin
tz
parents:
diff changeset
   733
                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   734
                              #'level:' -1
228524287573 intitial checkin
tz
parents:
diff changeset
   735
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   736
                           #(#ViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   737
                              #'name:' 'view2'
228524287573 intitial checkin
tz
parents:
diff changeset
   738
                              #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   739
                               #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   740
                                  #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   741
                                   #(
228524287573 intitial checkin
tz
parents:
diff changeset
   742
                                     #(#ArbitraryComponentSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   743
                                        #'name:' 'imageEditView'
228524287573 intitial checkin
tz
parents:
diff changeset
   744
                                        #'layout:' #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 1 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   745
                                        #'hasHorizontalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   746
                                        #'hasVerticalScrollBar:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   747
                                        #'component:' #ImageEditView
228524287573 intitial checkin
tz
parents:
diff changeset
   748
                                        #'hasBorder:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   749
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   750
                                  )
228524287573 intitial checkin
tz
parents:
diff changeset
   751
                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   752
                              #'level:' -1
228524287573 intitial checkin
tz
parents:
diff changeset
   753
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   754
                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   755
                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   756
                    #'handles:' #(#Any 0.45082 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   757
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   758
                 #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   759
                    #'name:' 'infoLabel'
228524287573 intitial checkin
tz
parents:
diff changeset
   760
                    #'layout:' #(#LayoutFrame 0 0 -22 1 -170 1 0 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   761
                    #'labelChannel:' #valueOfInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
   762
                    #'level:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   763
                    #'adjust:' #left
228524287573 intitial checkin
tz
parents:
diff changeset
   764
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   765
                 #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   766
                    #'name:' 'timeLabel'
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   767
                    #'layout:' #(#LayoutFrame -80 1 -22 1 0 1.0 0 1.0)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   768
                    #'labelChannel:' #valueOfTimeLabel
228524287573 intitial checkin
tz
parents:
diff changeset
   769
                    #'level:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   770
                    #'adjust:' #right
228524287573 intitial checkin
tz
parents:
diff changeset
   771
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   772
                 #(#LabelSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   773
                    #'name:' 'coordLabel'
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
   774
                    #'layout:' #(#LayoutFrame -170 1 -22 1 -80 1 0 1.0)
400
228524287573 intitial checkin
tz
parents:
diff changeset
   775
                    #'labelChannel:' #valueOfCoordLabel
228524287573 intitial checkin
tz
parents:
diff changeset
   776
                    #'level:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   777
                    #'adjust:' #left
228524287573 intitial checkin
tz
parents:
diff changeset
   778
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   779
              )
228524287573 intitial checkin
tz
parents:
diff changeset
   780
          )
228524287573 intitial checkin
tz
parents:
diff changeset
   781
      )
228524287573 intitial checkin
tz
parents:
diff changeset
   782
!
228524287573 intitial checkin
tz
parents:
diff changeset
   783
228524287573 intitial checkin
tz
parents:
diff changeset
   784
windowSpecForNewImage
228524287573 intitial checkin
tz
parents:
diff changeset
   785
    "this window spec was automatically generated by the ST/X UIPainter"
228524287573 intitial checkin
tz
parents:
diff changeset
   786
228524287573 intitial checkin
tz
parents:
diff changeset
   787
    "do not manually edit this - the painter/builder may not be able to
228524287573 intitial checkin
tz
parents:
diff changeset
   788
     handle the specification if its corrupted."
228524287573 intitial checkin
tz
parents:
diff changeset
   789
228524287573 intitial checkin
tz
parents:
diff changeset
   790
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   791
     UIPainter new openOnClass:ImageEditor andSelector:#windowSpecForNewImage
228524287573 intitial checkin
tz
parents:
diff changeset
   792
     ImageEditor new openInterface:#windowSpecForNewImage
228524287573 intitial checkin
tz
parents:
diff changeset
   793
    "
228524287573 intitial checkin
tz
parents:
diff changeset
   794
228524287573 intitial checkin
tz
parents:
diff changeset
   795
    <resource: #canvas>
228524287573 intitial checkin
tz
parents:
diff changeset
   796
228524287573 intitial checkin
tz
parents:
diff changeset
   797
    ^
228524287573 intitial checkin
tz
parents:
diff changeset
   798
     
228524287573 intitial checkin
tz
parents:
diff changeset
   799
       #(#FullSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   800
          #'window:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   801
           #(#WindowSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   802
              #'name:' 'New Image'
228524287573 intitial checkin
tz
parents:
diff changeset
   803
              #'layout:' #(#LayoutFrame 194 0 152 0 461 0 248 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   804
              #'label:' 'New Image'
228524287573 intitial checkin
tz
parents:
diff changeset
   805
              #'min:' #(#Point 10 10)
228524287573 intitial checkin
tz
parents:
diff changeset
   806
              #'max:' #(#Point 1152 900)
228524287573 intitial checkin
tz
parents:
diff changeset
   807
              #'bounds:' #(#Rectangle 194 152 462 249)
228524287573 intitial checkin
tz
parents:
diff changeset
   808
              #'usePreferredExtent:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   809
          )
228524287573 intitial checkin
tz
parents:
diff changeset
   810
          #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   811
           #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   812
              #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   813
               #(
228524287573 intitial checkin
tz
parents:
diff changeset
   814
                 #(#ViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   815
                    #'name:' 'View'
228524287573 intitial checkin
tz
parents:
diff changeset
   816
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -38 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   817
                    #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   818
                     #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   819
                        #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   820
                         #(
228524287573 intitial checkin
tz
parents:
diff changeset
   821
                           #(#FramedBoxSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   822
                              #'name:' 'framedBox1'
228524287573 intitial checkin
tz
parents:
diff changeset
   823
                              #'layout:' #(#LayoutFrame 1 0.0 1 0.0 0 0.4 55 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   824
                              #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   825
                               #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   826
                                  #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   827
                                   #(
228524287573 intitial checkin
tz
parents:
diff changeset
   828
                                     #(#ComboBoxSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   829
                                        #'name:' 'defaultSizesComboBox'
228524287573 intitial checkin
tz
parents:
diff changeset
   830
                                        #'layout:' #(#LayoutFrame 15 0.0 16 0.0 15 1.0 16 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   831
                                        #'model:' #selectionOfSize
228524287573 intitial checkin
tz
parents:
diff changeset
   832
                                        #'type:' #string
228524287573 intitial checkin
tz
parents:
diff changeset
   833
                                        #'comboList:' #listOfDefaultSizes
228524287573 intitial checkin
tz
parents:
diff changeset
   834
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   835
                                  )
228524287573 intitial checkin
tz
parents:
diff changeset
   836
                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   837
                              #'label:' 'Size'
228524287573 intitial checkin
tz
parents:
diff changeset
   838
                              #'labelPosition:' #topLeft
228524287573 intitial checkin
tz
parents:
diff changeset
   839
                              #'style:' #(#FontDescription #helvetica #medium #roman 12)
228524287573 intitial checkin
tz
parents:
diff changeset
   840
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   841
                           #(#FramedBoxSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   842
                              #'name:' 'framedBox2'
228524287573 intitial checkin
tz
parents:
diff changeset
   843
                              #'layout:' #(#LayoutFrame 0 0.4 1 0.0 -1 1.0 55 0)
228524287573 intitial checkin
tz
parents:
diff changeset
   844
                              #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   845
                               #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   846
                                  #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   847
                                   #(
228524287573 intitial checkin
tz
parents:
diff changeset
   848
                                     #(#ComboListSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   849
                                        #'name:' 'colorMapComboBox'
228524287573 intitial checkin
tz
parents:
diff changeset
   850
                                        #'layout:' #(#LayoutFrame 15 0.0 16 0.0 15 1.0 16 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   851
                                        #'model:' #selectionOfColorMap
228524287573 intitial checkin
tz
parents:
diff changeset
   852
                                        #'comboList:' #listOfColorMaps
228524287573 intitial checkin
tz
parents:
diff changeset
   853
                                        #'useIndex:' false
228524287573 intitial checkin
tz
parents:
diff changeset
   854
                                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   855
                                  )
228524287573 intitial checkin
tz
parents:
diff changeset
   856
                              )
228524287573 intitial checkin
tz
parents:
diff changeset
   857
                              #'label:' 'Color Map'
228524287573 intitial checkin
tz
parents:
diff changeset
   858
                              #'labelPosition:' #topLeft
228524287573 intitial checkin
tz
parents:
diff changeset
   859
                              #'style:' #(#FontDescription #helvetica #medium #roman 12)
228524287573 intitial checkin
tz
parents:
diff changeset
   860
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   861
                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   862
                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   863
                    #'level:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   864
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   865
                 #(#HorizontalPanelViewSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   866
                    #'name:' 'horizontalPanelView1'
228524287573 intitial checkin
tz
parents:
diff changeset
   867
                    #'layout:' #(#LayoutFrame 0 0.0 -38 1 0 1.0 0 1.0)
228524287573 intitial checkin
tz
parents:
diff changeset
   868
                    #'component:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   869
                     #(#SpecCollection
228524287573 intitial checkin
tz
parents:
diff changeset
   870
                        #'collection:' 
228524287573 intitial checkin
tz
parents:
diff changeset
   871
                         #(
228524287573 intitial checkin
tz
parents:
diff changeset
   872
                           #(#ActionButtonSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   873
                              #'name:' 'actionButton2'
228524287573 intitial checkin
tz
parents:
diff changeset
   874
                              #'label:' 'Cancel'
228524287573 intitial checkin
tz
parents:
diff changeset
   875
                              #'model:' #cancel
228524287573 intitial checkin
tz
parents:
diff changeset
   876
                              #'extent:' #(#Point 100 22)
228524287573 intitial checkin
tz
parents:
diff changeset
   877
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   878
                           #(#ActionButtonSpec
228524287573 intitial checkin
tz
parents:
diff changeset
   879
                              #'name:' 'actionButton1'
228524287573 intitial checkin
tz
parents:
diff changeset
   880
                              #'label:' 'OK'
228524287573 intitial checkin
tz
parents:
diff changeset
   881
                              #'model:' #accept
228524287573 intitial checkin
tz
parents:
diff changeset
   882
                              #'isDefault:' true
228524287573 intitial checkin
tz
parents:
diff changeset
   883
                              #'extent:' #(#Point 100 22)
228524287573 intitial checkin
tz
parents:
diff changeset
   884
                          )
228524287573 intitial checkin
tz
parents:
diff changeset
   885
                        )
228524287573 intitial checkin
tz
parents:
diff changeset
   886
                    )
228524287573 intitial checkin
tz
parents:
diff changeset
   887
                    #'horizontalLayout:' #center
228524287573 intitial checkin
tz
parents:
diff changeset
   888
                    #'verticalLayout:' #center
228524287573 intitial checkin
tz
parents:
diff changeset
   889
                    #'horizontalSpace:' 2
228524287573 intitial checkin
tz
parents:
diff changeset
   890
                    #'verticalSpace:' 1
228524287573 intitial checkin
tz
parents:
diff changeset
   891
                )
228524287573 intitial checkin
tz
parents:
diff changeset
   892
              )
228524287573 intitial checkin
tz
parents:
diff changeset
   893
          )
228524287573 intitial checkin
tz
parents:
diff changeset
   894
      )
228524287573 intitial checkin
tz
parents:
diff changeset
   895
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   896
228524287573 intitial checkin
tz
parents:
diff changeset
   897
!ImageEditor class methodsFor:'resources'!
228524287573 intitial checkin
tz
parents:
diff changeset
   898
228524287573 intitial checkin
tz
parents:
diff changeset
   899
leftMouseKeyIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   900
    "ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   901
228524287573 intitial checkin
tz
parents:
diff changeset
   902
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   903
    ^(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 0 0 0 0 161 69 0 0 161 69 0 0 161 69 0 0 0 0 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 21 84 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[0 0 0 0 15 240 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 15 240 7 224 0 0]) ; yourself); yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   904
!
228524287573 intitial checkin
tz
parents:
diff changeset
   905
228524287573 intitial checkin
tz
parents:
diff changeset
   906
loadFromClassIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   907
    "ImageEditor openOnClass:self andSelector:#loadFromClassIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   908
228524287573 intitial checkin
tz
parents:
diff changeset
   909
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   910
    ^(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[17 17 17 17 17 17 17 17 17 17 17 17 0 0 0 0 0 0 0 17 17 17 17 15 255 255 255 255 255 255 30 17 17 17 15 255 255 255 255 255 255 30 225 17 17 15 68 71 119 74 71 215 17 17 17 17 15 68 71 119 164 173 125 255 254 17 17 15 68 71 119 74 71 215 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 51 54 102 147 156 108 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 34 37 85 130 139 91 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 255 255 255 255 255 255 255 254 17 17 15 17 241 255 31 241 31 17 254 17 17 15 31 241 241 241 241 255 31 254 17 17 15 31 241 241 17 241 31 17 254 17 17 15 31 241 241 241 255 31 241 254 17 17 15 17 241 17 241 241 31 17 254 17 17 15 255 255 255 255 255 255 255 254 17 17 254 238 238 238 238 238 238 238 238 17 17 17 17 17 17 17 17 17 17 17 17]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color black); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 127 255 192 127 255 224 127 255 240 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248]) ; yourself); yourself!
228524287573 intitial checkin
tz
parents:
diff changeset
   911
228524287573 intitial checkin
tz
parents:
diff changeset
   912
loadFromFileIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   913
    "ImageEditor openOnClass:self andSelector:#loadFromFileIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   914
228524287573 intitial checkin
tz
parents:
diff changeset
   915
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   916
    ^(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[17 17 17 17 17 17 17 17 17 17 17 17 0 0 0 0 0 0 0 17 17 17 17 15 255 255 255 255 255 255 30 17 17 17 15 255 255 255 255 255 255 30 225 17 17 15 68 71 119 74 71 215 17 17 17 17 15 68 71 119 164 173 125 255 254 17 17 15 68 71 119 74 71 215 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 51 54 102 147 156 108 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 34 37 85 130 139 91 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 255 255 255 255 255 255 255 254 17 17 15 17 31 31 241 255 241 17 254 17 17 15 31 255 31 241 255 241 255 254 17 17 15 17 255 31 241 255 241 31 254 17 17 15 31 255 31 241 255 241 255 254 17 17 15 31 255 31 241 17 241 17 254 17 17 15 255 255 255 255 255 255 255 254 17 17 254 238 238 238 238 238 238 238 238 17 17 17 17 17 17 17 17 17 17 17 17]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color black); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 127 255 192 127 255 224 127 255 240 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248]) ; yourself); yourself!
228524287573 intitial checkin
tz
parents:
diff changeset
   917
228524287573 intitial checkin
tz
parents:
diff changeset
   918
newImageIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   919
    "ImageEditor openOnClass:self andSelector:#newImageIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   920
228524287573 intitial checkin
tz
parents:
diff changeset
   921
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   922
    ^(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[17 17 17 17 17 17 17 17 17 17 17 17 0 0 0 0 0 0 0 17 17 17 17 15 255 255 255 255 255 255 30 17 17 17 15 255 255 255 255 255 255 30 225 17 17 15 68 71 119 74 71 215 17 17 17 17 15 68 71 119 164 173 125 255 254 17 17 15 68 71 119 74 71 215 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 51 54 102 147 156 108 255 254 17 17 15 51 54 102 57 54 198 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 34 37 85 130 139 91 255 254 17 17 15 34 37 85 40 37 181 255 254 17 17 15 255 255 255 255 255 255 255 254 17 17 15 31 241 241 17 241 241 241 254 17 17 15 17 241 241 255 241 241 241 254 17 17 15 17 17 241 31 241 241 241 254 17 17 15 31 17 241 255 241 241 241 254 17 17 15 31 241 241 17 255 31 31 254 17 17 15 255 255 255 255 255 255 255 254 17 17 254 238 238 238 238 238 238 238 238 17 17 17 17 17 17 17 17 17 17 17 17]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color black); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 127 255 192 127 255 224 127 255 240 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248 127 255 248]) ; yourself); yourself!
228524287573 intitial checkin
tz
parents:
diff changeset
   923
228524287573 intitial checkin
tz
parents:
diff changeset
   924
rightMouseKeyIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   925
    "ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   926
228524287573 intitial checkin
tz
parents:
diff changeset
   927
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   928
    ^(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 0 0 0 0 82 138 0 0 82 138 0 0 82 138 0 0 0 0 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 85 85 0 0 21 84 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[0 0 0 0 15 240 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 31 248 15 240 7 224 0 0]) ; yourself); yourself
228524287573 intitial checkin
tz
parents:
diff changeset
   929
!
228524287573 intitial checkin
tz
parents:
diff changeset
   930
228524287573 intitial checkin
tz
parents:
diff changeset
   931
saveAsMethodIcon
228524287573 intitial checkin
tz
parents:
diff changeset
   932
    "ImageEditor openOnClass:self andSelector:#saveAsMethodIcon"
228524287573 intitial checkin
tz
parents:
diff changeset
   933
228524287573 intitial checkin
tz
parents:
diff changeset
   934
    <resource: #image>
228524287573 intitial checkin
tz
parents:
diff changeset
   935
    ^(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 30 225 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 20 68 119 116 164 125 126 30 17 17 17 20 68 119 122 74 215 209 225 17 17 17 20 68 119 116 164 125 126 30 17 17 17 19 51 102 99 147 108 96 240 17 17 17 19 51 102 105 57 198 207 15 17 17 17 19 51 102 99 147 108 96 240 17 17 17 18 34 85 82 130 91 94 238 17 17 17 18 34 85 88 40 181 190 238 17 17 17 18 34 85 82 130 91 94 238]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color black); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[0 0 0 32 0 0 0 0 0 35 51 128 36 74 64 36 74 64 19 50 64 0 0 0 0 0 0 6 0 0 6 0 0 9 0 0 0 0 0 1 255 252 1 255 252 1 255 252 1 255 252 1 255 252 1 255 252 1 255 252 1 255 252 1 255 252]) ; yourself); yourself! !
228524287573 intitial checkin
tz
parents:
diff changeset
   936
228524287573 intitial checkin
tz
parents:
diff changeset
   937
!ImageEditor methodsFor:'accessing'!
228524287573 intitial checkin
tz
parents:
diff changeset
   938
228524287573 intitial checkin
tz
parents:
diff changeset
   939
image
228524287573 intitial checkin
tz
parents:
diff changeset
   940
228524287573 intitial checkin
tz
parents:
diff changeset
   941
    ^self imageEditView image
228524287573 intitial checkin
tz
parents:
diff changeset
   942
!
228524287573 intitial checkin
tz
parents:
diff changeset
   943
228524287573 intitial checkin
tz
parents:
diff changeset
   944
postOpenAction: anAction
228524287573 intitial checkin
tz
parents:
diff changeset
   945
228524287573 intitial checkin
tz
parents:
diff changeset
   946
    postOpenAction := anAction
228524287573 intitial checkin
tz
parents:
diff changeset
   947
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   948
228524287573 intitial checkin
tz
parents:
diff changeset
   949
!ImageEditor methodsFor:'accessing - views'!
228524287573 intitial checkin
tz
parents:
diff changeset
   950
228524287573 intitial checkin
tz
parents:
diff changeset
   951
fileNameInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   952
228524287573 intitial checkin
tz
parents:
diff changeset
   953
    ^builder componentAt: #fileNameInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   954
!
228524287573 intitial checkin
tz
parents:
diff changeset
   955
228524287573 intitial checkin
tz
parents:
diff changeset
   956
imageEditView
228524287573 intitial checkin
tz
parents:
diff changeset
   957
228524287573 intitial checkin
tz
parents:
diff changeset
   958
    ^(builder componentAt: #imageEditView) subViews first 
228524287573 intitial checkin
tz
parents:
diff changeset
   959
!
228524287573 intitial checkin
tz
parents:
diff changeset
   960
228524287573 intitial checkin
tz
parents:
diff changeset
   961
imagePreView
228524287573 intitial checkin
tz
parents:
diff changeset
   962
228524287573 intitial checkin
tz
parents:
diff changeset
   963
    ^(builder componentAt: #imagePreView) subViews first 
228524287573 intitial checkin
tz
parents:
diff changeset
   964
228524287573 intitial checkin
tz
parents:
diff changeset
   965
!
228524287573 intitial checkin
tz
parents:
diff changeset
   966
228524287573 intitial checkin
tz
parents:
diff changeset
   967
resourceClassInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   968
228524287573 intitial checkin
tz
parents:
diff changeset
   969
    ^builder componentAt: #resourceClassInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   970
!
228524287573 intitial checkin
tz
parents:
diff changeset
   971
228524287573 intitial checkin
tz
parents:
diff changeset
   972
resourceSelectorInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   973
228524287573 intitial checkin
tz
parents:
diff changeset
   974
    ^builder componentAt: #resourceSelectorInputField
228524287573 intitial checkin
tz
parents:
diff changeset
   975
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   976
228524287573 intitial checkin
tz
parents:
diff changeset
   977
!ImageEditor methodsFor:'accessing menu'!
228524287573 intitial checkin
tz
parents:
diff changeset
   978
228524287573 intitial checkin
tz
parents:
diff changeset
   979
menu
228524287573 intitial checkin
tz
parents:
diff changeset
   980
    "this window spec was automatically generated by the UI Builder"
228524287573 intitial checkin
tz
parents:
diff changeset
   981
228524287573 intitial checkin
tz
parents:
diff changeset
   982
    ^ self class menu
228524287573 intitial checkin
tz
parents:
diff changeset
   983
228524287573 intitial checkin
tz
parents:
diff changeset
   984
228524287573 intitial checkin
tz
parents:
diff changeset
   985
!
228524287573 intitial checkin
tz
parents:
diff changeset
   986
228524287573 intitial checkin
tz
parents:
diff changeset
   987
menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
   988
    "this window spec was automatically generated by the UI Builder"
228524287573 intitial checkin
tz
parents:
diff changeset
   989
228524287573 intitial checkin
tz
parents:
diff changeset
   990
    ^ self class menuToolbar
228524287573 intitial checkin
tz
parents:
diff changeset
   991
228524287573 intitial checkin
tz
parents:
diff changeset
   992
228524287573 intitial checkin
tz
parents:
diff changeset
   993
! !
228524287573 intitial checkin
tz
parents:
diff changeset
   994
228524287573 intitial checkin
tz
parents:
diff changeset
   995
!ImageEditor methodsFor:'aspects'!
228524287573 intitial checkin
tz
parents:
diff changeset
   996
228524287573 intitial checkin
tz
parents:
diff changeset
   997
imageIsLoaded
228524287573 intitial checkin
tz
parents:
diff changeset
   998
228524287573 intitial checkin
tz
parents:
diff changeset
   999
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1000
    (holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1001
        builder aspectAt:#imageIsLoaded put:(holder :=  false asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1002
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1003
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1004
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1005
228524287573 intitial checkin
tz
parents:
diff changeset
  1006
listOfColors
228524287573 intitial checkin
tz
parents:
diff changeset
  1007
228524287573 intitial checkin
tz
parents:
diff changeset
  1008
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1009
    (holder := builder bindingAt:#listOfColors) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1010
        builder aspectAt:#listOfColors put:(holder :=  List new).
228524287573 intitial checkin
tz
parents:
diff changeset
  1011
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1012
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1013
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1014
228524287573 intitial checkin
tz
parents:
diff changeset
  1015
selectionOfColor
228524287573 intitial checkin
tz
parents:
diff changeset
  1016
228524287573 intitial checkin
tz
parents:
diff changeset
  1017
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1018
    (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1019
        builder aspectAt:#selectionOfColor put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1020
        holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex).
228524287573 intitial checkin
tz
parents:
diff changeset
  1021
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1022
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1023
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1024
228524287573 intitial checkin
tz
parents:
diff changeset
  1025
valueOfCoordLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1026
228524287573 intitial checkin
tz
parents:
diff changeset
  1027
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1028
    (holder := builder bindingAt:#valueOfCoordLabel) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1029
        builder aspectAt:#valueOfCoordLabel put:(holder :=  ValueHolder new).
228524287573 intitial checkin
tz
parents:
diff changeset
  1030
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1031
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1032
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1033
228524287573 intitial checkin
tz
parents:
diff changeset
  1034
valueOfFileName
228524287573 intitial checkin
tz
parents:
diff changeset
  1035
228524287573 intitial checkin
tz
parents:
diff changeset
  1036
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1037
    (holder := builder bindingAt:#valueOfFileName) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1038
        builder aspectAt:#valueOfFileName put:(holder :=  '' asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1039
        holder addDependent: self
228524287573 intitial checkin
tz
parents:
diff changeset
  1040
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1041
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1042
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1043
228524287573 intitial checkin
tz
parents:
diff changeset
  1044
valueOfMagnification
228524287573 intitial checkin
tz
parents:
diff changeset
  1045
228524287573 intitial checkin
tz
parents:
diff changeset
  1046
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1047
    (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1048
        builder aspectAt:#valueOfMagnification put:(
228524287573 intitial checkin
tz
parents:
diff changeset
  1049
        holder := AspectAdaptor new subject:self; forAspect:#magnification)
228524287573 intitial checkin
tz
parents:
diff changeset
  1050
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1051
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1052
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1053
228524287573 intitial checkin
tz
parents:
diff changeset
  1054
valueOfResourceClass
228524287573 intitial checkin
tz
parents:
diff changeset
  1055
228524287573 intitial checkin
tz
parents:
diff changeset
  1056
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1057
    (holder := builder bindingAt:#valueOfResourceClass) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1058
        builder aspectAt:#valueOfResourceClass put: (holder := '' asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1059
        holder addDependent: self
228524287573 intitial checkin
tz
parents:
diff changeset
  1060
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1061
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1062
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1063
228524287573 intitial checkin
tz
parents:
diff changeset
  1064
valueOfResourceSelector
228524287573 intitial checkin
tz
parents:
diff changeset
  1065
228524287573 intitial checkin
tz
parents:
diff changeset
  1066
    |holder|
228524287573 intitial checkin
tz
parents:
diff changeset
  1067
    (holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1068
        builder aspectAt:#valueOfResourceSelector put: (holder := '' asValue).
228524287573 intitial checkin
tz
parents:
diff changeset
  1069
        holder addDependent: self
228524287573 intitial checkin
tz
parents:
diff changeset
  1070
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1071
    ^ holder
228524287573 intitial checkin
tz
parents:
diff changeset
  1072
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1073
228524287573 intitial checkin
tz
parents:
diff changeset
  1074
!ImageEditor methodsFor:'change & update'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1075
228524287573 intitial checkin
tz
parents:
diff changeset
  1076
update:something with:aParameter from:changedObject
228524287573 intitial checkin
tz
parents:
diff changeset
  1077
228524287573 intitial checkin
tz
parents:
diff changeset
  1078
    something == #value
228524287573 intitial checkin
tz
parents:
diff changeset
  1079
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1080
    [   
228524287573 intitial checkin
tz
parents:
diff changeset
  1081
        (changedObject = self valueOfResourceClass)
228524287573 intitial checkin
tz
parents:
diff changeset
  1082
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1083
        [   
228524287573 intitial checkin
tz
parents:
diff changeset
  1084
            |s what m|
228524287573 intitial checkin
tz
parents:
diff changeset
  1085
            s := self resourceClassInputField contents withoutSpaces.
228524287573 intitial checkin
tz
parents:
diff changeset
  1086
            what := Smalltalk classnameCompletion:s.
228524287573 intitial checkin
tz
parents:
diff changeset
  1087
            self resourceClassInputField contents:what first.
228524287573 intitial checkin
tz
parents:
diff changeset
  1088
            (what at:2) size ~~ 1 ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1089
                Display beep
228524287573 intitial checkin
tz
parents:
diff changeset
  1090
            ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1091
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1092
        (changedObject = self valueOfResourceClass) | (changedObject = self valueOfResourceSelector)
228524287573 intitial checkin
tz
parents:
diff changeset
  1093
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1094
        [   
228524287573 intitial checkin
tz
parents:
diff changeset
  1095
            self loadFromMessage: self resourceClassInputField contents, ' ', self resourceSelectorInputField contents
228524287573 intitial checkin
tz
parents:
diff changeset
  1096
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1097
        (changedObject = self valueOfFileName)
228524287573 intitial checkin
tz
parents:
diff changeset
  1098
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1099
        [   
228524287573 intitial checkin
tz
parents:
diff changeset
  1100
            self loadFromFile: self fileNameInputField contents
228524287573 intitial checkin
tz
parents:
diff changeset
  1101
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1102
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1103
228524287573 intitial checkin
tz
parents:
diff changeset
  1104
    super update:something with:aParameter from:changedObject
228524287573 intitial checkin
tz
parents:
diff changeset
  1105
228524287573 intitial checkin
tz
parents:
diff changeset
  1106
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1107
228524287573 intitial checkin
tz
parents:
diff changeset
  1108
!ImageEditor methodsFor:'menu modes'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1109
228524287573 intitial checkin
tz
parents:
diff changeset
  1110
colorMapMode: aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1111
228524287573 intitial checkin
tz
parents:
diff changeset
  1112
    ^colorMapMode = aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1113
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1114
228524287573 intitial checkin
tz
parents:
diff changeset
  1115
colorMapMode: aMode value: aValue
228524287573 intitial checkin
tz
parents:
diff changeset
  1116
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1117
    |depth newColorMap newImage image newColors realColorMap oldFileName| 
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1118
228524287573 intitial checkin
tz
parents:
diff changeset
  1119
    newColorMap := self class listOfColorMaps at: aMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1120
    depth := (newColorMap size log: 2) asInteger. 
228524287573 intitial checkin
tz
parents:
diff changeset
  1121
    newImage := (Image implementorForDepth: depth) new.  
228524287573 intitial checkin
tz
parents:
diff changeset
  1122
    oldFileName := self image fileName.
228524287573 intitial checkin
tz
parents:
diff changeset
  1123
    Object errorSignal handle:
228524287573 intitial checkin
tz
parents:
diff changeset
  1124
    [:ex|
228524287573 intitial checkin
tz
parents:
diff changeset
  1125
        Object errorSignal handle:
228524287573 intitial checkin
tz
parents:
diff changeset
  1126
        [:ex|
228524287573 intitial checkin
tz
parents:
diff changeset
  1127
            ^self warn: 'Convertation failed!!'
228524287573 intitial checkin
tz
parents:
diff changeset
  1128
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1129
        do:
228524287573 intitial checkin
tz
parents:
diff changeset
  1130
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1131
            self image colorsFromX:0 y:0 toX:(self image width-1) y:(self image height-1) do:
228524287573 intitial checkin
tz
parents:
diff changeset
  1132
            [:x :y :clr |
228524287573 intitial checkin
tz
parents:
diff changeset
  1133
                (newColorMap includes: clr)
228524287573 intitial checkin
tz
parents:
diff changeset
  1134
                    ifTrue: [self image colorAtX:x y:y put:clr]
228524287573 intitial checkin
tz
parents:
diff changeset
  1135
                    ifFalse: [self image colorAtX:x y:y put: self image colorMap first]
228524287573 intitial checkin
tz
parents:
diff changeset
  1136
            ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1137
            image := newImage fromImage: self image.
228524287573 intitial checkin
tz
parents:
diff changeset
  1138
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1139
    ] 
228524287573 intitial checkin
tz
parents:
diff changeset
  1140
    do:
228524287573 intitial checkin
tz
parents:
diff changeset
  1141
    [ 
228524287573 intitial checkin
tz
parents:
diff changeset
  1142
        image := newImage fromImage: self image
228524287573 intitial checkin
tz
parents:
diff changeset
  1143
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1144
    (String fromString: aMode) reverse readStream nextWord reverse = 'mask'
228524287573 intitial checkin
tz
parents:
diff changeset
  1145
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1146
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1147
        image mask isNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1148
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1149
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1150
            image mask: (Depth1Image fromImage: (image asThresholdMonochromeImage: 0.1)). 
228524287573 intitial checkin
tz
parents:
diff changeset
  1151
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1152
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1153
    ifFalse:
228524287573 intitial checkin
tz
parents:
diff changeset
  1154
    [ 
228524287573 intitial checkin
tz
parents:
diff changeset
  1155
        image mask: nil.
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1156
    ]. 
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1157
    realColorMap := OrderedCollection new.
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1158
    image realColorMap do:
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1159
    [:clr|
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1160
        (realColorMap includes: clr) ifFalse: [realColorMap add: clr]
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1161
    ].
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1162
    newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size).
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1163
    newColorMap do:
228524287573 intitial checkin
tz
parents:
diff changeset
  1164
    [:clr|
228524287573 intitial checkin
tz
parents:
diff changeset
  1165
        ((newColors size < newColorMap size) and: [(newColors includes: clr) not]) 
228524287573 intitial checkin
tz
parents:
diff changeset
  1166
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1167
        [      
228524287573 intitial checkin
tz
parents:
diff changeset
  1168
            newColors add: clr
228524287573 intitial checkin
tz
parents:
diff changeset
  1169
        ]
405
8546da96ab11 widgets rearranged for different fonts
tz
parents: 401
diff changeset
  1170
    ].       
400
228524287573 intitial checkin
tz
parents:
diff changeset
  1171
    image colorMap: newColors.
228524287573 intitial checkin
tz
parents:
diff changeset
  1172
    colorMapMode := aMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1173
    (self imageEditView image: image) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1174
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1175
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1176
        self image fileName: oldFileName.
228524287573 intitial checkin
tz
parents:
diff changeset
  1177
        self listOfColors contents: image colorMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  1178
        self findColorMapMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1179
        self updateInputFieldsAndLabelsAndHistory.
228524287573 intitial checkin
tz
parents:
diff changeset
  1180
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1181
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1182
228524287573 intitial checkin
tz
parents:
diff changeset
  1183
editMode: aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1184
228524287573 intitial checkin
tz
parents:
diff changeset
  1185
    ^self imageEditView editMode = aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1186
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1187
228524287573 intitial checkin
tz
parents:
diff changeset
  1188
editMode: aMode value: aValue
228524287573 intitial checkin
tz
parents:
diff changeset
  1189
228524287573 intitial checkin
tz
parents:
diff changeset
  1190
    self imageEditView editMode: aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1191
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1192
228524287573 intitial checkin
tz
parents:
diff changeset
  1193
mouseKeyColorMode: aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1194
228524287573 intitial checkin
tz
parents:
diff changeset
  1195
    ^self imageEditView mouseKeyColorMode = aMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1196
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1197
228524287573 intitial checkin
tz
parents:
diff changeset
  1198
mouseKeyColorMode: aMode value: aValue
228524287573 intitial checkin
tz
parents:
diff changeset
  1199
228524287573 intitial checkin
tz
parents:
diff changeset
  1200
    self imageEditView mouseKeyColorMode: aMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1201
228524287573 intitial checkin
tz
parents:
diff changeset
  1202
    self selectionOfColor value: (self listOfColors indexOf: self imageEditView selectedColor).
228524287573 intitial checkin
tz
parents:
diff changeset
  1203
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1204
228524287573 intitial checkin
tz
parents:
diff changeset
  1205
!ImageEditor methodsFor:'private'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1206
228524287573 intitial checkin
tz
parents:
diff changeset
  1207
findColorMapMode
228524287573 intitial checkin
tz
parents:
diff changeset
  1208
228524287573 intitial checkin
tz
parents:
diff changeset
  1209
    self image depth > 8 ifTrue: [colorMapMode := ''. self listOfColors removeAll. ^nil].
228524287573 intitial checkin
tz
parents:
diff changeset
  1210
    colorMapMode := self image depth printString, '-plane'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1211
    self listOfColors isEmpty
228524287573 intitial checkin
tz
parents:
diff changeset
  1212
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1213
    [   
228524287573 intitial checkin
tz
parents:
diff changeset
  1214
         self colorMapMode: colorMapMode value: nil
228524287573 intitial checkin
tz
parents:
diff changeset
  1215
    ].       
228524287573 intitial checkin
tz
parents:
diff changeset
  1216
    self imageEditView selectColor: (Array with: (self listOfColors at: 1) with: (self listOfColors at: 2)).
228524287573 intitial checkin
tz
parents:
diff changeset
  1217
    self image mask notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1218
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1219
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1220
        colorMapMode := colorMapMode, ' + mask'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1221
        self listOfColors addFirst: (Color basicNew setColorId:0).
228524287573 intitial checkin
tz
parents:
diff changeset
  1222
        self imageEditView selectColor: (Array with: (self listOfColors at: 2) with: (self listOfColors at: 1)).
228524287573 intitial checkin
tz
parents:
diff changeset
  1223
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1224
    self selectionOfColor value: 0.
228524287573 intitial checkin
tz
parents:
diff changeset
  1225
    self selectionOfColor value: (self listOfColors indexOf: self imageEditView selectedColor).
228524287573 intitial checkin
tz
parents:
diff changeset
  1226
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1227
228524287573 intitial checkin
tz
parents:
diff changeset
  1228
sortColorColumn: aColumn
228524287573 intitial checkin
tz
parents:
diff changeset
  1229
228524287573 intitial checkin
tz
parents:
diff changeset
  1230
228524287573 intitial checkin
tz
parents:
diff changeset
  1231
228524287573 intitial checkin
tz
parents:
diff changeset
  1232
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1233
228524287573 intitial checkin
tz
parents:
diff changeset
  1234
updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1235
228524287573 intitial checkin
tz
parents:
diff changeset
  1236
    |usedColors|
228524287573 intitial checkin
tz
parents:
diff changeset
  1237
    self image colorMap isNil ifTrue: [usedColors := '?'] ifFalse: [usedColors := self image usedColors size].
228524287573 intitial checkin
tz
parents:
diff changeset
  1238
    self valueOfInfoLabel value:
228524287573 intitial checkin
tz
parents:
diff changeset
  1239
        self image width printString, 'x',
228524287573 intitial checkin
tz
parents:
diff changeset
  1240
        self image height printString, 'x',
228524287573 intitial checkin
tz
parents:
diff changeset
  1241
        (2 raisedTo: self image depth) printString,
228524287573 intitial checkin
tz
parents:
diff changeset
  1242
        (self image mask notNil ifTrue: [' (mask + '] ifFalse: ['(']),
228524287573 intitial checkin
tz
parents:
diff changeset
  1243
        usedColors printString,
228524287573 intitial checkin
tz
parents:
diff changeset
  1244
        ' used colors)'
228524287573 intitial checkin
tz
parents:
diff changeset
  1245
228524287573 intitial checkin
tz
parents:
diff changeset
  1246
228524287573 intitial checkin
tz
parents:
diff changeset
  1247
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1248
228524287573 intitial checkin
tz
parents:
diff changeset
  1249
updateInputFieldsAndLabelsAndHistory
228524287573 intitial checkin
tz
parents:
diff changeset
  1250
228524287573 intitial checkin
tz
parents:
diff changeset
  1251
    self imageIsLoaded value: self image notNil.
228524287573 intitial checkin
tz
parents:
diff changeset
  1252
228524287573 intitial checkin
tz
parents:
diff changeset
  1253
    self image isNil ifTrue: [^nil].
228524287573 intitial checkin
tz
parents:
diff changeset
  1254
228524287573 intitial checkin
tz
parents:
diff changeset
  1255
    self updateInfoLabel.
228524287573 intitial checkin
tz
parents:
diff changeset
  1256
    self imageEditView coordInfoBlock: [:value| self valueOfCoordLabel value: value].
228524287573 intitial checkin
tz
parents:
diff changeset
  1257
228524287573 intitial checkin
tz
parents:
diff changeset
  1258
    self valueOfFileName removeDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1259
    self valueOfFileName value: self image fileName.
228524287573 intitial checkin
tz
parents:
diff changeset
  1260
    self valueOfFileName addDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1261
228524287573 intitial checkin
tz
parents:
diff changeset
  1262
    self valueOfResourceSelector removeDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1263
    self valueOfResourceSelector value: self imageEditView resourceSelector.
228524287573 intitial checkin
tz
parents:
diff changeset
  1264
    self valueOfResourceSelector addDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1265
228524287573 intitial checkin
tz
parents:
diff changeset
  1266
    self valueOfResourceClass removeDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1267
    self imageEditView resourceClass notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1268
        ifTrue: [self valueOfResourceClass value: self imageEditView resourceClass]
228524287573 intitial checkin
tz
parents:
diff changeset
  1269
        ifFalse: [self valueOfResourceClass value: ''].
228524287573 intitial checkin
tz
parents:
diff changeset
  1270
    self valueOfResourceClass addDependent: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1271
228524287573 intitial checkin
tz
parents:
diff changeset
  1272
    self imageEditView resourceMessage asCollectionOfWords size = 2
228524287573 intitial checkin
tz
parents:
diff changeset
  1273
        ifTrue: [self addToHistory: self imageEditView resourceMessage -> #loadFromMessage:].
228524287573 intitial checkin
tz
parents:
diff changeset
  1274
228524287573 intitial checkin
tz
parents:
diff changeset
  1275
    self image fileName notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1276
        ifTrue: [self addToHistory: self image fileName -> #loadFromFile:].
228524287573 intitial checkin
tz
parents:
diff changeset
  1277
228524287573 intitial checkin
tz
parents:
diff changeset
  1278
228524287573 intitial checkin
tz
parents:
diff changeset
  1279
228524287573 intitial checkin
tz
parents:
diff changeset
  1280
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1281
228524287573 intitial checkin
tz
parents:
diff changeset
  1282
!ImageEditor methodsFor:'selection'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1283
228524287573 intitial checkin
tz
parents:
diff changeset
  1284
magnification
228524287573 intitial checkin
tz
parents:
diff changeset
  1285
228524287573 intitial checkin
tz
parents:
diff changeset
  1286
    (builder componentAt: #imageEditView) isNil ifTrue: [^1].
228524287573 intitial checkin
tz
parents:
diff changeset
  1287
    ^self imageEditView magnification x
228524287573 intitial checkin
tz
parents:
diff changeset
  1288
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1289
228524287573 intitial checkin
tz
parents:
diff changeset
  1290
magnification: aValue
228524287573 intitial checkin
tz
parents:
diff changeset
  1291
228524287573 intitial checkin
tz
parents:
diff changeset
  1292
    |magnification|
228524287573 intitial checkin
tz
parents:
diff changeset
  1293
    magnification := aValue asInteger asPoint.
228524287573 intitial checkin
tz
parents:
diff changeset
  1294
    (magnification = self imageEditView magnification) | (magnification = (0@0)) ifTrue: [^nil].
228524287573 intitial checkin
tz
parents:
diff changeset
  1295
    self imageEditView magnification: magnification
228524287573 intitial checkin
tz
parents:
diff changeset
  1296
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1297
228524287573 intitial checkin
tz
parents:
diff changeset
  1298
selectedColorIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  1299
228524287573 intitial checkin
tz
parents:
diff changeset
  1300
    ^selectedColorIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  1301
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1302
228524287573 intitial checkin
tz
parents:
diff changeset
  1303
selectedColorIndex: anIndex
228524287573 intitial checkin
tz
parents:
diff changeset
  1304
228524287573 intitial checkin
tz
parents:
diff changeset
  1305
    selectedColorIndex := anIndex.    
228524287573 intitial checkin
tz
parents:
diff changeset
  1306
    self imageEditView selectedColor: (self listOfColors at: anIndex ifAbsent: [^nil])
228524287573 intitial checkin
tz
parents:
diff changeset
  1307
228524287573 intitial checkin
tz
parents:
diff changeset
  1308
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1309
228524287573 intitial checkin
tz
parents:
diff changeset
  1310
!ImageEditor methodsFor:'startup / release'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1311
228524287573 intitial checkin
tz
parents:
diff changeset
  1312
closeRequest
228524287573 intitial checkin
tz
parents:
diff changeset
  1313
228524287573 intitial checkin
tz
parents:
diff changeset
  1314
    self imageEditView checkModified ifTrue:[super closeRequest]
228524287573 intitial checkin
tz
parents:
diff changeset
  1315
228524287573 intitial checkin
tz
parents:
diff changeset
  1316
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1317
228524287573 intitial checkin
tz
parents:
diff changeset
  1318
open
228524287573 intitial checkin
tz
parents:
diff changeset
  1319
228524287573 intitial checkin
tz
parents:
diff changeset
  1320
    super open.
228524287573 intitial checkin
tz
parents:
diff changeset
  1321
228524287573 intitial checkin
tz
parents:
diff changeset
  1322
    self imageEditView masterApplication: self.
228524287573 intitial checkin
tz
parents:
diff changeset
  1323
228524287573 intitial checkin
tz
parents:
diff changeset
  1324
    self resourceClassInputField entryCompletionBlock:
228524287573 intitial checkin
tz
parents:
diff changeset
  1325
    [:value|
228524287573 intitial checkin
tz
parents:
diff changeset
  1326
        |what|
228524287573 intitial checkin
tz
parents:
diff changeset
  1327
        what := Smalltalk classnameCompletion: value withoutSpaces.
228524287573 intitial checkin
tz
parents:
diff changeset
  1328
        self resourceClassInputField contents:what first.
228524287573 intitial checkin
tz
parents:
diff changeset
  1329
        (what at:2) size ~~ 1 ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1330
            Display beep
228524287573 intitial checkin
tz
parents:
diff changeset
  1331
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1332
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1333
    self resourceSelectorInputField entryCompletionBlock:
228524287573 intitial checkin
tz
parents:
diff changeset
  1334
    [:value|
228524287573 intitial checkin
tz
parents:
diff changeset
  1335
        |cls what|
228524287573 intitial checkin
tz
parents:
diff changeset
  1336
        (cls := Smalltalk at: self resourceClassInputField contents asSymbol) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1337
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1338
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1339
            |firstPossibleSelector resourceType|
228524287573 intitial checkin
tz
parents:
diff changeset
  1340
            what := cls class selectorCompletion: value withoutSpaces.
228524287573 intitial checkin
tz
parents:
diff changeset
  1341
            firstPossibleSelector := what first asSymbol.
228524287573 intitial checkin
tz
parents:
diff changeset
  1342
            (cls class selectors includes: firstPossibleSelector)
228524287573 intitial checkin
tz
parents:
diff changeset
  1343
            ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1344
            [
228524287573 intitial checkin
tz
parents:
diff changeset
  1345
                resourceType := (cls class compiledMethodAt: firstPossibleSelector) resourceType.
228524287573 intitial checkin
tz
parents:
diff changeset
  1346
                ((resourceType = #image) or: [resourceType = #fileImage])
228524287573 intitial checkin
tz
parents:
diff changeset
  1347
                ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1348
                [
228524287573 intitial checkin
tz
parents:
diff changeset
  1349
                    self resourceSelectorInputField contents:firstPossibleSelector.
228524287573 intitial checkin
tz
parents:
diff changeset
  1350
                ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1351
            ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1352
            (what at:2) size ~~ 1 ifTrue:[
228524287573 intitial checkin
tz
parents:
diff changeset
  1353
                Display beep
228524287573 intitial checkin
tz
parents:
diff changeset
  1354
            ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1355
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1356
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1357
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1358
228524287573 intitial checkin
tz
parents:
diff changeset
  1359
postOpenWith:aBuilder
228524287573 intitial checkin
tz
parents:
diff changeset
  1360
228524287573 intitial checkin
tz
parents:
diff changeset
  1361
    postOpenAction notNil ifTrue: [postOpenAction value].
228524287573 intitial checkin
tz
parents:
diff changeset
  1362
    super postOpenWith:aBuilder.
228524287573 intitial checkin
tz
parents:
diff changeset
  1363
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1364
228524287573 intitial checkin
tz
parents:
diff changeset
  1365
reOpen
228524287573 intitial checkin
tz
parents:
diff changeset
  1366
228524287573 intitial checkin
tz
parents:
diff changeset
  1367
    self imageEditView checkModified ifTrue:[super reOpen]
228524287573 intitial checkin
tz
parents:
diff changeset
  1368
228524287573 intitial checkin
tz
parents:
diff changeset
  1369
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1370
228524287573 intitial checkin
tz
parents:
diff changeset
  1371
!ImageEditor methodsFor:'user actions - editing'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1372
228524287573 intitial checkin
tz
parents:
diff changeset
  1373
browseClass
228524287573 intitial checkin
tz
parents:
diff changeset
  1374
228524287573 intitial checkin
tz
parents:
diff changeset
  1375
    SystemBrowser openInClass: (Smalltalk at: self imageEditView resourceClass ifAbsent: [^nil]) class selector: self imageEditView resourceSelector
228524287573 intitial checkin
tz
parents:
diff changeset
  1376
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1377
228524287573 intitial checkin
tz
parents:
diff changeset
  1378
flipHorizontal
228524287573 intitial checkin
tz
parents:
diff changeset
  1379
228524287573 intitial checkin
tz
parents:
diff changeset
  1380
    self imageEditView flipHorizontal
228524287573 intitial checkin
tz
parents:
diff changeset
  1381
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1382
228524287573 intitial checkin
tz
parents:
diff changeset
  1383
flipVertical
228524287573 intitial checkin
tz
parents:
diff changeset
  1384
228524287573 intitial checkin
tz
parents:
diff changeset
  1385
    self imageEditView flipVertical
228524287573 intitial checkin
tz
parents:
diff changeset
  1386
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1387
228524287573 intitial checkin
tz
parents:
diff changeset
  1388
magnifyDown
228524287573 intitial checkin
tz
parents:
diff changeset
  1389
228524287573 intitial checkin
tz
parents:
diff changeset
  1390
    self valueOfMagnification value > 1
228524287573 intitial checkin
tz
parents:
diff changeset
  1391
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1392
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1393
        self valueOfMagnification value: self valueOfMagnification value - 1
228524287573 intitial checkin
tz
parents:
diff changeset
  1394
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1395
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1396
228524287573 intitial checkin
tz
parents:
diff changeset
  1397
magnifyImage
228524287573 intitial checkin
tz
parents:
diff changeset
  1398
228524287573 intitial checkin
tz
parents:
diff changeset
  1399
    self imageEditView magnifyImage.   
228524287573 intitial checkin
tz
parents:
diff changeset
  1400
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1401
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1402
228524287573 intitial checkin
tz
parents:
diff changeset
  1403
magnifyUp
228524287573 intitial checkin
tz
parents:
diff changeset
  1404
228524287573 intitial checkin
tz
parents:
diff changeset
  1405
    self valueOfMagnification value < 99
228524287573 intitial checkin
tz
parents:
diff changeset
  1406
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1407
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1408
        self valueOfMagnification value: self valueOfMagnification value + 1
228524287573 intitial checkin
tz
parents:
diff changeset
  1409
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1410
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1411
228524287573 intitial checkin
tz
parents:
diff changeset
  1412
negativeImage
228524287573 intitial checkin
tz
parents:
diff changeset
  1413
228524287573 intitial checkin
tz
parents:
diff changeset
  1414
    self imageEditView negativeImage.
228524287573 intitial checkin
tz
parents:
diff changeset
  1415
    self listOfColors removeAll.
228524287573 intitial checkin
tz
parents:
diff changeset
  1416
    self findColorMapMode.     
228524287573 intitial checkin
tz
parents:
diff changeset
  1417
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1418
228524287573 intitial checkin
tz
parents:
diff changeset
  1419
resizeImage
228524287573 intitial checkin
tz
parents:
diff changeset
  1420
228524287573 intitial checkin
tz
parents:
diff changeset
  1421
    self imageEditView resizeImage.   
228524287573 intitial checkin
tz
parents:
diff changeset
  1422
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1423
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1424
228524287573 intitial checkin
tz
parents:
diff changeset
  1425
rotateImage
228524287573 intitial checkin
tz
parents:
diff changeset
  1426
228524287573 intitial checkin
tz
parents:
diff changeset
  1427
    self imageEditView rotateImage.
228524287573 intitial checkin
tz
parents:
diff changeset
  1428
    self updateInfoLabel
228524287573 intitial checkin
tz
parents:
diff changeset
  1429
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1430
228524287573 intitial checkin
tz
parents:
diff changeset
  1431
undo
228524287573 intitial checkin
tz
parents:
diff changeset
  1432
228524287573 intitial checkin
tz
parents:
diff changeset
  1433
    self imageEditView undo
228524287573 intitial checkin
tz
parents:
diff changeset
  1434
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1435
228524287573 intitial checkin
tz
parents:
diff changeset
  1436
!ImageEditor methodsFor:'user actions - loading'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1437
228524287573 intitial checkin
tz
parents:
diff changeset
  1438
loadFromClass
228524287573 intitial checkin
tz
parents:
diff changeset
  1439
228524287573 intitial checkin
tz
parents:
diff changeset
  1440
    self loadFromInClassesOf: #Object.
228524287573 intitial checkin
tz
parents:
diff changeset
  1441
   
228524287573 intitial checkin
tz
parents:
diff changeset
  1442
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1443
228524287573 intitial checkin
tz
parents:
diff changeset
  1444
loadFromClassWithSuperclass
228524287573 intitial checkin
tz
parents:
diff changeset
  1445
228524287573 intitial checkin
tz
parents:
diff changeset
  1446
    |box|
228524287573 intitial checkin
tz
parents:
diff changeset
  1447
    box := EnterBox new.
228524287573 intitial checkin
tz
parents:
diff changeset
  1448
    box title:'Name of superclass:'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1449
    box okText:'OK'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1450
    box abortText:'Cancel'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1451
    box initialText: 'ApplicationModel'.
228524287573 intitial checkin
tz
parents:
diff changeset
  1452
    box showAtPointer.
228524287573 intitial checkin
tz
parents:
diff changeset
  1453
    box accepted
228524287573 intitial checkin
tz
parents:
diff changeset
  1454
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1455
    [            
228524287573 intitial checkin
tz
parents:
diff changeset
  1456
        self loadFromInClassesOf: box contents asSymbol
228524287573 intitial checkin
tz
parents:
diff changeset
  1457
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1458
228524287573 intitial checkin
tz
parents:
diff changeset
  1459
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1460
228524287573 intitial checkin
tz
parents:
diff changeset
  1461
loadFromFile
228524287573 intitial checkin
tz
parents:
diff changeset
  1462
228524287573 intitial checkin
tz
parents:
diff changeset
  1463
    self loadFromFile:
228524287573 intitial checkin
tz
parents:
diff changeset
  1464
        (FileSelectionBrowser
228524287573 intitial checkin
tz
parents:
diff changeset
  1465
            request: 'Load Image From' 
228524287573 intitial checkin
tz
parents:
diff changeset
  1466
            fileFilters: FileSelectionBrowser loadImageFileNameFilters)
228524287573 intitial checkin
tz
parents:
diff changeset
  1467
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1468
228524287573 intitial checkin
tz
parents:
diff changeset
  1469
loadFromFile: aFileName
228524287573 intitial checkin
tz
parents:
diff changeset
  1470
228524287573 intitial checkin
tz
parents:
diff changeset
  1471
    (aFileName notNil and: [(self imageEditView loadFromFile: aFileName) notNil])
228524287573 intitial checkin
tz
parents:
diff changeset
  1472
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1473
    [          
228524287573 intitial checkin
tz
parents:
diff changeset
  1474
        self image colorMap notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1475
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1476
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1477
            self listOfColors contents: self image usedColors asSet.
228524287573 intitial checkin
tz
parents:
diff changeset
  1478
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1479
        ifFalse:
228524287573 intitial checkin
tz
parents:
diff changeset
  1480
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1481
            self listOfColors removeAll.
228524287573 intitial checkin
tz
parents:
diff changeset
  1482
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1483
        self findColorMapMode.     
228524287573 intitial checkin
tz
parents:
diff changeset
  1484
        self updateInputFieldsAndLabelsAndHistory.
228524287573 intitial checkin
tz
parents:
diff changeset
  1485
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1486
228524287573 intitial checkin
tz
parents:
diff changeset
  1487
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1488
228524287573 intitial checkin
tz
parents:
diff changeset
  1489
loadFromImage: image
228524287573 intitial checkin
tz
parents:
diff changeset
  1490
228524287573 intitial checkin
tz
parents:
diff changeset
  1491
    (self imageEditView image: image) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1492
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1493
    [    
228524287573 intitial checkin
tz
parents:
diff changeset
  1494
        self image colorMap notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1495
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1496
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1497
            self listOfColors contents: self image usedColors asSet asOrderedCollection.
228524287573 intitial checkin
tz
parents:
diff changeset
  1498
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1499
        ifFalse:
228524287573 intitial checkin
tz
parents:
diff changeset
  1500
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1501
            self listOfColors removeAll.
228524287573 intitial checkin
tz
parents:
diff changeset
  1502
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1503
        self findColorMapMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1504
        self updateInputFieldsAndLabelsAndHistory.
228524287573 intitial checkin
tz
parents:
diff changeset
  1505
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1506
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1507
228524287573 intitial checkin
tz
parents:
diff changeset
  1508
loadFromInClassesOf: aSuperclassOrSymbol
228524287573 intitial checkin
tz
parents:
diff changeset
  1509
228524287573 intitial checkin
tz
parents:
diff changeset
  1510
    self imageEditView loadFromInClassesOf: aSuperclassOrSymbol.
228524287573 intitial checkin
tz
parents:
diff changeset
  1511
    self image notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1512
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1513
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1514
        self listOfColors contents: self image usedColors asSet asOrderedCollection.
228524287573 intitial checkin
tz
parents:
diff changeset
  1515
        self findColorMapMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1516
        self updateInputFieldsAndLabelsAndHistory.
228524287573 intitial checkin
tz
parents:
diff changeset
  1517
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1518
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1519
228524287573 intitial checkin
tz
parents:
diff changeset
  1520
loadFromMessage: aMessage
228524287573 intitial checkin
tz
parents:
diff changeset
  1521
228524287573 intitial checkin
tz
parents:
diff changeset
  1522
    (self imageEditView loadFromMessage: aMessage) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1523
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1524
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1525
        self listOfColors contents: self image usedColors asSet asOrderedCollection.
228524287573 intitial checkin
tz
parents:
diff changeset
  1526
        self findColorMapMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1527
        self updateInputFieldsAndLabelsAndHistory.
228524287573 intitial checkin
tz
parents:
diff changeset
  1528
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1529
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1530
228524287573 intitial checkin
tz
parents:
diff changeset
  1531
newImage
228524287573 intitial checkin
tz
parents:
diff changeset
  1532
228524287573 intitial checkin
tz
parents:
diff changeset
  1533
    |aspects|
228524287573 intitial checkin
tz
parents:
diff changeset
  1534
    aspects  := IdentityDictionary new
228524287573 intitial checkin
tz
parents:
diff changeset
  1535
        at:#listOfSizes put: self class listOfDefaultSizes asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  1536
        at:#listOfColorMaps put: self class listOfColorMaps keys asSortedCollection asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  1537
        at:#selectionOfSize put: self class listOfDefaultSizes first copy asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  1538
        at:#selectionOfColorMap put: self class listOfColorMaps keys asSortedCollection first asValue;
228524287573 intitial checkin
tz
parents:
diff changeset
  1539
        yourself.
228524287573 intitial checkin
tz
parents:
diff changeset
  1540
228524287573 intitial checkin
tz
parents:
diff changeset
  1541
    (self openDialogInterface:#windowSpecForNewImage withBindings:aspects)
228524287573 intitial checkin
tz
parents:
diff changeset
  1542
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1543
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1544
        |width height cMap imageClass image|
228524287573 intitial checkin
tz
parents:
diff changeset
  1545
        width := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value upTo: $x) onError:[24]).
228524287573 intitial checkin
tz
parents:
diff changeset
  1546
        height := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value copy reverse upTo: $x) reverse onError:[24]).
228524287573 intitial checkin
tz
parents:
diff changeset
  1547
228524287573 intitial checkin
tz
parents:
diff changeset
  1548
        cMap := (self class listOfColorMaps at: (colorMapMode := (aspects at:#selectionOfColorMap) value)).
228524287573 intitial checkin
tz
parents:
diff changeset
  1549
        imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger).
228524287573 intitial checkin
tz
parents:
diff changeset
  1550
        image := imageClass width: width height: height fromArray: (ByteArray new: width*height).
228524287573 intitial checkin
tz
parents:
diff changeset
  1551
228524287573 intitial checkin
tz
parents:
diff changeset
  1552
        (colorMapMode copy reverse readStream nextWord reverse = 'mask')
228524287573 intitial checkin
tz
parents:
diff changeset
  1553
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1554
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1555
            image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels.
228524287573 intitial checkin
tz
parents:
diff changeset
  1556
        ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1557
        image colorMap: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  1558
        image fillRectangleX:0 y:0 width:width height:height with:Color white.
228524287573 intitial checkin
tz
parents:
diff changeset
  1559
        (self imageEditView image: image) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1560
        ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1561
        [
228524287573 intitial checkin
tz
parents:
diff changeset
  1562
            self listOfColors contents: cMap.
228524287573 intitial checkin
tz
parents:
diff changeset
  1563
            self findColorMapMode.
228524287573 intitial checkin
tz
parents:
diff changeset
  1564
            self updateInputFieldsAndLabelsAndHistory
228524287573 intitial checkin
tz
parents:
diff changeset
  1565
        ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1566
    ].
228524287573 intitial checkin
tz
parents:
diff changeset
  1567
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1568
228524287573 intitial checkin
tz
parents:
diff changeset
  1569
!ImageEditor methodsFor:'user actions - saving'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1570
228524287573 intitial checkin
tz
parents:
diff changeset
  1571
print
228524287573 intitial checkin
tz
parents:
diff changeset
  1572
228524287573 intitial checkin
tz
parents:
diff changeset
  1573
    self imageEditView print
228524287573 intitial checkin
tz
parents:
diff changeset
  1574
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1575
228524287573 intitial checkin
tz
parents:
diff changeset
  1576
saveImageFile
228524287573 intitial checkin
tz
parents:
diff changeset
  1577
228524287573 intitial checkin
tz
parents:
diff changeset
  1578
    self imageEditView saveImageFileAs: self fileNameInputField contents
228524287573 intitial checkin
tz
parents:
diff changeset
  1579
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1580
228524287573 intitial checkin
tz
parents:
diff changeset
  1581
saveImageFileAs
228524287573 intitial checkin
tz
parents:
diff changeset
  1582
228524287573 intitial checkin
tz
parents:
diff changeset
  1583
    self imageEditView saveImageFileAs.
228524287573 intitial checkin
tz
parents:
diff changeset
  1584
    self updateInputFieldsAndLabelsAndHistory
228524287573 intitial checkin
tz
parents:
diff changeset
  1585
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1586
228524287573 intitial checkin
tz
parents:
diff changeset
  1587
saveImageMaskFileAs
228524287573 intitial checkin
tz
parents:
diff changeset
  1588
228524287573 intitial checkin
tz
parents:
diff changeset
  1589
    self imageEditView saveImageMaskFileAs
228524287573 intitial checkin
tz
parents:
diff changeset
  1590
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1591
228524287573 intitial checkin
tz
parents:
diff changeset
  1592
saveMethod
228524287573 intitial checkin
tz
parents:
diff changeset
  1593
228524287573 intitial checkin
tz
parents:
diff changeset
  1594
    (self imageEditView 
228524287573 intitial checkin
tz
parents:
diff changeset
  1595
        resourceSelector: self resourceSelectorInputField contents;
228524287573 intitial checkin
tz
parents:
diff changeset
  1596
        resourceClass: self resourceClassInputField contents;
228524287573 intitial checkin
tz
parents:
diff changeset
  1597
        saveMethod) notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1598
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1599
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1600
        self updateInputFieldsAndLabelsAndHistory
228524287573 intitial checkin
tz
parents:
diff changeset
  1601
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1602
!
228524287573 intitial checkin
tz
parents:
diff changeset
  1603
228524287573 intitial checkin
tz
parents:
diff changeset
  1604
saveMethodAs
228524287573 intitial checkin
tz
parents:
diff changeset
  1605
228524287573 intitial checkin
tz
parents:
diff changeset
  1606
    self imageEditView saveMethodAs notNil
228524287573 intitial checkin
tz
parents:
diff changeset
  1607
    ifTrue:
228524287573 intitial checkin
tz
parents:
diff changeset
  1608
    [
228524287573 intitial checkin
tz
parents:
diff changeset
  1609
        self updateInputFieldsAndLabelsAndHistory
228524287573 intitial checkin
tz
parents:
diff changeset
  1610
    ]
228524287573 intitial checkin
tz
parents:
diff changeset
  1611
! !
228524287573 intitial checkin
tz
parents:
diff changeset
  1612
228524287573 intitial checkin
tz
parents:
diff changeset
  1613
!ImageEditor class methodsFor:'documentation'!
228524287573 intitial checkin
tz
parents:
diff changeset
  1614
228524287573 intitial checkin
tz
parents:
diff changeset
  1615
version
228524287573 intitial checkin
tz
parents:
diff changeset
  1616
    ^ '$Header$'
228524287573 intitial checkin
tz
parents:
diff changeset
  1617
! !