AspectAdaptor.st
changeset 125 fa5b5e4336bf
parent 114 e577a2f332d0
child 129 f890eaabc487
--- a/AspectAdaptor.st	Thu Nov 23 11:40:23 1995 +0100
+++ b/AspectAdaptor.st	Thu Nov 23 11:43:41 1995 +0100
@@ -10,7 +10,7 @@
  hereby transferred.
 "
 
-ProtocolAdaptor subclass:#AspectAdaptor 
+ProtocolAdaptor subclass:#AspectAdaptor
 	 instanceVariableNames:'myAspect getMsg putMsg'
 	 classVariableNames:''
 	 poolDictionaries:''
@@ -33,10 +33,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libview2/AspectAdaptor.st,v 1.7 1995-11-11 16:04:16 cg Exp $'
-!
-
 documentation
 "
     an AspectAdaptor forwards updates and change messages
@@ -131,6 +127,10 @@
 	    Transcript showCr:'data now: ' , data printString
 	]
 "
+!
+
+version
+    ^ '$Header: /cvs/stx/stx/libview2/AspectAdaptor.st,v 1.8 1995-11-23 10:42:05 cg Exp $'
 ! !
 
 !AspectAdaptor class methodsFor:'instance creation'!
@@ -147,6 +147,72 @@
 		accessWith:getSel assignWith:putSel aspect:aspect
 ! !
 
+!AspectAdaptor methodsFor:'accessing-spec'!
+
+accessWith:getSelector assignWith:putSelector
+    "setup the recevier to use getSelector to fetch a value
+     and setSelector to change it."
+
+    getMsg := getSelector.
+    putMsg := putSelector
+!
+
+accessWith:getSelector assignWith:putSelector aspect:aspectSymbol
+    "setup the recevier to use getSelector to fetch a value
+     and setSelector to change it."
+
+    getMsg := getSelector.
+    putMsg := putSelector.
+    myAspect := aspectSymbol
+!
+
+forAspect
+    myAspect isNil ifTrue:[
+	^ getMsg
+    ].
+    ^ myAspect
+!
+
+forAspect:aSelector
+    getMsg := myAspect := aSelector.
+    putMsg := (aSelector , ':') asSymbol.
+! !
+
+!AspectAdaptor methodsFor:'accessing-value'!
+
+setValue:newValue
+    |target oldValue|
+
+    target := super value.
+    oldValue := target perform:getMsg.
+    oldValue ~~ newValue ifTrue:[
+	target perform:putMsg with:newValue.
+    ]
+!
+
+value
+    "translate a query for my value from my user
+     into an aspect access towards my subject"
+
+    |target|
+
+    target := super value.
+    ^ target perform:getMsg
+!
+
+value:newValue
+    |target oldValue|
+
+    target := super value.
+    oldValue := target perform:getMsg.
+    oldValue ~~ newValue ifTrue:[
+	target perform:putMsg with:newValue.
+	subjectSendsUpdates ifFalse:[
+	    self changed:#value
+	]
+    ]
+! !
+
 !AspectAdaptor methodsFor:'change & update'!
 
 update:something with:aParameter from:changedObject
@@ -162,68 +228,3 @@
     ].
 ! !
 
-!AspectAdaptor methodsFor:'accessing-value'!
-
-value
-    "translate a query for my value from my user
-     into an aspect access towards my subject"
-
-    |target|
-
-    target := super value.
-    ^ target perform:getMsg
-!
-
-setValue:newValue
-    |target oldValue|
-
-    target := super value.
-    oldValue := target perform:getMsg.
-    oldValue ~~ newValue ifTrue:[
-	target perform:putMsg with:newValue.
-    ]
-!
-
-value:newValue
-    |target oldValue|
-
-    target := super value.
-    oldValue := target perform:getMsg.
-    oldValue ~~ newValue ifTrue:[
-	target perform:putMsg with:newValue.
-	subjectSendsUpdates ifFalse:[
-	    self changed:#value
-	]
-    ]
-! !
-        
-!AspectAdaptor methodsFor:'accessing-spec'!
-
-forAspect
-    myAspect isNil ifTrue:[
-	^ getMsg
-    ].
-    ^ myAspect
-!
-
-forAspect:aSelector
-    getMsg := myAspect := aSelector.
-    putMsg := (aSelector , ':') asSymbol.
-!
-
-accessWith:getSelector assignWith:putSelector
-    "setup the recevier to use getSelector to fetch a value
-     and setSelector to change it."
-
-    getMsg := getSelector.
-    putMsg := putSelector
-!
-
-accessWith:getSelector assignWith:putSelector aspect:aspectSymbol
-    "setup the recevier to use getSelector to fetch a value
-     and setSelector to change it."
-
-    getMsg := getSelector.
-    putMsg := putSelector.
-    myAspect := aspectSymbol
-! !