'From Squeak3.7alpha of ''11 September 2003'' [latest update: #5420] on 2 October 2003 at 11:59:08 am'! "Change Set: KCP-0097-PointOrNil Date: 2 October 2003 Author: Stephane Ducasse and Alexandre Bergel VERSION 2 Move obtainArrowheadFor:defaultValue: from Utilities to Morph as it was the only sender with morph. Update morph accordingly. Note that now obtainArrowheadFor:defaultValue: only accept point and not coma separated number as it was the only way it was used. Refactor a bit the magic number that represent the default arrow head size and introduce a method for it."! !Morph methodsFor: 'menus'! defaultArrowheadSize ^ self class defaultArrowheadSize! ! !Morph methodsFor: 'menus'! setArrowheads "Let the user edit the size of arrowheads for this object" | aParameter result | aParameter _ self renderedMorph valueOfProperty: #arrowSpec ifAbsent: [Preferences parameterAt: #arrowSpec ifAbsent: [self defaultArrowheadSize]]. result _ self class obtainArrowheadFor: 'Head size for arrowheads: ' defaultValue: aParameter asString. result ifNotNil: [self renderedMorph setProperty: #arrowSpec toValue: result] ifNil: [self beep]! ! !Morph class methodsFor: 'arrow head size'! defaultArrowheadSize ^ 5 @ 4! ! !Morph class methodsFor: 'arrow head size'! obtainArrowheadFor: aPrompt defaultValue: defaultPoint "Allow the user to supply a point to serve as an arrowhead size. Answer nil if we fail to get a good point" | result | result := FillInTheBlank request: aPrompt initialAnswer: defaultPoint asString. result isEmptyOrNil ifTrue: [^ nil]. ^ [(Point readFrom: (ReadStream on: result))] on: Error do: [:ex | nil].! ! Utilities class removeSelector: #obtainArrowheadFor:defaultValue:! Utilities class removeSelector: #pointOrNilFrom:! Preferences class removeSelector: #defaultArrowheadSize! Preferences class removeSelector: #obtainArrowheadFor:defaultValue:! Preferences class removeSelector: #setArrowheads!