better use a columnAdaptor to fetch r/g/b values from a color.
--- a/ImageEditor.st Sat Jul 25 19:21:03 1998 +0200
+++ b/ImageEditor.st Mon Jul 27 09:54:53 1998 +0200
@@ -422,11 +422,11 @@
#window:
#(#WindowSpec
#name: 'Image Editor'
- #layout: #(#LayoutFrame 145 0 147 0 644 0 492 0)
+ #layout: #(#LayoutFrame 176 0 156 0 675 0 501 0)
#label: 'Image Editor'
#min: #(#Point 400 320)
#max: #(#Point 1152 900)
- #bounds: #(#Rectangle 145 147 645 493)
+ #bounds: #(#Rectangle 176 156 676 502)
#menu: #menu
#usePreferredExtent: false
)
@@ -496,22 +496,23 @@
#(#DataSetColumnSpec
#label: 'R'
#labelAlignment: #left
- #model: #rowRedByte
+ #model: #redFromColor:
#canSelect: false
)
#(#DataSetColumnSpec
#label: 'G'
#labelAlignment: #left
- #model: #rowGreenByte
+ #model: #greenFromColor:
#canSelect: false
)
#(#DataSetColumnSpec
#label: 'B'
#labelAlignment: #left
- #model: #rowBlueByte
+ #model: #blueFromColor:
#canSelect: false
)
)
+ #columnAdaptor: #colorColumnAdaptor
)
)
)
@@ -602,6 +603,8 @@
)
)
)
+
+ "Modified: / 26.7.1998 / 12:29:12 / cg"
! !
!ImageEditor class methodsFor:'menu specs'!
@@ -1062,6 +1065,14 @@
!ImageEditor methodsFor:'accessing - views'!
+colorDataSetView
+ "returns the view of the colormap"
+
+ ^(builder componentAt: #colorDataSetView)
+
+ "Created: / 26.7.1998 / 12:02:14 / cg"
+!
+
coordLabel
"returns the view the coord label"
@@ -1082,6 +1093,12 @@
!ImageEditor methodsFor:'aspects'!
+colorColumnAdaptor
+ ^ self
+
+ "Created: / 26.7.1998 / 12:17:03 / cg"
+!
+
imageIsLoaded
"returns whether an image is loaded as value holder"
@@ -1184,6 +1201,32 @@
! !
+!ImageEditor methodsFor:'data access'!
+
+blueFromColor:aColor
+ "helper used to access a color as a row in the dataSet view"
+
+ ^ aColor blueByte ? 'mask'
+
+ "Created: / 26.7.1998 / 12:30:35 / cg"
+!
+
+greenFromColor:aColor
+ "helper used to access a color as a row in the dataSet view"
+
+ ^ aColor greenByte ? 'mask'
+
+ "Created: / 26.7.1998 / 12:30:29 / cg"
+!
+
+redFromColor:aColor
+ "helper used to access a color as a row in the dataSet view"
+
+ ^ aColor redByte ? 'mask'
+
+ "Modified: / 26.7.1998 / 12:30:22 / cg"
+! !
+
!ImageEditor methodsFor:'help'!
defaultInfoLabel
@@ -1473,6 +1516,8 @@
postOpenAction notNil ifTrue: [postOpenAction value].
super postOpenWith:aBuilder
+
+ "Modified: / 26.7.1998 / 12:32:55 / cg"
! !
!ImageEditor methodsFor:'user actions - editing'!
@@ -1504,11 +1549,14 @@
doMagnifyDown
"magnifies current image one step down"
- self valueOfMagnification value > 1
- ifTrue:
- [
- self valueOfMagnification value: self valueOfMagnification value - 1
+ |magHolder mag|
+
+ magHolder := self valueOfMagnification.
+ (mag := magHolder value) > 1 ifTrue: [
+ magHolder value: mag - 1
]
+
+ "Modified: / 26.7.1998 / 20:24:08 / cg"
!
doMagnifyImage
@@ -1521,11 +1569,14 @@
doMagnifyUp
"magnifies current image one step up"
- self valueOfMagnification value < 99
- ifTrue:
- [
- self valueOfMagnification value: self valueOfMagnification value + 1
+ |magHolder mag|
+
+ magHolder := self valueOfMagnification.
+ (mag := magHolder value) < 99 ifTrue: [
+ magHolder value: mag + 1
]
+
+ "Modified: / 26.7.1998 / 20:23:52 / cg"
!
doNegativeImage