2407 (SpecCollection |
2409 (SpecCollection |
2408 collection: ( |
2410 collection: ( |
2409 (MenuPanelSpec |
2411 (MenuPanelSpec |
2410 name: 'menuToolbarView' |
2412 name: 'menuToolbarView' |
2411 layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
2413 layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
2412 style: (FontDescription helvetica medium roman 10) |
2414 style: (FontDescription helvetica medium roman 10 #'iso10646-1' nil nil) |
|
2415 uuid: 'ea3a98c6-1e4a-11b2-83b1-485b39758412' |
2413 menu: menuToolbar |
2416 menu: menuToolbar |
2414 showSeparatingLines: true |
2417 showSeparatingLines: true |
2415 ) |
2418 ) |
2416 (VariableHorizontalPanelSpec |
2419 (VariableHorizontalPanelSpec |
2417 name: 'mainPanel' |
2420 name: 'mainPanel' |
2418 layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
2421 layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
2422 uuid: 'ea3a9eca-1e4a-11b2-83b1-485b39758412' |
2419 snapMode: both |
2423 snapMode: both |
2420 barLevel: 0 |
2424 barLevel: 0 |
2421 component: |
2425 component: |
2422 (SpecCollection |
2426 (SpecCollection |
2423 collection: ( |
2427 collection: ( |
2424 (ViewSpec |
2428 (ViewSpec |
2425 name: 'leftView' |
2429 name: 'leftView' |
|
2430 uuid: 'ea3aa3d4-1e4a-11b2-83b1-485b39758412' |
2426 level: 1 |
2431 level: 1 |
2427 component: |
2432 component: |
2428 (SpecCollection |
2433 (SpecCollection |
2429 collection: ( |
2434 collection: ( |
2430 (VariableVerticalPanelSpec |
2435 (VariableVerticalPanelSpec |
2431 name: 'verticalPanel' |
2436 name: 'verticalPanel' |
2432 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
2437 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
2438 uuid: 'ea3aa672-1e4a-11b2-83b1-485b39758412' |
2433 level: 0 |
2439 level: 0 |
2434 snapMode: both |
2440 snapMode: both |
2435 component: |
2441 component: |
2436 (SpecCollection |
2442 (SpecCollection |
2437 collection: ( |
2443 collection: ( |
2438 (ViewSpec |
2444 (ViewSpec |
2439 name: 'ColorAnCropBox' |
2445 name: 'ColorAnCropBox' |
|
2446 uuid: 'ea3aa992-1e4a-11b2-83b1-485b39758412' |
2440 component: |
2447 component: |
2441 (SpecCollection |
2448 (SpecCollection |
2442 collection: ( |
2449 collection: ( |
2443 (TabViewSpec |
2450 (TabViewSpec |
2444 name: 'TabHeader1' |
2451 name: 'TabHeader1' |
2445 layout: (LayoutFrame 0 0 0 0 0 1 36 0) |
2452 layout: (LayoutFrame 0 0 0 0 0 1 36 0) |
|
2453 uuid: 'ea3aab9a-1e4a-11b2-83b1-485b39758412' |
2446 model: colorCropTabSelectionIndexHolder |
2454 model: colorCropTabSelectionIndexHolder |
2447 menu: colorCropTabLabelList |
2455 menu: colorCropTabLabelList |
2448 useIndex: true |
2456 useIndex: true |
2449 translateLabel: true |
2457 translateLabel: true |
2450 ) |
2458 ) |
2451 (ViewSpec |
2459 (ViewSpec |
2452 name: 'ColorBox' |
2460 name: 'ColorBox' |
2453 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
2461 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
|
2462 uuid: 'ea3ab0ae-1e4a-11b2-83b1-485b39758412' |
2454 visibilityChannel: colorBoxVisibleHolder |
2463 visibilityChannel: colorBoxVisibleHolder |
2455 component: |
2464 component: |
2456 (SpecCollection |
2465 (SpecCollection |
2457 collection: ( |
2466 collection: ( |
2458 (MenuPanelSpec |
2467 (MenuPanelSpec |
2459 name: 'MouseButtonColorToolBar' |
2468 name: 'MouseButtonColorToolBar' |
2460 layout: (LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
2469 layout: (LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
2470 uuid: 'ea3ab2d4-1e4a-11b2-83b1-485b39758412' |
2461 level: 0 |
2471 level: 0 |
2462 menu: menuMouseButtonColors |
2472 menu: menuMouseButtonColors |
2463 ) |
2473 ) |
2464 (LabelSpec |
2474 (LabelSpec |
2465 label: 'Label' |
2475 label: 'Label' |
2466 name: 'Label1' |
2476 name: 'Label1' |
2467 layout: (LayoutFrame -160 1 0 0 -104 1 22 0) |
2477 layout: (LayoutFrame -160 1 0 0 -104 1 22 0) |
|
2478 activeHelpKey: drawingAlpha |
|
2479 uuid: 'ea3ab590-1e4a-11b2-83b1-485b39758412' |
|
2480 visibilityChannel: alphaVisibleHolder |
2468 translateLabel: true |
2481 translateLabel: true |
2469 labelChannel: alphaText |
2482 labelChannel: alphaText |
2470 visibilityChannel: alphaVisibleHolder |
|
2471 activeHelpKey: drawingAlpha |
|
2472 ) |
2483 ) |
2473 (InputFieldSpec |
2484 (InputFieldSpec |
2474 name: 'EntryField1' |
2485 name: 'EntryField1' |
2475 layout: (LayoutFrame -106 1 2 0 -56 1 22 0) |
2486 layout: (LayoutFrame -106 1 2 0 -56 1 22 0) |
|
2487 activeHelpKey: drawingAlpha |
|
2488 uuid: 'ea3aba90-1e4a-11b2-83b1-485b39758412' |
|
2489 visibilityChannel: alphaVisibleHolder |
|
2490 model: alphaHolder |
|
2491 type: numberInRange |
2476 acceptOnReturn: true |
2492 acceptOnReturn: true |
2477 acceptOnTab: true |
2493 acceptOnTab: true |
|
2494 numChars: 3 |
|
2495 minValue: 0 |
|
2496 maxValue: 100 |
2478 acceptOnPointerLeave: true |
2497 acceptOnPointerLeave: true |
2479 visibilityChannel: alphaVisibleHolder |
|
2480 activeHelpKey: drawingAlpha |
|
2481 model: alphaHolder |
|
2482 type: numberInRange |
|
2483 numChars: 3 |
|
2484 minValue: 0 |
|
2485 maxValue: 100 |
|
2486 ) |
2498 ) |
2487 (ViewSpec |
2499 (ViewSpec |
2488 name: 'Box1' |
2500 name: 'Box1' |
2489 layout: (LayoutFrame -40 1.0 4 0 -26 1.0 18 0) |
2501 layout: (LayoutFrame -40 1.0 4 0 -26 1.0 18 0) |
2490 activeHelpKey: drawingColor1 |
2502 activeHelpKey: drawingColor1 |
|
2503 uuid: 'ea3ac1c0-1e4a-11b2-83b1-485b39758412' |
2491 level: -1 |
2504 level: -1 |
2492 backgroundChannel: drawingColor1Holder |
2505 backgroundChannel: drawingColor1Holder |
2493 ) |
2506 ) |
2494 (ViewSpec |
2507 (ViewSpec |
2495 name: 'Box2' |
2508 name: 'Box2' |
2496 layout: (LayoutFrame -25 1.0 4 0 -11 1.0 18 0) |
2509 layout: (LayoutFrame -25 1.0 4 0 -11 1.0 18 0) |
2497 activeHelpKey: drawingColor2 |
2510 activeHelpKey: drawingColor2 |
|
2511 uuid: 'ea3ac418-1e4a-11b2-83b1-485b39758412' |
2498 level: -1 |
2512 level: -1 |
2499 backgroundChannel: drawingColor2Holder |
2513 backgroundChannel: drawingColor2Holder |
2500 ) |
2514 ) |
2501 (DataSetSpec |
2515 (DataSetSpec |
2502 name: 'colorDataSetView' |
2516 name: 'colorDataSetView' |
2503 layout: (LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
2517 layout: (LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
2504 activeHelpKey: colorMapTable |
2518 activeHelpKey: colorMapTable |
2505 style: (FontDescription helvetica medium roman 10) |
2519 style: (FontDescription helvetica medium roman 10 #'iso10646-1' nil nil) |
|
2520 uuid: 'ea3ac652-1e4a-11b2-83b1-485b39758412' |
2506 model: selectedColors |
2521 model: selectedColors |
2507 menu: colorMapMenuHolder |
2522 menu: colorMapMenuHolder |
2508 hasHorizontalScrollBar: true |
2523 hasHorizontalScrollBar: true |
2509 hasVerticalScrollBar: true |
2524 hasVerticalScrollBar: true |
2510 miniScrollerHorizontal: true |
2525 miniScrollerHorizontal: true |
2522 ) |
2537 ) |
2523 ) |
2538 ) |
2524 (ViewSpec |
2539 (ViewSpec |
2525 name: 'FloodFillBox' |
2540 name: 'FloodFillBox' |
2526 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
2541 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
|
2542 uuid: 'ea3acfda-1e4a-11b2-83b1-485b39758412' |
2527 visibilityChannel: floodFillBoxVisibleHolder |
2543 visibilityChannel: floodFillBoxVisibleHolder |
2528 component: |
2544 component: |
2529 (SpecCollection |
2545 (SpecCollection |
2530 collection: ( |
2546 collection: ( |
2531 (UISubSpecification |
2547 (UISubSpecification |
2532 name: 'SubSpecification2' |
2548 name: 'SubSpecification2' |
2533 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
2549 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
2550 uuid: 'ea3ad21e-1e4a-11b2-83b1-485b39758412' |
2534 minorKey: floodFillToleranceSpec |
2551 minorKey: floodFillToleranceSpec |
2535 ) |
2552 ) |
2536 ) |
2553 ) |
2537 |
2554 |
2538 ) |
2555 ) |
2539 ) |
2556 ) |
2540 (ViewSpec |
2557 (ViewSpec |
2541 name: 'CropBox' |
2558 name: 'CropBox' |
2542 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
2559 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
|
2560 uuid: 'ea3ad552-1e4a-11b2-83b1-485b39758412' |
2543 visibilityChannel: cropBoxVisibleHolder |
2561 visibilityChannel: cropBoxVisibleHolder |
2544 component: |
2562 component: |
2545 (SpecCollection |
2563 (SpecCollection |
2546 collection: ( |
2564 collection: ( |
2547 (UISubSpecification |
2565 (UISubSpecification |
2548 name: 'SubSpecification1' |
2566 name: 'SubSpecification1' |
2549 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
2567 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
2568 uuid: 'ea3ad76e-1e4a-11b2-83b1-485b39758412' |
2550 minorKey: cropSpec |
2569 minorKey: cropSpec |
2551 ) |
2570 ) |
2552 ) |
2571 ) |
2553 |
2572 |
2554 ) |
2573 ) |
2577 |
2597 |
2578 ) |
2598 ) |
2579 ) |
2599 ) |
2580 (ViewSpec |
2600 (ViewSpec |
2581 name: 'rightView' |
2601 name: 'rightView' |
|
2602 uuid: 'ea3ade8a-1e4a-11b2-83b1-485b39758412' |
2582 component: |
2603 component: |
2583 (SpecCollection |
2604 (SpecCollection |
2584 collection: ( |
2605 collection: ( |
2585 (MenuPanelSpec |
2606 (MenuPanelSpec |
2586 name: 'ToolBar1' |
2607 name: 'ToolBar1' |
2587 layout: (LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
2608 layout: (LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
|
2609 uuid: 'ea3ae0b0-1e4a-11b2-83b1-485b39758412' |
2588 level: 1 |
2610 level: 1 |
2589 menu: toolsMenuToolbar |
2611 menu: toolsMenuToolbar |
2590 verticalLayout: true |
2612 verticalLayout: true |
2591 centerItems: true |
2613 centerItems: true |
2592 textDefault: true |
2614 textDefault: true |
2593 ) |
2615 ) |
2594 (ViewSpec |
2616 (ViewSpec |
2595 name: 'editingView' |
2617 name: 'editingView' |
2596 layout: (LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
2618 layout: (LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
|
2619 uuid: 'ea3ae3bc-1e4a-11b2-83b1-485b39758412' |
2597 level: 1 |
2620 level: 1 |
2598 component: |
2621 component: |
2599 (SpecCollection |
2622 (SpecCollection |
2600 collection: ( |
2623 collection: ( |
2601 (ArbitraryComponentSpec |
2624 (ArbitraryComponentSpec |
2602 name: 'imageEditView' |
2625 name: 'imageEditView' |
2603 layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
2626 layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
2627 uuid: 'ea3ae5ec-1e4a-11b2-83b1-485b39758412' |
2604 hasHorizontalScrollBar: true |
2628 hasHorizontalScrollBar: true |
2605 hasVerticalScrollBar: true |
2629 hasVerticalScrollBar: true |
2606 hasBorder: false |
2630 hasBorder: false |
2607 component: ImageEditView |
2631 component: ImageEditView |
2608 ) |
2632 ) |
2609 (LabelSpec |
2633 (LabelSpec |
2610 name: 'coordLabel' |
2634 name: 'coordLabel' |
2611 layout: (LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
2635 layout: (LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
2636 uuid: 'ea3ae8da-1e4a-11b2-83b1-485b39758412' |
2612 level: -1 |
2637 level: -1 |
2613 translateLabel: true |
2638 translateLabel: true |
2614 labelChannel: imageInfoHolder |
2639 labelChannel: imageInfoHolder |
2615 resizeForLabel: false |
2640 resizeForLabel: false |
2616 adjust: left |
2641 adjust: left |
2617 ) |
2642 ) |
2618 (ArrowButtonSpec |
2643 (ArrowButtonSpec |
2619 name: 'magnifyDownButton' |
2644 name: 'magnifyDownButton' |
2620 layout: (LayoutFrame -80 1 -22 1 -58 1 0 1) |
2645 layout: (LayoutFrame -80 1 -22 1 -58 1 0 1) |
2621 activeHelpKey: magnifyImageDown |
2646 activeHelpKey: magnifyImageDown |
|
2647 uuid: 'ea3aebd2-1e4a-11b2-83b1-485b39758412' |
2622 translateLabel: true |
2648 translateLabel: true |
2623 model: doMagnifyDown |
2649 model: doMagnifyDown |
2624 enableChannel: imageIsLoadedHolder |
2650 enableChannel: imageIsLoadedHolder |
2625 isTriggerOnDown: true |
2651 isTriggerOnDown: true |
2626 autoRepeat: true |
2652 autoRepeat: true |
5228 |
5255 |
5229 image := self image. |
5256 image := self image. |
5230 imagePreView := self imagePreView. |
5257 imagePreView := self imagePreView. |
5231 |
5258 |
5232 changedObject == self tileModeHolder ifTrue:[ |
5259 changedObject == self tileModeHolder ifTrue:[ |
5233 imagePreView |
5260 image isNil ifTrue:[ |
|
5261 ^ self |
|
5262 ]. |
|
5263 imagePreView |
5234 tileMode:(changedObject value) tileOffset:(image extent); |
5264 tileMode:(changedObject value) tileOffset:(image extent); |
5235 clear; |
5265 clear; |
5236 invalidate. |
5266 invalidate. |
5237 ^ self |
5267 ^ self |
5238 ]. |
5268 ]. |
5239 |
5269 |
5240 changedObject == self previewBackgroundColorHolder ifTrue:[ |
5270 changedObject == self previewBackgroundColorHolder ifTrue:[ |
5241 clr := changedObject value isNil |
5271 clr := changedObject value isNil |
5242 ifTrue:[imageEditView viewBackground] |
5272 ifTrue:[imageEditView viewBackground] |
5243 ifFalse:[Color perform:changedObject value]. |
5273 ifFalse:[Color perform:changedObject value]. |
5244 imagePreView |
5274 imagePreView |
5245 viewBackground:clr; |
5275 viewBackground:clr; |
5246 clear; |
5276 clear; |
5247 invalidate. |
5277 invalidate. |
5248 ^ self |
5278 ^ self |
5249 ]. |
5279 ]. |
5250 changedObject == self previewMagnificationHolder ifTrue:[ |
5280 changedObject == self previewMagnificationHolder ifTrue:[ |
5251 imagePreView |
5281 imagePreView |
5252 magnificationFactor:(self previewMagnificationHolder value); |
5282 magnificationFactor:(self previewMagnificationHolder value); |
5253 clear; |
5283 clear; |
5254 invalidate. |
5284 invalidate. |
5255 ^ self. |
5285 ^ self |
5256 ]. |
5286 ]. |
5257 |
5287 |
5258 changedObject == self listOfColors ifTrue:[ |
5288 changedObject == self listOfColors ifTrue:[ |
5259 something == #at: ifTrue:[ |
5289 something == #at: ifTrue:[ |
5260 "/ colormap entry changed at aParameter |
5290 "/ colormap entry changed at aParameter |
5261 |
5291 |
5262 clrIndex := aParameter. |
5292 clrIndex := aParameter. |
5270 self colorMapChanged. |
5300 self colorMapChanged. |
5271 ] ifFalse:[ |
5301 ] ifFalse:[ |
5272 drawingColormap notNil ifTrue:[ |
5302 drawingColormap notNil ifTrue:[ |
5273 drawingColormap size < clrIndex ifTrue:[ |
5303 drawingColormap size < clrIndex ifTrue:[ |
5274 |newDrawingColormap| |
5304 |newDrawingColormap| |
5275 |
5305 |
5276 newDrawingColormap := drawingColormap species new:clrIndex. |
5306 newDrawingColormap := drawingColormap species new:clrIndex. |
5277 newDrawingColormap replaceFrom:1 with:drawingColormap. |
5307 newDrawingColormap replaceFrom:1 with:drawingColormap. |
5278 drawingColormap := newDrawingColormap. |
5308 drawingColormap := newDrawingColormap. |
5279 ]. |
5309 ]. |
5280 drawingColormap at:clrIndex put:changedColor. |
5310 drawingColormap at:clrIndex put:changedColor. |
5281 ]. |
5311 ]. |
5282 ]. |
5312 ]. |
5283 ^ self |
5313 ^ self |
5284 ]. |
5314 ]. |
5285 ^ self |
5315 ^ self |
5286 ]. |
5316 ]. |
5287 |
5317 |
5288 changedObject == imageEditView undoImages ifTrue:[ |
5318 changedObject == imageEditView undoImages ifTrue:[ |
5289 self canUndoHolder value:(changedObject notEmpty). |
5319 self canUndoHolder value:(changedObject notEmpty). |
5290 ^ self. |
5320 ^ self |
5291 ]. |
5321 ]. |
5292 |
5322 |
5293 changedObject == imageEditView ifTrue:[ |
5323 changedObject == imageEditView ifTrue:[ |
5294 something == #imageColors ifTrue:[ |
5324 something == #imageColors ifTrue:[ |
5295 self updateListOfColorsAndColormapMode. |
5325 self updateListOfColorsAndColormapMode. |
5296 ^ self. |
5326 ^ self |
5297 ]. |
5327 ]. |
5298 something == #image ifTrue:[ |
5328 something == #image ifTrue:[ |
5299 self updateAfterImageChange. |
5329 self updateAfterImageChange. |
5300 imagePreView image:image scroll:false. |
5330 imagePreView image:image scroll:false. |
5301 self updateListOfColorsAndColormapMode. |
5331 self updateListOfColorsAndColormapMode. |
5302 self tileModeHolder value ifTrue:[ |
5332 self tileModeHolder value ifTrue:[ |
5303 imagePreView tileMode:true tileOffset:(image extent). |
5333 imagePreView tileMode:true tileOffset:(image extent). |
5304 ]. |
5334 ]. |
5305 self updateInfoLabel. |
5335 self updateInfoLabel. |
5306 ^ self. |
5336 ^ self |
5307 ]. |
5337 ]. |
5308 something == #subImageIn ifTrue:[ |
5338 something == #subImageIn ifTrue:[ |
5309 imagePreView image ~~ image ifTrue:[ |
5339 imagePreView image ~~ image ifTrue:[ |
5310 self error:'internal error' mayProceed:true. |
5340 self error:'internal error' mayProceed:true. |
5311 ]. |
5341 ]. |
5312 self tileModeHolder value ifTrue:[ |
5342 self tileModeHolder value ifTrue:[ |
5313 imagePreView invalidate. |
5343 imagePreView invalidate. |
5314 ] ifFalse:[ |
5344 ] ifFalse:[ |
5315 imagePreView invalidate:aParameter. |
5345 imagePreView invalidate:aParameter. |
5316 ]. |
5346 ]. |
5317 ^ self. |
5347 ^ self |
5318 ]. |
5348 ]. |
5319 something == #selectedColor ifTrue:[ |
5349 something == #selectedColor ifTrue:[ |
5320 (aParameter isNil or:[aParameter = (Color colorId:0)]) ifTrue:[ |
5350 (aParameter isNil or:[aParameter = (Color colorId:0)]) ifTrue:[ |
5321 "/ no color/mask */ |
5351 "/ no color/mask */ |
5322 "/ self halt. |
5352 "/ self halt. |
5323 clrIndex := self hasTransparentColorInColorList ifTrue:[1] ifFalse:[0]. |
5353 clrIndex := self hasTransparentColorInColorList ifTrue:[1] ifFalse:[0]. |
5324 ] ifFalse:[ |
5354 ] ifFalse:[ |
5325 clrIndex := self listOfColors indexOf:aParameter. |
5355 clrIndex := self listOfColors indexOf:aParameter. |
5326 ]. |
5356 ]. |
5327 self selectedColors value:{clrIndex}. "/ selectionOfColor value:clrIndex. |
5357 self selectedColors value:{clrIndex}. "/ selectionOfColor value:clrIndex. |
5328 ^ self. |
5358 ^ self |
5329 ]. |
5359 ]. |
5330 ^ self. |
5360 ^ self |
5331 ]. |
5361 ]. |
5332 |
5362 |
5333 changedObject == imageEditView modifiedHolder ifTrue:[ |
5363 changedObject == imageEditView modifiedHolder ifTrue:[ |
5334 "/ self halt:'to be implemented'. |
5364 "/ self halt:'to be implemented'. |
5335 ^ self |
5365 ^ self |
5336 ]. |
5366 ]. |
5337 |
5367 |
5338 changedObject == imageEditView image ifTrue:[ |
5368 changedObject == imageEditView image ifTrue:[ |
5339 "/ self halt:'to be implemented'. |
5369 "/ self halt:'to be implemented'. |
5340 self updateAfterImageChange. |
5370 self updateAfterImageChange. |
5341 ^ self. |
5371 ^ self |
5342 ]. |
5372 ]. |
5343 |
5373 |
5344 super update:something with:aParameter from:changedObject |
5374 super update:something with:aParameter from:changedObject |
5345 |
5375 |
5346 "Modified: / 13-09-2017 / 18:01:26 / cg" |
5376 "Modified: / 13-09-2017 / 18:01:26 / cg" |
7460 ] ifFalse:[ |
7490 ] ifFalse:[ |
7461 maskOffset := 0. |
7491 maskOffset := 0. |
7462 ]. |
7492 ]. |
7463 cMap := img colorMap. |
7493 cMap := img colorMap. |
7464 (cMap isNil) ifTrue:[ |
7494 (cMap isNil) ifTrue:[ |
7465 oldColors := drawingColormap |
7495 oldColors := drawingColormap. |
7466 ] ifFalse:[ |
7496 processingSubset := false. |
|
7497 ] ifFalse:[ |
7467 (cMap isMappedPalette or:[cMap isFixedPalette]) ifTrue:[ |
7498 (cMap isMappedPalette or:[cMap isFixedPalette]) ifTrue:[ |
7468 oldColors := cMap asArray |
7499 oldColors := cMap asArray. |
7469 ] ifFalse:[ |
7500 processingSubset := false. |
|
7501 ] ifFalse:[ |
7470 oldColors := selectedColorIndices collect:[:idx | cMap at:idx-maskOffset]. |
7502 oldColors := selectedColorIndices collect:[:idx | cMap at:idx-maskOffset]. |
|
7503 processingSubset := true. |
7471 ]. |
7504 ]. |
7472 ]. |
7505 ]. |
7473 imageEditView makeUndo. |
7506 imageEditView makeUndo. |
7474 |
7507 |
7475 modifiedColormap := cMap asNewArray. |
7508 modifiedColormap := cMap asNewArray. |
7476 selectedColorIndices max > modifiedColormap size ifTrue:[ |
7509 (selectedColorIndices max - maskOffset) > modifiedColormap size ifTrue:[ |
7477 |t| |
7510 |t| |
7478 t := Array new:selectedColorIndices max. |
7511 t := Array new:(selectedColorIndices max - maskOffset). |
7479 t replaceFrom:1 with:modifiedColormap. |
7512 t replaceFrom:1 with:modifiedColormap. |
7480 modifiedColormap := t. |
7513 modifiedColormap := t. |
7481 ]. |
7514 ]. |
7482 |
7515 |
7483 newColors := oldColors collect:aBlock. |
7516 newColors := oldColors collect:aBlock. |
7484 selectedColorIndices do:[:idx | |
7517 processingSubset ifTrue:[ |
7485 modifiedColormap at:idx-maskOffset put:(newColors at:idx-maskOffset ifAbsent:[Color black]) |
7518 selectedColorIndices with:newColors do:[:idx :newColor | |
7486 ]. |
7519 modifiedColormap at:idx-maskOffset put:newColor. |
|
7520 ]. |
|
7521 ] ifFalse:[ |
|
7522 selectedColorIndices do:[:idx | |
|
7523 modifiedColormap at:idx-maskOffset put:(newColors at:idx-maskOffset ifAbsent:[self halt.Color black]) |
|
7524 ]. |
|
7525 ]. |
7487 |
7526 |
7488 newImage := img species new |
7527 newImage := img species new |
7489 width:img width |
7528 width:img width |
7490 height:img height |
7529 height:img height |
7491 depth:img depth |
7530 depth:img depth |
7492 fromArray:img bits. |
7531 fromArray:img bits. |
7493 |
7532 |
7494 (cMap isNil) ifTrue:[ |
7533 (cMap isNil) ifTrue:[ |
7495 "/ only a dummy... |
7534 "/ only a dummy... |
7496 ] ifFalse:[ |
7535 ] ifFalse:[ |
7497 newImage colorMap:modifiedColormap. |
7536 newImage colorMap:modifiedColormap. |
7498 newImage photometric:#palette. |
7537 newImage photometric:#palette. |
7499 ]. |
7538 ]. |
7500 newImage fileName:img fileName. |
7539 newImage fileName:img fileName. |
7501 newImage mask:(img mask copy). |
7540 newImage mask:(img mask copy). |
7502 |
7541 |
7503 (imageEditView image:newImage) notNil ifTrue:[ |
7542 (imageEditView image:newImage) notNil ifTrue:[ |