1406 miniScrollerHorizontal: true |
1406 miniScrollerHorizontal: true |
1407 miniScrollerVertical: true |
1407 miniScrollerVertical: true |
1408 dataList: listOfColors |
1408 dataList: listOfColors |
1409 has3Dsepartors: true |
1409 has3Dsepartors: true |
1410 has3Dseparators: true |
1410 has3Dseparators: true |
1411 columnHolder: tableColumns |
1411 columnHolder: colorTableColumns |
1412 verticalSpacing: 1 |
1412 verticalSpacing: 1 |
1413 columns: |
1413 "/ columns: |
1414 (OrderedCollection |
1414 "/ (OrderedCollection |
1415 |
1415 "/ |
1416 (DataSetColumnSpec |
1416 "/ (DataSetColumnSpec |
1417 labelButtonType: Button |
1417 "/ labelButtonType: Button |
1418 rendererType: rowSelector |
1418 "/ rendererType: rowSelector |
1419 backgroundSelector: theColorItSelf: |
1419 "/ backgroundSelector: theColorItSelf: |
1420 ) |
1420 "/ ) |
1421 (DataSetColumnSpec |
1421 "/ (DataSetColumnSpec |
1422 label: 'R' |
1422 "/ label: 'R' |
1423 labelAlignment: left |
1423 "/ labelAlignment: left |
1424 labelButtonType: Button |
1424 "/ labelButtonType: Button |
1425 columnAlignment: right |
1425 "/ columnAlignment: right |
1426 editorType: InputField |
1426 "/ editorType: InputField |
1427 type: number |
1427 "/ type: number |
1428 model: redFromColor: |
1428 "/ model: redFromColor: |
1429 writeSelector: redAtColor:put: |
1429 "/ writeSelector: redAtColor:put: |
1430 selectSelector: canSelectRedInColor: |
1430 "/ selectSelector: canSelectRedInColor: |
1431 ) |
1431 "/ ) |
1432 |
1432 "/ |
1433 (DataSetColumnSpec |
1433 "/ (DataSetColumnSpec |
1434 label: 'G' |
1434 "/ label: 'G' |
1435 labelAlignment: left |
1435 "/ labelAlignment: left |
1436 labelButtonType: Button |
1436 "/ labelButtonType: Button |
1437 columnAlignment: right |
1437 "/ columnAlignment: right |
1438 editorType: InputField |
1438 "/ editorType: InputField |
1439 type: number |
1439 "/ type: number |
1440 model: greenFromColor: |
1440 "/ model: greenFromColor: |
1441 writeSelector: greenAtColor:put: |
1441 "/ writeSelector: greenAtColor:put: |
1442 selectSelector: canSelectGreenInColor: |
1442 "/ selectSelector: canSelectGreenInColor: |
1443 ) |
1443 "/ ) |
1444 (DataSetColumnSpec |
1444 "/ (DataSetColumnSpec |
1445 label: 'B' |
1445 "/ label: 'B' |
1446 labelAlignment: left |
1446 "/ labelAlignment: left |
1447 labelButtonType: Button |
1447 "/ labelButtonType: Button |
1448 columnAlignment: right |
1448 "/ columnAlignment: right |
1449 editorType: InputField |
1449 "/ editorType: InputField |
1450 type: number |
1450 "/ type: number |
1451 model: blueFromColor: |
1451 "/ model: blueFromColor: |
1452 writeSelector: blueAtColor:put: |
1452 "/ writeSelector: blueAtColor:put: |
1453 selectSelector: canSelectBlueInColor: |
1453 "/ selectSelector: canSelectBlueInColor: |
1454 ) |
1454 "/ ) |
1455 ) |
1455 "/ ) |
1456 columnAdaptor: colorColumnAdaptor |
1456 columnAdaptor: colorColumnAdaptor |
1457 ) |
1457 ) |
1458 ) |
1458 ) |
1459 |
1459 |
1460 ) |
1460 ) |
2914 ]. |
2913 ]. |
2915 imageEditView drawingColors:(Array |
2914 imageEditView drawingColors:(Array |
2916 with: (listOfColors at:1) |
2915 with: (listOfColors at:1) |
2917 with: (listOfColors at:2 ifAbsent:[listOfColors at:1])). |
2916 with: (listOfColors at:2 ifAbsent:[listOfColors at:1])). |
2918 |
2917 |
2919 self hasMask "image mask" notNil ifTrue: [ |
2918 self hasMask ifTrue: [ |
2920 (listOfColors contains: [:clr| clr = (Color colorId:0)]) |
2919 (listOfColors contains: [:clr| clr = (Color colorId:0)]) |
2921 ifFalse:[ |
2920 ifFalse:[ |
2922 listOfColors addFirst:(Color colorId:0). |
2921 listOfColors addFirst:(Color colorId:0). |
2923 imageEditView drawingColors: (Array |
2922 imageEditView drawingColors: (Array |
2924 with: (listOfColors at:2) |
2923 with: (listOfColors at:2) |
3025 super update:something with:aParameter from:changedObject |
3024 super update:something with:aParameter from:changedObject |
3026 |
3025 |
3027 "Modified: / 10.2.2000 / 23:36:49 / cg" |
3026 "Modified: / 10.2.2000 / 23:36:49 / cg" |
3028 ! |
3027 ! |
3029 |
3028 |
|
3029 updateColorsFromImage:image |
|
3030 |colors| |
|
3031 |
|
3032 image colorMap notNil ifTrue:[ |
|
3033 colors := image colorMap asOrderedCollection. |
|
3034 ] ifFalse:[ |
|
3035 colors := image usedColors asSet asOrderedCollection. |
|
3036 ]. |
|
3037 self listOfColors contents:colors. |
|
3038 ! |
|
3039 |
3030 updateForNoImage |
3040 updateForNoImage |
3031 "updates channels and view, if image is loaded" |
3041 "updates channels and view, if image is loaded" |
3032 |
3042 |
3033 self imageIsLoaded value: false. |
3043 self imageIsLoaded value: false. |
3034 self listOfColors removeAll. |
3044 self listOfColors removeAll. |
3222 |img| |
3232 |img| |
3223 |
3233 |
3224 self withCursor:Cursor wait do:[ |
3234 self withCursor:Cursor wait do:[ |
3225 (imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
3235 (imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
3226 (img := self image) notNil ifTrue:[ |
3236 (img := self image) notNil ifTrue:[ |
3227 img colorMap notNil ifTrue:[ |
3237 self updateColorsFromImage:img. |
3228 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
3229 ] ifFalse:[ |
|
3230 self listOfColors removeAll. |
|
3231 ]. |
|
3232 self findColorMapMode. |
3238 self findColorMapMode. |
3233 self updateLabelsAndHistory. |
3239 self updateLabelsAndHistory. |
3234 img := img onDevice:device. |
3240 img := img onDevice:device. |
3235 imageEditView image:img. |
3241 imageEditView image:img. |
3236 ] ifFalse:[ |
3242 ] ifFalse:[ |
3253 |
3259 |
3254 imageEditView image:img. |
3260 imageEditView image:img. |
3255 imageEditView clearModified. |
3261 imageEditView clearModified. |
3256 |
3262 |
3257 img notNil ifTrue:[ |
3263 img notNil ifTrue:[ |
3258 img colorMap notNil ifTrue:[ |
3264 self updateColorsFromImage:img. |
3259 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
3260 ] ifFalse:[ |
|
3261 self listOfColors removeAll. |
|
3262 ]. |
|
3263 self findColorMapMode. |
3265 self findColorMapMode. |
3264 self updateLabelsAndHistory. |
3266 self updateLabelsAndHistory. |
3265 ] ifFalse:[ |
3267 ] ifFalse:[ |
3266 self updateForNoImage |
3268 self updateForNoImage |
3267 ] |
3269 ] |
3275 |img| |
3277 |img| |
3276 |
3278 |
3277 (imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
3279 (imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
3278 (img := self image) notNil ifTrue:[ |
3280 (img := self image) notNil ifTrue:[ |
3279 img := img onDevice:device. |
3281 img := img onDevice:device. |
3280 img colorMap isNil ifTrue:[ |
3282 self updateColorsFromImage:img. |
3281 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
3282 ]. |
|
3283 "/ self findColorMapMode. |
|
3284 self updateLabelsAndHistory. |
3283 self updateLabelsAndHistory. |
3285 "/ imageEditView image:img. |
|
3286 ] ifFalse:[ |
3284 ] ifFalse:[ |
3287 self updateForNoImage |
3285 self updateForNoImage |
3288 ] |
3286 ] |
3289 ] |
3287 ] |
3290 |
3288 |
3294 loadFromOrPrepareForMessage: aMessage |
3292 loadFromOrPrepareForMessage: aMessage |
3295 "loads an image by evaluating aMessage; |
3293 "loads an image by evaluating aMessage; |
3296 if no image could extract from aMessage; do set the class and the selector from |
3294 if no image could extract from aMessage; do set the class and the selector from |
3297 the aMessage for a saving at the end of editing" |
3295 the aMessage for a saving at the end of editing" |
3298 |
3296 |
3299 (imageEditView loadFromMessage: aMessage) notNil |
3297 (imageEditView loadFromMessage: aMessage) notNil ifTrue: [ |
3300 ifTrue: [ |
3298 self updateColorsFromImage:self image. |
3301 self listOfColors contents: self image usedColors asSet asOrderedCollection. |
|
3302 self findColorMapMode. |
3299 self findColorMapMode. |
3303 ] ifFalse: [ |
3300 ] ifFalse: [ |
3304 imageEditView resourceMessage: aMessage. |
3301 imageEditView resourceMessage: aMessage. |
3305 ]. |
3302 ]. |
3306 self updateLabelsAndHistory. |
3303 self updateLabelsAndHistory. |
3980 newImage mask:(oldImage mask copy). |
3974 newImage mask:(oldImage mask copy). |
3981 |
3975 |
3982 (imageEditView image:newImage) notNil ifTrue: |
3976 (imageEditView image:newImage) notNil ifTrue: |
3983 [ |
3977 [ |
3984 self fetchImageData. |
3978 self fetchImageData. |
3985 "/ self listOfColors contents: newImage colorMap. |
|
3986 "/ self findColorMapMode. |
|
3987 "/ self updateLabelsAndHistory. |
|
3988 ] |
3979 ] |
3989 ] |
3980 ] |
3990 |
3981 |
3991 "Created: / 28.7.1998 / 20:03:11 / cg" |
3982 "Created: / 28.7.1998 / 20:03:11 / cg" |
3992 "Modified: / 15.9.1998 / 17:53:32 / cg" |
3983 "Modified: / 15.9.1998 / 17:53:32 / cg" |
4205 ] ifTrue:[ |
4196 ] ifTrue:[ |
4206 img := imageEditView image. |
4197 img := imageEditView image. |
4207 imageEditView image:img. |
4198 imageEditView image:img. |
4208 |
4199 |
4209 self fetchImageData. |
4200 self fetchImageData. |
4210 "/ self listOfColors contents:(img colorMap). |
|
4211 "/ self findColorMapMode. |
|
4212 "/ self updateLabelsAndHistory. |
|
4213 usedColors := img usedColorsMax:10000. |
4201 usedColors := img usedColorsMax:10000. |
4214 usedColors size == 10000 ifTrue:[ |
4202 usedColors size == 10000 ifTrue:[ |
4215 Dialog information:('>= ' , usedColors size printString , ' colors used.') |
4203 Dialog information:('>= ' , usedColors size printString , ' colors used.') |
4216 ] ifFalse:[ |
4204 ] ifFalse:[ |
4217 Dialog information:(usedColors size printString , ' colors used.') |
4205 Dialog information:(usedColors size printString , ' colors used.') |
4331 newImage fileName:oldImage fileName. |
4319 newImage fileName:oldImage fileName. |
4332 newImage mask:(oldImage mask copy). |
4320 newImage mask:(oldImage mask copy). |
4333 |
4321 |
4334 (imageEditView image:newImage) notNil ifTrue:[ |
4322 (imageEditView image:newImage) notNil ifTrue:[ |
4335 self fetchImageData. |
4323 self fetchImageData. |
4336 "/ self listOfColors contents: newImage colorMap. |
|
4337 "/ self findColorMapMode. |
|
4338 "/ self updateLabelsAndHistory. |
|
4339 ] |
4324 ] |
4340 ] |
4325 ] |
4341 |
4326 |
4342 "Modified: / 15.9.1998 / 17:53:32 / cg" |
4327 "Modified: / 15.9.1998 / 17:53:32 / cg" |
4343 "Created: / 30.9.1998 / 23:51:23 / cg" |
4328 "Created: / 30.9.1998 / 23:51:23 / cg" |