'From Squeak3.2alpha of 3 October 2001 [latest update: #4555] on 27 November 2001 at 1:32:27 pm'! "Change Set: avoidThumbnailing-sw Date: 27 November 2001 Author: Scott Wallace Fixes a bug in the mechanism provided for avoiding thumbnailing of certain morphs for parts-bin purposes."! !DescriptionForPartsBin methodsFor: 'initialization' stamp: 'sw 11/27/2001 13:19'! sampleImageFormOrNil "If I have a sample image form override stored, answer it, dlse answer nil" ^ sampleImageForm ! ! !Morph class methodsFor: 'new-morph participation' stamp: 'sw 11/27/2001 13:20'! addPartsDescriptorQuadsTo: aList if: aBlock "For each of the standard objects to be put into parts bins based on declarations in this class, add a parts-launching quintuplet to aList, provided that the boolean-valued-block-with-one-argument supplied evaluates to true when provided the DescriptionForPartsBin" | info more | (self class includesSelector: #descriptionForPartsBin) ifTrue: [info _ self descriptionForPartsBin. (aBlock value: info) ifTrue: [aList add: {info globalReceiverSymbol. info nativitySelector. info formalName. info documentation. info sampleImageFormOrNil}]]. (self class includesSelector: #supplementaryPartsDescriptions) ifTrue: [more _ self supplementaryPartsDescriptions. (more isKindOf: DescriptionForPartsBin) ifTrue: [more _ Array with: more]. "The above being a mild bit of forgiveness, so that in the usual only-one case, the user need not return a collection" more do: [:aPartsDescription | (aBlock value: aPartsDescription) ifTrue: [aList add: {aPartsDescription globalReceiverSymbol. aPartsDescription nativitySelector. aPartsDescription formalName. aPartsDescription documentation. aPartsDescription sampleImageFormOrNil}]]]! ! !ObjectsTool methodsFor: 'menu' stamp: 'sw 11/27/2001 13:30'! resetThumbnails "Reset the thumbnail cache" PartsBin clearThumbnailCache. modeSymbol == #categories ifFalse: [self showCategories] ifTrue: [self showAlphabeticTabs]! ! !PartsBin class methodsFor: 'thumbnail cache' stamp: 'sw 11/27/2001 13:32'! thumbnailForQuad: aQuint "Answer a thumbnail for a morph obtaining as per the quintuplet provided, creating the thumbnail if necessary. If it is created afresh, it will also be cached at this time" | aThumbnail aSymbol formToThumbnail | aSymbol _ aQuint third. ^ Thumbnails at: aSymbol ifAbsent: [formToThumbnail _ ((aQuint size >= 5) and: [aQuint fifth notNil]) ifTrue: [aQuint fifth] ifFalse: [((Smalltalk at: aQuint first) perform: aQuint second) imageForm]. aThumbnail _ Thumbnail new makeThumbnailFromForm: formToThumbnail. self cacheThumbnail: aThumbnail forSymbol: aSymbol. ^ aThumbnail] "PartsBin initialize"! ! "Postscript:" PartsBin clearThumbnailCache. !