'From Squeak3.1alpha of 28 February 2001 [latest update: #3863] on 17 March 2001 at 8:21:50 pm'! "Change Set: AdaptToWorld-ar Date: 17 March 2001 Author: Andreas Raab Simplifies the #adaptToWorld: implementations."! !Object methodsFor: 'scripting' stamp: 'ar 3/17/2001 20:11'! adaptedToWorld: aWorld "If I refer to a world or a hand, return the corresponding items in the new world." ^self! ! !ButtonProperties methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:12'! adaptToWorld: aWorld super adaptToWorld: aWorld. target _ target adaptedToWorld: aWorld.! ! !EventHandler methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:12'! adaptToWorld: aWorld "If any of my recipients refer to a world or a hand, make them now refer to the corresponding items in the new world. (instVarNamed: is slow, later use perform of two selectors.)" | value newValue | #(mouseDownRecipient mouseStillDownRecipient mouseUpRecipient mouseEnterRecipient mouseLeaveRecipient mouseEnterDraggingRecipient mouseLeaveDraggingRecipient clickRecipient doubleClickRecipient startDragRecipient keyStrokeRecipient valueParameter) do: [:aName | (value _ self instVarNamed: aName asString) ifNotNil:[ newValue _ value adaptedToWorld: aWorld. (newValue notNil and: [newValue ~~ value]) ifTrue: [self instVarNamed: aName asString put: newValue]]]! ! !HandMorph methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:11'! adaptedToWorld: aWorld "If I refer to a world or a hand, return the corresponding items in the new world." ^aWorld primaryHand! ! !MenuItemMorph methodsFor: 'accessing' stamp: 'ar 3/17/2001 20:16'! adaptToWorld: aWorld super adaptToWorld: aWorld. target _ target adaptedToWorld: aWorld.! ! !PasteUpMorph methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:12'! adaptedToWorld: aWorld "If I refer to a world or a hand, return the corresponding items in the new world." self isWorldMorph ifTrue:[^aWorld].! ! !Presenter methodsFor: 'intialize' stamp: 'ar 3/17/2001 20:14'! adaptedToWorld: aWorld "If I refer to a world or a hand, return the corresponding items in the new world." ^aWorld presenter! ! !SimpleButtonMorph methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:17'! adaptToWorld: aWorld super adaptToWorld: aWorld. target _ target adaptedToWorld: aWorld.! ! !StringButtonMorph methodsFor: 'initialization' stamp: 'ar 3/17/2001 20:17'! adaptToWorld: aWorld super adaptToWorld: aWorld. target _ target adaptedToWorld: aWorld.! ! !TheWorldMenu methodsFor: 'as yet unclassified' stamp: 'ar 3/17/2001 20:16'! adaptedToWorld: aWorld "Can use me but need to adapt myself" self adaptToWorld: aWorld.! ! !ThreePhaseButtonMorph methodsFor: 'initialize-release' stamp: 'ar 3/17/2001 20:18'! adaptToWorld: aWorld super adaptToWorld: aWorld. self target: (target adaptedToWorld: aWorld).! ! !UpdatingMenuItemMorph methodsFor: 'world' stamp: 'ar 3/17/2001 20:18'! adaptToWorld: aWorld super adaptToWorld: aWorld. wordingProvider _ wordingProvider adaptedToWorld: aWorld.! !