ImageEditor.st
changeset 2881 67e99e350ee0
parent 2877 1a7cd3e6eea1
child 2884 b24f5e13e650
equal deleted inserted replaced
2880:263e41303b0a 2881:67e99e350ee0
   847     ^Icon
   847     ^Icon
   848         constantNamed:'ImageEditor class rightMouseKeyIcon'
   848         constantNamed:'ImageEditor class rightMouseKeyIcon'
   849         ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]
   849         ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]
   850 !
   850 !
   851 
   851 
       
   852 specialCircleIcon
       
   853     "This resource specification was automatically generated
       
   854      by the ImageEditor of ST/X."
       
   855 
       
   856     "Do not manually edit this!! If it is corrupted,
       
   857      the ImageEditor may not be able to read the specification."
       
   858 
       
   859     "
       
   860      self specialCircleIcon inspect
       
   861      ImageEditor openOnClass:self andSelector:#specialCircleIcon
       
   862      Icon flushCachedIcons
       
   863     "
       
   864 
       
   865     <resource: #image>
       
   866 
       
   867     ^Icon
       
   868         constantNamed:'ImageEditor class specialCircleIcon'
       
   869         ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@!!BDB@ D4@HP@!!@BD@HHA@PHP!!@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@-@D2@''$D^HQ8!!G"DLHH1@PH@-@@0@@@@@a') ; yourself); yourself]
       
   870 !
       
   871 
   852 specialIcon
   872 specialIcon
   853     "This resource specification was automatically generated
   873     "This resource specification was automatically generated
   854      by the ImageEditor of ST/X."
   874      by the ImageEditor of ST/X."
   855 
   875 
   856     "Do not manually edit this!! If it is corrupted,
   876     "Do not manually edit this!! If it is corrupted,
   864 
   884 
   865     <resource: #image>
   885     <resource: #image>
   866 
   886 
   867     ^Icon
   887     ^Icon
   868         constantNamed:'ImageEditor class specialIcon'
   888         constantNamed:'ImageEditor class specialIcon'
   869         ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@@B@@@@@0@@@@@@@@@@@@@@@P@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@0@G @^@A8@G @L@@0@@@@L@@0@@@@@a') ; yourself); yourself]
   889         ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@G!!:P@!!@B4@HP@!!@BD@HP@!!@BW!!8@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@G-8P0!!G"D^HQ8!!G"DLHP0!!@BG-8@0@@@@@a') ; yourself); yourself]
   870 !
   890 !
   871 
   891 
   872 sprayIcon
   892 sprayIcon
   873     "This resource specification was automatically generated
   893     "This resource specification was automatically generated
   874      by the ImageEditor of ST/X."
   894      by the ImageEditor of ST/X."
  2744      by the MenuEditor of ST/X."
  2764      by the MenuEditor of ST/X."
  2745 
  2765 
  2746     "Do not manually edit this!! If it is corrupted,
  2766     "Do not manually edit this!! If it is corrupted,
  2747      the MenuEditor may not be able to read the specification."
  2767      the MenuEditor may not be able to read the specification."
  2748 
  2768 
       
  2769 
  2749     "
  2770     "
  2750      MenuEditor new openOnClass:ImageEditor andSelector:#menuSettings
  2771      MenuEditor new openOnClass:ImageEditor andSelector:#menuSettings
  2751      (Menu new fromLiteralArrayEncoding:(ImageEditor menuSettings)) startUp
  2772      (Menu new fromLiteralArrayEncoding:(ImageEditor menuSettings)) startUp
  2752     "
  2773     "
  2753 
  2774 
  2768             submenu: 
  2789             submenu: 
  2769            (Menu
  2790            (Menu
  2770               (
  2791               (
  2771                (MenuItem
  2792                (MenuItem
  2772                   label: '1'
  2793                   label: '1'
  2773                   itemValue: penWidth:
       
  2774                   translateLabel: true
  2794                   translateLabel: true
  2775                   argument: 1
  2795                   choice: penWidthHolder
       
  2796                   choiceValue: 1
  2776                 )
  2797                 )
  2777                (MenuItem
  2798                (MenuItem
  2778                   label: '5'
  2799                   label: '5'
  2779                   itemValue: penWidth:
       
  2780                   translateLabel: true
  2800                   translateLabel: true
  2781                   argument: 5
  2801                   choice: penWidthHolder
       
  2802                   choiceValue: 5
  2782                 )
  2803                 )
  2783                (MenuItem
  2804                (MenuItem
  2784                   label: '10'
  2805                   label: '10'
  2785                   itemValue: penWidth:
       
  2786                   translateLabel: true
  2806                   translateLabel: true
  2787                   argument: 10
  2807                   choice: penWidthHolder
       
  2808                   choiceValue: 10
  2788                 )
  2809                 )
  2789                )
  2810                )
  2790               nil
  2811               nil
  2791               nil
  2812               nil
  2792             )
  2813             )
  2797             submenu: 
  2818             submenu: 
  2798            (Menu
  2819            (Menu
  2799               (
  2820               (
  2800                (MenuItem
  2821                (MenuItem
  2801                   label: '4'
  2822                   label: '4'
  2802                   itemValue: spraySpot:
       
  2803                   translateLabel: true
  2823                   translateLabel: true
  2804                   argument: 4
  2824                   choice: spraySpotHolder
       
  2825                   choiceValue: 4
  2805                 )
  2826                 )
  2806                (MenuItem
  2827                (MenuItem
  2807                   label: '8'
  2828                   label: '8'
  2808                   itemValue: spraySpot:
       
  2809                   translateLabel: true
  2829                   translateLabel: true
  2810                   argument: 8
  2830                   choice: spraySpotHolder
       
  2831                   choiceValue: 8
  2811                 )
  2832                 )
  2812                (MenuItem
  2833                (MenuItem
  2813                   label: '16'
  2834                   label: '16'
  2814                   itemValue: spraySpot:
       
  2815                   translateLabel: true
  2835                   translateLabel: true
  2816                   argument: 16
  2836                   choice: spraySpotHolder
       
  2837                   choiceValue: 16
  2817                 )
  2838                 )
  2818                (MenuItem
  2839                (MenuItem
  2819                   label: '32'
  2840                   label: '32'
  2820                   itemValue: spraySpot:
       
  2821                   translateLabel: true
  2841                   translateLabel: true
  2822                   argument: 32
  2842                   choice: spraySpotHolder
       
  2843                   choiceValue: 32
  2823                 )
  2844                 )
  2824                )
  2845                )
  2825               nil
  2846               nil
  2826               nil
  2847               nil
  2827             )
  2848             )
  3172      by the MenuEditor of ST/X."
  3193      by the MenuEditor of ST/X."
  3173 
  3194 
  3174     "Do not manually edit this!! If it is corrupted,
  3195     "Do not manually edit this!! If it is corrupted,
  3175      the MenuEditor may not be able to read the specification."
  3196      the MenuEditor may not be able to read the specification."
  3176 
  3197 
       
  3198 
  3177     "
  3199     "
  3178      MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar
  3200      MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar
  3179      (Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp
  3201      (Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp
  3180     "
  3202     "
  3181 
  3203 
  3182     <resource: #menu>
  3204     <resource: #menu>
  3183 
  3205 
  3184     ^ 
  3206     ^ 
  3185      #(#Menu
  3207      #(Menu
  3186         #(
  3208         (
  3187          #(#MenuItem
  3209          (MenuItem
  3188             #activeHelpKey: #drawModePoint
  3210             activeHelpKey: drawModePoint
  3189             #enabled: #imageIsLoadedHolder
  3211             enabled: imageIsLoadedHolder
  3190             #label: 'Point'
  3212             label: 'Point'
  3191             #translateLabel: true
  3213             translateLabel: true
  3192             #isButton: true
  3214             isButton: true
  3193             #labelImage: #(#ResourceRetriever #ImageEditor #pointIcon)
  3215             labelImage: (ResourceRetriever ImageEditor pointIcon)
  3194             #choice: #editMode
  3216             choice: editMode
  3195             #choiceValue: #point
  3217             choiceValue: point
  3196           )
  3218           )
  3197          #(#MenuItem
  3219          (MenuItem
  3198             #activeHelpKey: #drawModeSpray
  3220             activeHelpKey: drawModeSpray
  3199             #enabled: #imageIsLoadedHolder
  3221             enabled: imageIsLoadedHolder
  3200             #label: 'Spray'
  3222             label: 'Spray'
  3201             #translateLabel: true
  3223             translateLabel: true
  3202             #isButton: true
  3224             isButton: true
  3203             #labelImage: #(#ResourceRetriever #ImageEditor #sprayIcon)
  3225             labelImage: (ResourceRetriever ImageEditor sprayIcon)
  3204             #choice: #editMode
  3226             choice: editMode
  3205             #choiceValue: #spray
  3227             choiceValue: spray
  3206           )
  3228           )
  3207          #(#MenuItem
  3229          (MenuItem
  3208             #activeHelpKey: #drawModeBox
  3230             activeHelpKey: drawModeBox
  3209             #enabled: #imageIsLoadedHolder
  3231             enabled: imageIsLoadedHolder
  3210             #label: 'Rect'
  3232             label: 'Rect'
  3211             #translateLabel: true
  3233             translateLabel: true
  3212             #isButton: true
  3234             isButton: true
  3213             #labelImage: #(#ResourceRetriever #ImageEditor #rectIcon)
  3235             labelImage: (ResourceRetriever ImageEditor rectIcon)
  3214             #choice: #editMode
  3236             choice: editMode
  3215             #choiceValue: #box
  3237             choiceValue: box
  3216           )
  3238           )
  3217          #(#MenuItem
  3239          (MenuItem
  3218             #activeHelpKey: #drawModeFilledBox
  3240             activeHelpKey: drawModeFilledBox
  3219             #enabled: #imageIsLoadedHolder
  3241             enabled: imageIsLoadedHolder
  3220             #label: 'FillRect'
  3242             label: 'FillRect'
  3221             #translateLabel: true
  3243             translateLabel: true
  3222             #isButton: true
  3244             isButton: true
  3223             #labelImage: #(#ResourceRetriever #ImageEditor #fillRectIcon)
  3245             labelImage: (ResourceRetriever ImageEditor fillRectIcon)
  3224             #choice: #editMode
  3246             choice: editMode
  3225             #choiceValue: #filledBox
  3247             choiceValue: filledBox
  3226           )
  3248           )
  3227          #(#MenuItem
  3249          (MenuItem
  3228             #activeHelpKey: #drawModeCircle
  3250             activeHelpKey: drawModeCircle
  3229             #enabled: #imageIsLoadedHolder
  3251             enabled: imageIsLoadedHolder
  3230             #label: 'Circle'
  3252             label: 'Circle'
  3231             #translateLabel: true
  3253             translateLabel: true
  3232             #isButton: true
  3254             isButton: true
  3233             #labelImage: #(#ResourceRetriever #ImageEditor #circleIcon)
  3255             labelImage: (ResourceRetriever ImageEditor circleIcon)
  3234             #choice: #editMode
  3256             choice: editMode
  3235             #choiceValue: #circle
  3257             choiceValue: circle
  3236           )
  3258           )
  3237          #(#MenuItem
  3259          (MenuItem
  3238             #activeHelpKey: #drawModeFill
  3260             activeHelpKey: drawModeFill
  3239             #enabled: #imageIsLoadedHolder
  3261             enabled: imageIsLoadedHolder
  3240             #label: 'Fill'
  3262             label: 'Fill'
  3241             #translateLabel: true
  3263             translateLabel: true
  3242             #isButton: true
  3264             isButton: true
  3243             #labelImage: #(#ResourceRetriever #ImageEditor #fillIcon)
  3265             labelImage: (ResourceRetriever ImageEditor fillIcon)
  3244             #choice: #editMode
  3266             choice: editMode
  3245             #choiceValue: #fill
  3267             choiceValue: fill
  3246           )
  3268           )
  3247          #(#MenuItem
  3269          (MenuItem
  3248             #activeHelpKey: #drawModeCopy
  3270             activeHelpKey: drawModeCopy
  3249             #enabled: #imageIsLoadedHolder
  3271             enabled: imageIsLoadedHolder
  3250             #label: 'Copy'
  3272             label: 'Copy'
  3251             #translateLabel: true
  3273             translateLabel: true
  3252             #isButton: true
  3274             isButton: true
  3253             #labelImage: #(#ResourceRetriever #ImageEditor #copyIcon)
  3275             labelImage: (ResourceRetriever ImageEditor copyIcon)
  3254             #choice: #editMode
  3276             choice: editMode
  3255             #choiceValue: #copy
  3277             choiceValue: copy
  3256           )
  3278           )
  3257          #(#MenuItem
  3279          (MenuItem
  3258             #activeHelpKey: #drawModePaste
  3280             activeHelpKey: drawModePasteWithMask
  3259             #enabled: #imageIsLoadedHolder
  3281             enabled: imageIsLoadedHolder
  3260             #label: 'Paste'
  3282             label: 'Paste With Mask'
  3261             #translateLabel: true
  3283             translateLabel: true
  3262             #isButton: true
  3284             isButton: true
  3263             #labelImage: #(#ResourceRetriever #ImageEditor #pasteIcon)
  3285             labelImage: (ResourceRetriever ImageEditor pasteWithMaskIcon)
  3264             #choice: #editMode
  3286             choice: editMode
  3265             #choiceValue: #paste
  3287             choiceValue: pasteWithMask
  3266           )
  3288           )
  3267          #(#MenuItem
  3289          (MenuItem
  3268             #activeHelpKey: #drawModePasteUnder
  3290             activeHelpKey: drawModePaste
  3269             #enabled: #imageIsLoadedHolder
  3291             enabled: imageIsLoadedHolder
  3270             #label: 'Paste Under'
  3292             label: 'Paste'
  3271             #translateLabel: true
  3293             translateLabel: true
  3272             #isButton: true
  3294             isButton: true
  3273             #labelImage: #(#ResourceRetriever #ImageEditor #pasteUnderIcon)
  3295             labelImage: (ResourceRetriever ImageEditor pasteIcon)
  3274             #choice: #editMode
  3296             choice: editMode
  3275             #choiceValue: #pasteUnder
  3297             choiceValue: paste
  3276           )
  3298           )
  3277          #(#MenuItem
  3299          (MenuItem
  3278             #activeHelpKey: #drawModePasteWithMask
  3300             activeHelpKey: drawModePasteUnder
  3279             #enabled: #imageIsLoadedHolder
  3301             enabled: imageIsLoadedHolder
  3280             #label: 'Paste With Mask'
  3302             label: 'Paste Under'
  3281             #translateLabel: true
  3303             translateLabel: true
  3282             #isButton: true
  3304             isButton: true
  3283             #labelImage: #(#ResourceRetriever #ImageEditor #pasteWithMaskIcon)
  3305             labelImage: (ResourceRetriever ImageEditor pasteUnderIcon)
  3284             #choice: #editMode
  3306             choice: editMode
  3285             #choiceValue: #pasteWithMask
  3307             choiceValue: pasteUnder
  3286           )
  3308           )
  3287          #(#MenuItem
  3309          (MenuItem
  3288             #activeHelpKey: #drawModeSpecial
  3310             activeHelpKey: drawModeSpecial
  3289             #enabled: #imageIsLoadedHolder
  3311             enabled: imageIsLoadedHolder
  3290             #label: 'Special'
  3312             label: 'Special'
  3291             #translateLabel: true
  3313             translateLabel: true
  3292             #isButton: true
  3314             isButton: true
  3293             #labelImage: #(#ResourceRetriever #ImageEditor #specialIcon)
  3315             labelImage: (ResourceRetriever ImageEditor specialIcon)
  3294             #choice: #editMode
  3316             choice: editMode
  3295             #choiceValue: #specialOperation
  3317             choiceValue: specialOperation
  3296           )
  3318           )
  3297          )
  3319          )
  3298         nil
  3320         nil
  3299         nil
  3321         nil
  3300       )
  3322       )
  3301 
       
  3302     "Modified: / 04-07-2010 / 10:18:24 / cg"
       
  3303 ! !
  3323 ! !
  3304 
  3324 
  3305 !ImageEditor class methodsFor:'tableColumns specs'!
  3325 !ImageEditor class methodsFor:'tableColumns specs'!
  3306 
  3326 
  3307 colorTableColumns
  3327 colorTableColumns
  3617         holder := AspectAdaptor new subject:self; forAspect:#magnification)
  3637         holder := AspectAdaptor new subject:self; forAspect:#magnification)
  3618     ].
  3638     ].
  3619     ^ holder
  3639     ^ holder
  3620 !
  3640 !
  3621 
  3641 
       
  3642 penWidthHolder
       
  3643     |holder|
       
  3644 
       
  3645     (holder := builder bindingAt:#penWidthHolder) isNil ifTrue:[
       
  3646         builder aspectAt:#penWidthHolder put:(holder := imageEditView penWidth asValue).
       
  3647         holder onChangeSend:#penWidthHolderChanged to:self.
       
  3648     ].
       
  3649     ^ holder
       
  3650 
       
  3651     "Created: / 15-02-2012 / 22:30:58 / cg"
       
  3652 !
       
  3653 
  3622 previewBackgroundColorHolder
  3654 previewBackgroundColorHolder
  3623     |holder|
  3655     |holder|
  3624 
  3656 
  3625     (holder := builder bindingAt:#previewBackgroundColor) isNil ifTrue:[
  3657     (holder := builder bindingAt:#previewBackgroundColor) isNil ifTrue:[
  3626         builder aspectAt:#previewBackgroundColor put:(holder := nil asValue).
  3658         builder aspectAt:#previewBackgroundColor put:(holder := nil asValue).
  3640     (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
  3672     (holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[
  3641         builder aspectAt:#selectionOfColor put:(
  3673         builder aspectAt:#selectionOfColor put:(
  3642         holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ).
  3674         holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ).
  3643     ].
  3675     ].
  3644     ^ holder
  3676     ^ holder
       
  3677 !
       
  3678 
       
  3679 spraySpotHolder
       
  3680     |holder|
       
  3681 
       
  3682     (holder := builder bindingAt:#spraySpotHolder) isNil ifTrue:[
       
  3683         builder aspectAt:#spraySpotHolder put:(holder := imageEditView spraySpot asValue).
       
  3684         holder onChangeSend:#spraySpotHolderChanged to:self.
       
  3685     ].
       
  3686     ^ holder
       
  3687 
       
  3688     "Created: / 15-02-2012 / 22:36:38 / cg"
  3645 !
  3689 !
  3646 
  3690 
  3647 tileModeHolder
  3691 tileModeHolder
  3648     |holder|
  3692     |holder|
  3649 
  3693 
  6741     imageEditView penWidth:n
  6785     imageEditView penWidth:n
  6742 
  6786 
  6743     "Created: / 01-11-2007 / 23:47:48 / cg"
  6787     "Created: / 01-11-2007 / 23:47:48 / cg"
  6744 !
  6788 !
  6745 
  6789 
       
  6790 penWidthHolderChanged
       
  6791     imageEditView penWidth:(self penWidthHolder value)
       
  6792 
       
  6793     "Created: / 15-02-2012 / 22:32:00 / cg"
       
  6794 !
       
  6795 
  6746 spraySpot:n
  6796 spraySpot:n
  6747     imageEditView spraySpot:n
  6797     imageEditView spraySpot:n
  6748 
  6798 
  6749     "Created: / 01-11-2007 / 23:47:48 / cg"
  6799     "Created: / 01-11-2007 / 23:47:48 / cg"
       
  6800 !
       
  6801 
       
  6802 spraySpotHolderChanged
       
  6803     imageEditView spraySpot:(self spraySpotHolder value)
       
  6804 
       
  6805     "Created: / 15-02-2012 / 22:37:08 / cg"
  6750 ! !
  6806 ! !
  6751 
  6807 
  6752 !ImageEditor class methodsFor:'documentation'!
  6808 !ImageEditor class methodsFor:'documentation'!
  6753 
  6809 
  6754 version
  6810 version