ImageEditor.st
changeset 673 6039e1d88048
parent 672 738210a2fa06
child 674 d49e23b768e6
equal deleted inserted replaced
672:738210a2fa06 673:6039e1d88048
   212 
   212 
   213 #filePrint
   213 #filePrint
   214 'Print the image on a postscript printer.'
   214 'Print the image on a postscript printer.'
   215 
   215 
   216 #fileSaveAs
   216 #fileSaveAs
   217 'Opens dialog to save the image on a file.'
   217 'Opens dialog to save the image to a file.'
   218 
   218 
   219 #fileSaveMaskAs
   219 #fileSaveMaskAs
   220 'Opens dialog to save the mask of the image on a file.'
   220 'Opens dialog to save the mask of the image to a file.'
   221 
   221 
   222 #fileSaveMethod
   222 #fileSaveMethod
   223 'Saves current image into selected class and selector.'
   223 'Saves current image into selected class and selector.'
   224 
   224 
   225 #fileSaveMethodAs
   225 #fileSaveMethodAs
   442      
   442      
   443        #(#FullSpec
   443        #(#FullSpec
   444           #window: 
   444           #window: 
   445            #(#WindowSpec
   445            #(#WindowSpec
   446               #name: 'New Image'
   446               #name: 'New Image'
   447               #layout: #(#LayoutFrame 197 0 172 0 497 0 276 0)
   447               #layout: #(#LayoutFrame 328 0 326 0 628 0 430 0)
   448               #label: 'New Image'
   448               #label: 'New Image'
   449               #min: #(#Point 10 10)
   449               #min: #(#Point 10 10)
   450               #max: #(#Point 1152 900)
   450               #max: #(#Point 1152 900)
   451               #bounds: #(#Rectangle 197 172 498 277)
   451               #bounds: #(#Rectangle 328 326 629 431)
   452               #usePreferredExtent: false
   452               #usePreferredExtent: false
   453           )
   453           )
   454           #component: 
   454           #component: 
   455            #(#SpecCollection
   455            #(#SpecCollection
   456               #collection: 
   456               #collection: 
  1009         holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex).
  1009         holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex).
  1010     ].
  1010     ].
  1011     ^ holder
  1011     ^ holder
  1012 !
  1012 !
  1013 
  1013 
  1014 valueOfCoordLabel
       
  1015 
       
  1016     |holder|
       
  1017     (holder := builder bindingAt:#valueOfCoordLabel) isNil ifTrue:[
       
  1018         builder aspectAt:#valueOfCoordLabel put:(holder :=  ValueHolder new).
       
  1019     ].
       
  1020     ^ holder
       
  1021 !
       
  1022 
       
  1023 valueOfMagnification
  1014 valueOfMagnification
  1024 
  1015 
  1025     |holder|
  1016     |holder|
  1026     (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
  1017     (holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[
  1027         builder aspectAt:#valueOfMagnification put:(
  1018         builder aspectAt:#valueOfMagnification put:(
  1028         holder := AspectAdaptor new subject:self; forAspect:#magnification)
  1019         holder := AspectAdaptor new subject:self; forAspect:#magnification)
  1029     ].
  1020     ].
  1030     ^ holder
  1021     ^ holder
  1031 ! !
       
  1032 
       
  1033 !ImageEditor methodsFor:'change & update'!
       
  1034 
       
  1035 update:something with:aParameter from:changedObject
       
  1036 
       
  1037     something == #value
       
  1038     ifTrue:
       
  1039     [   
       
  1040         (changedObject = self valueOfResourceClass)
       
  1041         ifTrue:
       
  1042         [   
       
  1043             |s what m|
       
  1044             s := self resourceClassInputField contents withoutSpaces.
       
  1045             what := Smalltalk classnameCompletion:s.
       
  1046             self resourceClassInputField contents:what first.
       
  1047             (what at:2) size ~~ 1 ifTrue:[
       
  1048                 Display beep
       
  1049             ]
       
  1050         ].
       
  1051         (changedObject = self valueOfResourceClass) | (changedObject = self valueOfResourceSelector)
       
  1052         ifTrue:
       
  1053         [   
       
  1054             self loadFromMessage: self resourceClassInputField contents, ' ', self resourceSelectorInputField contents
       
  1055         ].
       
  1056         (changedObject = self valueOfFileName)
       
  1057         ifTrue:
       
  1058         [   
       
  1059             self loadFromFile: self fileNameInputField contents
       
  1060         ].
       
  1061     ].
       
  1062 
       
  1063     super update:something with:aParameter from:changedObject
       
  1064 
       
  1065 ! !
  1022 ! !
  1066 
  1023 
  1067 !ImageEditor methodsFor:'help'!
  1024 !ImageEditor methodsFor:'help'!
  1068 
  1025 
  1069 defaultInfoLabel
  1026 defaultInfoLabel
  1194     ].
  1151     ].
  1195     self selectionOfColor value: 0.
  1152     self selectionOfColor value: 0.
  1196     self selectionOfColor value: (self listOfColors indexOf: self imageEditView selectedColor).
  1153     self selectionOfColor value: (self listOfColors indexOf: self imageEditView selectedColor).
  1197 !
  1154 !
  1198 
  1155 
  1199 sortColorColumn: aColumn
       
  1200 
       
  1201 
       
  1202 
       
  1203 !
       
  1204 
       
  1205 updateForNoneImage
  1156 updateForNoneImage
  1206 
  1157 
  1207     self imageIsLoaded value: false.
  1158     self imageIsLoaded value: false.
  1208     self listOfColors removeAll.
  1159     self listOfColors removeAll.
  1209     self imagePreView image: nil
  1160     self imagePreView image: nil