'From Cuis 2.6 of 10 August 2010 [latest update: #540] on 24 August 2010 at 10:53:49 am'!

!Morph methodsFor: 'submorphs-add/remove' stamp: 'jmv 8/24/2010 10:52'!
removeAllMorphs
	| oldMorphs myWorld |
	submorphs isEmpty ifTrue: [ ^self ].
	myWorld _ self world.
	(fullBounds notNil or: [ myWorld notNil ]) ifTrue: [ self invalidRect: self fullBounds ].
	submorphs do: [ :m |
		m privateOwner: nil ].
	oldMorphs _ submorphs.
	submorphs _ EmptyArray.
	oldMorphs do: [ :m |
		self removedMorph: m ].
	self layoutChanged.! !

!Morph methodsFor: 'submorphs-add/remove' stamp: 'jmv 8/24/2010 10:51'!
removeAllMorphsIn: aCollection
	"greatly speeds up the removal of *lots* of submorphs"
	| set myWorld |
	aCollection isEmpty ifTrue: [ ^self ].
	set _ IdentitySet new: aCollection size * 4 // 3.
	aCollection do: [ :each | each owner == self ifTrue: [ set add: each]].
	set isEmpty ifTrue: [ ^self ].
	myWorld _ self world.
	(fullBounds notNil or: [ myWorld notNil ]) ifTrue: [ self invalidRect: self fullBounds ].
	set do: [:m | m privateOwner: nil].
	submorphs _ submorphs reject: [ :each | set includes: each].
	set do: [ :m | self removedMorph: m ].
	self layoutChanged.
! !

!Morph methodsFor: 'updating' stamp: 'jmv 8/24/2010 10:53'!
changed
	"Report that the area occupied by this morph should be redrawn."
	self invalidRect: (fullBounds ifNil: [ bounds ])! !

