<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.4.1 of May 30, 2006 on January 26, 2007 at 10:25:37 am</time-stamp>
<!-- Package CS2340* -->


<name-space>
<name>CS2340</name>
<environment>Smalltalk</environment>
<private>false</private>
<imports>
			private Smalltalk.*
			</imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</name-space>

<class>
<name>MyBadParent</name>
<environment>CS2340</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>CS2340DemoApp</name>
<environment>CS2340</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>universeName </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>Employee</name>
<environment>CS2340</environment>
<super>UI.Model</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>name </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>MyBadChild</name>
<environment>CS2340</environment>
<super>CS2340.MyBadParent</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>MyException</name>
<environment>CS2340</environment>
<super>Core.Exception</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>My Classes</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>EmployeeList</name>
<environment>CS2340</environment>
<super>UI.Model</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>employees </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>AspectAdaptorExampleApp</name>
<environment>CS2340</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>employeeCount employeeName list employee </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>

<class>
<name>Foo</name>
<environment>CS2340</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>rows </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CS2340</category>
<attributes>
<package>CS2340</package>
</attributes>
</class>










<methods>
<class-id>CS2340.CS2340DemoApp class</class-id> <category>interface specs</category>

<body package="CS2340" selector="windowSpec">windowSpec
	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

	&lt;resource: #canvas&gt;
	^#(#{UI.FullSpec} 
		#window: 
		#(#{UI.WindowSpec} 
			#label: 'CS2340 Demo' 
			#bounds: #(#{Graphics.Rectangle} 512 384 835 608 ) 
			#colors: 
			#(#{UI.LookPreferences} 
				#setBackgroundColor: #(#{Graphics.ColorValue} 8191 8191 2048 ) ) ) 
		#component: 
		#(#{UI.SpecCollection} 
			#collection: #(
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 86 157 233 185 ) 
					#name: #ActionButton1 
					#model: #destroyAll 
					#label: 'Destroy The Universe' 
					#defaultable: true ) 
				#(#{UI.LabelSpec} 
					#layout: #(#{Core.Point} 32 28 ) 
					#name: #Label1 
					#label: 'Universe Name:' ) 
				#(#{UI.InputFieldSpec} 
					#layout: #(#{Graphics.Rectangle} 32 59 312 88 ) 
					#name: #InputField1 
					#model: #universeName 
					#type: #string ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 83 116 230 146 ) 
					#name: #ActionButton2 
					#flags: 40 
					#model: #disable 
					#label: 'Disable' 
					#defaultable: true ) ) ) )</body>
</methods>


<methods>
<class-id>CS2340.CS2340DemoApp</class-id> <category>aspects</category>

<body package="CS2340" selector="universeName">universeName
	"This method was generated by UIDefiner.  Any edits made here
	may be lost whenever methods are automatically defined.  The
	initialization provided below may have been preempted by an
	initialize method."

	^universeName isNil
		ifTrue:
			[universeName := String new asValue]
		ifFalse:
			[universeName]</body>
</methods>

<methods>
<class-id>CS2340.CS2340DemoApp</class-id> <category>actions</category>

<body package="CS2340" selector="disable">disable      
	universeName value: 'NaDa'.
      (self wrapperAt: #InputField1) disable.
      (self wrapperAt:#ActionButton1) disable.
      (self wrapperAt:#ActionButton2) enable.
      self  closeRequest</body>

<body package="CS2340" selector="destroyAll">destroyAll

	Transcript show: universeName value ; cr.
      self mainWindow unmap.
      (Delay forSeconds:3) wait.
      self mainWindow map.
      (self wrapperAt: #ActionButton2) enable.
      (self wrapperAt:#ActionButton1) disable.</body>
</methods>


<methods>
<class-id>CS2340.Foo class</class-id> <category>instance creation</category>

<body package="CS2340" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>


<methods>
<class-id>CS2340.Foo</class-id> <category>comparing</category>

<body package="CS2340" selector="work">work
    3 timesRepeat: [rows add: OrderedCollection new].
    (rows at: 1) add: 1.
    rows inspect.</body>
</methods>

<methods>
<class-id>CS2340.Foo</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."
      rows := OrderedCollection new.
	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>


<methods>
<class-id>CS2340.Employee class</class-id> <category>instance creation</category>

<body package="CS2340" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>


<methods>
<class-id>CS2340.Employee</class-id> <category>accessing</category>

<body package="CS2340" selector="name:">name: aName
   name := aName.
   self changed: #name.</body>

<body package="CS2340" selector="name">name
   ^name.</body>
</methods>

<methods>
<class-id>CS2340.Employee</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."
      name:='Bob'.
	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>


<methods>
<class-id>CS2340.MyBadParent class</class-id> <category>instance creation</category>

<body package="CS2340" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>


<methods>
<class-id>CS2340.MyBadParent</class-id> <category>overrides</category>

<body package="CS2340" selector="doWork">doWork
   ^5</body>

<body package="CS2340" selector="doSpecialWork">doSpecialWork
   self subclassResponsibility</body>
</methods>

<methods>
<class-id>CS2340.MyBadParent</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>


<methods>
<class-id>CS2340.MyBadChild class</class-id> <category>instance creation</category>

<body package="CS2340" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>


<methods>
<class-id>CS2340.MyBadChild</class-id> <category>exceptions</category>

<body package="CS2340" selector="doWithException">doWithException
     [ MyException raiseSignal ]
             on: MyException
             do: [ :ex | Transcript show: 'The reactor will blow in 30 seconds' ; cr. ].</body>
</methods>

<methods>
<class-id>CS2340.MyBadChild</class-id> <category>overrides</category>

<body package="CS2340" selector="doWork">doWork
   self shouldNotImplement</body>

<body package="CS2340" selector="doSpecialWork">doSpecialWork
  ^7</body>

<body package="CS2340" selector="doTaskQuickly">doTaskQuickly
   Transcript show: 'Trying to do it fast';cr.
   MyException raiseSignal.</body>

<body package="CS2340" selector="doTaskEfficiently">doTaskEfficiently
   Transcript show: 'Trying to do it better';cr.
   ^ 'ok'</body>
</methods>

<methods>
<class-id>CS2340.MyBadChild</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>


<methods>
<class-id>CS2340.EmployeeList class</class-id> <category>initialize-release</category>

<body package="CS2340" selector="new">new
 ^ super new initialize.</body>
</methods>


<methods>
<class-id>CS2340.EmployeeList</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."
	" *** Edit the following to properly initialize instance variables ***"
	employees := OrderedCollection new.
	" *** And replace this comment with additional initialization code *** "
	^self</body>
</methods>

<methods>
<class-id>CS2340.EmployeeList</class-id> <category>accessing</category>

<body package="CS2340" selector="employees:">employees: anObject
	employees := anObject</body>

<body package="CS2340" selector="addEmployee:">addEmployee: aEmp
   employees add: aEmp.
   self changed: #count</body>

<body package="CS2340" selector="count">count
	^employees size.</body>

<body package="CS2340" selector="employees">employees
	^employees</body>
</methods>


<methods>
<class-id>CS2340.AspectAdaptorExampleApp class</class-id> <category>interface specs</category>

<body package="CS2340" selector="windowSpec">windowSpec
	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

	&lt;resource: #canvas&gt;
	^#(#{UI.FullSpec} 
		#window: 
		#(#{UI.WindowSpec} 
			#label: 'AspectAdapter Example' 
			#bounds: #(#{Graphics.Rectangle} 512 384 837 605 ) ) 
		#component: 
		#(#{UI.SpecCollection} 
			#collection: #(
				#(#{UI.InputFieldSpec} 
					#layout: #(#{Graphics.Rectangle} 117 19 217 42 ) 
					#name: #InputField1 
					#model: #employeeCount 
					#type: #number ) 
				#(#{UI.LabelSpec} 
					#layout: #(#{Core.Point} 21 18 ) 
					#name: #Label1 
					#label: 'Employee Count:' ) 
				#(#{UI.LabelSpec} 
					#layout: #(#{Core.Point} 27 64 ) 
					#name: #Label2 
					#label: 'EmployeeName:' ) 
				#(#{UI.InputFieldSpec} 
					#layout: #(#{Graphics.Rectangle} 118 66 276 90 ) 
					#name: #InputField2 
					#model: #employeeName ) 
				#(#{UI.ActionButtonSpec} 
					#layout: #(#{Graphics.Rectangle} 119 142 200 166 ) 
					#name: #ActionButton1 
					#model: #run 
					#label: 'Run' 
					#defaultable: true ) ) ) )</body>
</methods>


<methods>
<class-id>CS2340.AspectAdaptorExampleApp</class-id> <category>aspects</category>

<body package="CS2340" selector="employeeName">employeeName
	"This method was generated by UIDefiner.  Any edits made here
	may be lost whenever methods are automatically defined.  The
	initialization provided below may have been preempted by an
	initialize method."

	^employeeName isNil
		ifTrue:
			[employeeName := String new asValue]
		ifFalse:
			[employeeName]</body>

<body package="CS2340" selector="employeeCount">employeeCount
	"This method was generated by UIDefiner.  Any edits made here
	may be lost whenever methods are automatically defined.  The
	initialization provided below may have been preempted by an
	initialize method."

	^employeeCount isNil
		ifTrue:
			[employeeCount := 0 asValue]
		ifFalse:
			[employeeCount]</body>
</methods>

<methods>
<class-id>CS2340.AspectAdaptorExampleApp</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
   super initialize.
   self employee: Employee new.
   employee name: 'Fred'.
   self list: EmployeeList new.
   list addEmployee: employee.</body>
</methods>

<methods>
<class-id>CS2340.AspectAdaptorExampleApp</class-id> <category>accessing</category>

<body package="CS2340" selector="employee:">employee: anEmp
   employee := anEmp.
   employeeName := (AspectAdaptor subject: employee  sendsUpdates: true) forAspect: #foo.</body>

<body package="CS2340" selector="list:">list: anEmployeeList
  list := anEmployeeList.
  employeeCount:= (AspectAdaptor subject: list  sendsUpdates: true) forAspect: #count.</body>
</methods>

<methods>
<class-id>CS2340.AspectAdaptorExampleApp</class-id> <category>actions</category>

<body package="CS2340" selector="run">run

	list addEmployee: Employee new.
      list addEmployee: Employee new.
      employee name: 'Sally'</body>
</methods>


<methods>
<class-id>CS2340.MyException</class-id> <category>initialize-release</category>

<body package="CS2340" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	super initialize.
	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>



</st-source>
