From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:52:28 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>VersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.HotDraw.TextFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.VersionFigure
VersionFigure is a Figure that is used to display a version of a program item. Subclasses must implement the following messages: accessing browse this method should open a browser on the specific version of the program item
</comment> <class> <name>PackageItemFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.VersionFigure</super> <private>false</private> none package <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.PackageItemFigure
PackageItemFigure is the version figure for items contained within packages (e.g., classes and methods). Instance Variables: package <Store.Package> the package we are contained within
</comment> <class> <name>VersionCodeTool</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.CodeTool</super> <private>false</private> none versionEditor <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.VersionCodeTool
VersionCodeTool is the code tool that displays a version history diagram of the selected item. Instance Variables: versionEditor <VersionDrawingEditor> the HotDraw diagram of the version history
</comment> <class> <name>VersionDrawingEditor</name> <environment>Refactory.Browser</environment> <super>Refactory.HotDraw.DrawingEditor</super> <private>false</private> none versionInformationHolder <imports> private Refactory.HotDraw.* private Store.* </imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.VersionDrawingEditor
VersionDrawingEditor is the drawing editor for the version history diagram. Instance Variables: versionInformationHolder <ValueHolder> a value holder that is used to display the information of the program item that the mouse is currently over
</comment> <class> <name>PundleVersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.VersionFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.PundleVersionFigure
PundleVersionFigure is the version figure for bundles and packages. Subclasses must implement the following messages: private codeComponent returns the package or bundle we are viewing
</comment> <class> <name>BundleVersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.PundleVersionFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.BundleVersionFigure
BundleVersionFigure is the version figure for a bundle.
</comment> <class> <name>ClassVersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.PackageItemFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.ClassVersionFigure
ClassVersionFigure is the version figure for a class.
</comment> <class> <name>MethodVersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.PackageItemFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.MethodVersionFigure
MethodVersionFigure is the version figure for a method.
</comment> <class> <name>VersionCodeToolSelectionPolicy</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.CodeToolSelectionPolicy</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.VersionCodeToolSelectionPolicy
VersionCodeToolSelectionPolicy is the code tool selection policy for the VersionCodeTool.
</comment> <class> <name>PackageVersionFigure</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.PundleVersionFigure</super> <private>false</private> none <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.PackageVersionFigure
PackageVersionFigure is the version figure for packages.
</comment> <class> <name>Tree</name> <environment>Refactory.Browser</environment> <super>Core.Object</super> <private>false</private> none figure subtrees tops bottoms <imports></imports> <category>Browser-StoreExtensions</category> <attributes> <package>RBStoreExtensions</package> </attributes> </class> <comment> Refactory.Browser.Tree
Tree is a helper class for the version code tool. It performs the layout of the nodes in the diagram. It makes an approximation of the optimal tree layout. Instance Variables: bottoms <OrderedCollection of: Integer> the bottoms of each level in the tree figure <Refactory.HotDraw.Figure> the version figure for us subtrees <SequenceableCollection of: Tree> our subtrees tops <OrderedCollection of: Integer> the tops of each level in the tree
</comment> <methods> Refactory.Browser.VersionFigure <category>displaying</category>
displayOn: aGraphicsContext super displayOn: aGraphicsContext. aGraphicsContext paint: ColorValue black. self isLoaded ifTrue: [aGraphicsContext lineWidth: 2]. self bounds displayStrokedOn: aGraphicsContext
</methods> <methods> Refactory.Browser.VersionFigure <category>initialize-release</category>
initialize super initialize. self opaque
label ^self storeRecord timeStampString
on: aPackage model := aPackage. self setParagraph: (self isLoaded ifTrue: [self label asText allBold] ifFalse: [self label]) asComposedText origin: 0 @ 0; bottomRight: self bottomRight + (7 @ 0); alignUsing: #centered
</methods> <methods> Refactory.Browser.VersionFigure <category>testing</category>
isLoaded ^false "This is hard to compute for some code components"
</methods> <methods> Refactory.Browser.VersionFigure <category>accessing</category>
browse self subclassResponsibility
compareVersionTo: aStoreSourceObject
menuAt: aPoint | mb | mb := MenuBuilder new. mb add: (#Inspect << #browser >> 'Inspect') -> #inspect; line; add: (#Browse << #browser >> 'Browse') -> [self browse]; add: (#Load << #browser >> 'Load') -> #loadSrc. ^mb menu
primaryKey ^self storeRecord primaryKey
storeRecord ^model
timestamp ^self storeRecord timeStamp
trace ^self storeRecord trace
versionInformation ^((#UserC1sTimeC2s << #browser >> 'User: <1s>; Time: <2s>') expandMacrosWith: self storeRecord userName with: self storeRecord timeStampString)
</methods> <methods> Refactory.Browser.VersionFigure class <category>instance creation</category>
on: storeRecord ^(self new) on: storeRecord; yourself
</methods> <methods> Refactory.Browser.PackageItemFigure <category>accessing</category>
package ^package
package: aPackageModel package := aPackageModel
</methods> <methods> Refactory.Browser.PackageItemFigure class <category>instance creation</category>
on: aClassRecord package: aPackageModel ^(self on: aClassRecord) package: aPackageModel; yourself
</methods> <methods> Refactory.Browser.VersionCodeTool <category>updating</category>
updateContents super updateContents. self updateDrawing
updateDisplay super updateDisplay. self updateDrawing
updateDrawing [self selector notNil ifTrue: [^self versionEditor displaySelector: self selector in: self selectedClass]. self nonMetaClass notNil ifTrue: [^self versionEditor displayClass: self nonMetaClass]. self pundle isNil ifTrue: [self versionEditor clearDrawing] ifFalse: [self pundle isPackage ifTrue: [self versionEditor displayPackage: self package] ifFalse: [self versionEditor displayBundle: self pundle]]] on: Error do: [:ex | ex return]
</methods> <methods> Refactory.Browser.VersionCodeTool <category>accessing</category>
versionEditor "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." ^versionEditor isNil ifTrue: [versionEditor := VersionDrawingEditor new] ifFalse: [versionEditor]
</methods> <methods> Refactory.Browser.VersionCodeTool <category>private</category>
resetBuilder super resetBuilder. versionEditor := nil
</methods> <methods> Refactory.Browser.VersionCodeTool <category>tab APIs</category>
isActive ^(#{Store.DbRegistry} valueOrDo: [^false]) isOnlineImage and: [codeModel state mostSpecificObject isKindOf: Store.PundleModel]
tabName ^(#VersionHistory << #browser >> 'Version History') asString
</methods> <methods> Refactory.Browser.VersionCodeTool class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.VersionDrawingEditor <category>accessing</category>
clearDrawing self drawing removeAll: self drawing figures copy
displayBundle: aBundleModel | bundles | bundles := Bundle allVersionsWithName: aBundleModel name. self displayFigures: (bundles collect: [:each | BundleVersionFigure on: each])
displayClass: aClass | classRecords package | classRecords := ClassRecord allVersionsWithName: aClass name. package := Registry containingPackageForClass: aClass. self displayFigures: (classRecords collect: [:each | ClassVersionFigure on: each package: package])
displayNameSpace: aNameSpace | nameSpaces | nameSpaces := NameSpaceRecord allVersionsWithName: aNameSpace name. self displayFigures: (nameSpaces collect: [:each | VersionFigure on: each])
displayPackage: aPackageModel | packages | packages := Package allVersionsWithName: aPackageModel name. self displayFigures: (packages collect: [:each | PackageVersionFigure on: each])
displaySelector: aSelector in: aClass | methods package | methods := Method allMethodVersionsNamed: aSelector inClass: aClass absoluteSymbol meta: aClass isMeta. package := (Registry allContainingPackagesForSelector: aSelector class: aClass) detect: [:each | true] ifNone: [nil]. self displayFigures: (methods collect: [:each | MethodVersionFigure on: each package: package])
</methods> <methods> Refactory.Browser.VersionDrawingEditor <category>interface opening</category>
postBuildWith: aBuilder super postBuildWith: aBuilder. builder window damageRepairPolicy: DoubleBufferingWindowDisplayPolicy new
</methods> <methods> Refactory.Browser.VersionDrawingEditor <category>aspects</category>
versionInformationHolder "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." ^versionInformationHolder isNil ifTrue: [versionInformationHolder := String new asValue] ifFalse: [versionInformationHolder]
</methods> <methods> Refactory.Browser.VersionDrawingEditor <category>layout</category>
displayFigures: figures | map traceMap previousMap | self clearDrawing. traceMap := Dictionary new. figures do: [:each | traceMap at: each primaryKey put: each]. map := Dictionary new. previousMap := Dictionary new. figures do: [:each | | figure | figure := traceMap at: each trace ifAbsent: [nil]. figure notNil ifTrue: [previousMap at: each put: figure. (map at: figure ifAbsentPut: [SortedCollection sortBlock: [:a :b | a timestamp < b timestamp]]) add: each] ifFalse: [previousMap at: each put: nil]]. figures do: [:each | each translateTo: self xSeparation @ self ySeparation]. self layoutFiguresUsingForwardMap: map backwardMap: previousMap. previousMap keysAndValuesDo: [:key :value | value notNil ifTrue: [figures add: (key connectFromPoint: key center to: value at: value center)]]. drawing addAll: figures; recomputePreferredBounds; mergeBounds: (0 @ 0 corner: 1 @ 1)
layoutFiguresUsingForwardMap: map backwardMap: previousMap | initialNodes root trees | initialNodes := (previousMap keys select: [:each | (previousMap at: each) isNil]) asSortedCollection: [:a :b | a timestamp < b timestamp]. trees := initialNodes collect: [:each | self treeFor: each using: map]. root := Tree figure: (RectangleFigure createAt: self xSeparation negated @ self ySeparation) subtrees: trees. root layoutWithSpacing: self xSeparation @ self ySeparation
treeFor: aFigure using: mapDictionary ^Tree figure: aFigure subtrees: ((mapDictionary at: aFigure ifAbsent: [#()]) collect: [:each | self treeFor: each using: mapDictionary])
xSeparation ^20
ySeparation ^20
</methods> <methods> Refactory.Browser.VersionDrawingEditor <category>drawing description</category>
toolNames ^(Array with: (#VersionTool << #browser >> 'Version Tool') asString)
</methods> <methods> Refactory.Browser.VersionDrawingEditor class <category>opening</category>
openOnBundle: aBundleModel "self openOnBundle: (Store.Registry bundleNamed: 'RefactoringBrowser')" (self new) displayBundle: aBundleModel; open
openOnClass: aClass "self openOnClass: Refactoring" (self new) displayClass: aClass; open
openOnNameSpace: aNameSpace "self openOnNameSpace: Refactory.Browser" (self new) displayNameSpace: aNameSpace; open
openOnPackage: aPackageModel "self openOnPackage: (Store.Registry packageNamed: 'RBBrowserUI')" (self new) displayPackage: aPackageModel; open
openOnSelector: aSelector in: aClass "self openOnSelector: #execute in: Refactoring" (self new) displaySelector: aSelector in: aClass ; open
</methods> <methods> Refactory.Browser.VersionDrawingEditor class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.PundleVersionFigure <category>testing</category>
isLoaded | bundleModel | bundleModel := self codeComponent. bundleModel isNil ifTrue: [^false]. ^bundleModel dbTrace = self storeRecord primaryKey
</methods> <methods> Refactory.Browser.PundleVersionFigure <category>private</category>
codeComponent ^self subclassResponsibility
connectToDatabaseName | names | names := Store.ConnectionDialog profiles collect: [:each | each name]. ^Dialog choose: (#SelectADatabaseToReplicateToC << #browser >> 'Select a database to replicate to:') fromList: names values: names lines: 8 cancel: [nil]
label ^self storeRecord version
listContents (#{Store.PundlesTool} valueOrDo: [^self]) openOnPublishedBlock: [self model containedItems asList] sendUpdatesFor: #() windowTitle: self model printString
replicateTo: aString self subclassResponsibility
</methods> <methods> Refactory.Browser.PundleVersionFigure <category>accessing</category>
browse TabApplicationSystemBrowser openOnPackage: self model
menuAt: aPoint | mb | mb := MenuBuilder new. mb add: (#Inspect << #browser >> 'Inspect') -> #inspect; line; add: (#Browse << #browser >> 'Browse') -> [self browse]. self model isBundle ifTrue: [mb add: (#ListContents << #browser >> 'List Contents') -> #listContents]. mb line; add: (#Load << #browser >> 'Load') -> #loadSrc; add: (#MergeIntoImage << #browser >> 'Merge Into Image') -> [Store.DbRegistry doIfOnlineImage: [Store.MergeTool openOnPundles: (Array with: self storeRecord)]]; add: (#Reconcile << #browser >> 'Reconcile') -> [self model getImagePundle reconcileWithDbVersion: self model]; line; add: (#FileOut << #browser >> 'File Out') -> #fileOut; line; add: (#CompareWithImage << #browser >> 'Compare with Image') -> [self compareVersionTo: self model getImagePundle]; line; add: (#SetBlessingLevel << #browser >> 'Set Blessing Level') -> [Store.BlessingDialog setBlessingFor: self model]; line. #{Refactory.StoreReplication.Replicator} isDefined ifTrue: [mb add: (#ReplicateToDots << #browser >> 'Replicate to...') -> #replicate]. ^mb menu
replicate | name | name := self connectToDatabaseName. name isNil ifTrue: [^self]. Cursor wait showWhile: [self replicateTo: name]
versionInformation ^((#x1sBlessingC2s << #browser >> '<1s>; Blessing: <2s>') expandMacrosWith: super versionInformation with: self storeRecord blessingLevelString)
</methods> <methods> Refactory.Browser.BundleVersionFigure <category>private</category>
codeComponent ^#{Store.Registry} value bundleNamed: self storeRecord name
replicateTo: aString Notice showNotice: (#Replicating << #browser >> 'Replicating') complete: 0 while: [(#{Refactory.StoreReplication.Replicator} value new) connectTo: aString; replicateSingleBundle: self model; disconnect] title: (#Store << #browser >> 'Store')
</methods> <methods> Refactory.Browser.BundleVersionFigure <category>accessing</category>
compareVersionTo: aPundle #{Store.BundleDifferenceBrowser} value compare: self storeRecord with: aPundle
</methods> <methods> Refactory.Browser.ClassVersionFigure <category>accessing</category>
browse TabApplicationSystemBrowser openOnPackage: self package classOrNameSpace: self model
compareVersionTo: aClassRecord #{Store.ComparisonBrowser} value compareClass: self storeRecord toClass: aClassRecord
</methods> <methods> Refactory.Browser.MethodVersionFigure <category>accessing</category>
browse TabApplicationSystemBrowser openOnPackage: self package methods: (Array with: self model)
compareVersionTo: aMethod (Differator newOn: self storeRecord sourceCode and: aMethod sourceCode) open
</methods> <methods> Refactory.Browser.VersionCodeToolSelectionPolicy <category>accessing-classes</category>
codeToolClassForBundle: aBundleModel ^VersionCodeTool
codeToolClassForClass: aBehavior ^VersionCodeTool
codeToolClassForPackage: aPackageModel ^VersionCodeTool
codeToolClassForSelector: aSymbol andClass: aBehavior ^VersionCodeTool
</methods> <methods> Refactory.Browser.VersionCodeToolSelectionPolicy <category>accessing</category>
name ^(#VersionHistory << #browser >> 'Version History') asString
toolClass ^(#{Store.DbRegistry} valueOrDo: [^nil]) isOnlineImage ifTrue: [super toolClass] ifFalse: [nil]
</methods> <methods> Refactory.Browser.VersionCodeToolSelectionPolicy class <category>class initialization</category>
initialize (CodeModel dependents includes: self) ifFalse: [CodeModel addDependent: self]. self addSelectionPolicy
obsolete CodeModel removeDependent: self. self removeSelectionPolicy. ^super obsolete
</methods> <methods> Refactory.Browser.PackageVersionFigure <category>private</category>
codeComponent ^#{Store.Registry} value packageNamed: self storeRecord name
replicateTo: aString Notice showNotice: (#Replicating << #browser >> 'Replicating') complete: 0 while: [(#{Refactory.StoreReplication.Replicator} value new) connectTo: aString; replicateSinglePackage: self model; disconnect] title: (#Store << #browser >> 'Store')
</methods> <methods> Refactory.Browser.PackageVersionFigure <category>accessing</category>
compareVersionTo: aPundle #{Store.ComparisonBrowser} value comparePackage: self storeRecord toPackage: aPundle
</methods> <methods> Refactory.Browser.Tree <category>layout</category>
addBottomsFrom: aTree aTree bottoms keysAndValuesDo: [:index :each | index > bottoms size ifTrue: [bottoms add: each] ifFalse: [(bottoms at: index) < each ifTrue: [bottoms at: index put: each]]]
addSubtreesInto: aCollection level: aNumber aCollection size < aNumber ifTrue: [aCollection add: OrderedCollection new]. (aCollection at: aNumber) add: figure. subtrees do: [:each | each addSubtreesInto: aCollection level: aNumber + 1]
addTopsFrom: aTree aTree tops keysAndValuesDo: [:index :each | index > tops size ifTrue: [tops add: each] ifFalse: [(tops at: index) > each ifTrue: [tops at: index put: each]]]
bottom ^bottoms inject: 0 into: [:sum :each | sum max: each]
bottoms ^bottoms
layoutBelow: aCollection space: aNumber | moveDistance top bottom | moveDistance := 0. 1 to: (self tops size max: aCollection size) do: [:index | top := index > self tops size ifTrue: [SmallInteger maxVal] ifFalse: [self tops at: index]. bottom := index > aCollection size ifTrue: [SmallInteger minVal] ifFalse: [aCollection at: index]. moveDistance := moveDistance max: bottom + aNumber - top]. moveDistance ~~ 0 ifTrue: [self moveDownBy: moveDistance]
layoutWithHorizontalSpacing: aNumber | levels | levels := OrderedCollection new. self addSubtreesInto: levels level: 1. levels inject: aNumber negated into: [:x :collection | | max | max := collection inject: 0 into: [:sum :each | sum max: each extent x]. collection do: [:each | each translateBy: (x) @ 0]. x + max + aNumber]
layoutWithSpacing: aPoint self layoutWithHorizontalSpacing: aPoint x; layoutWithVerticalSpacing: aPoint y
layoutWithVerticalSpacing: aNumber subtrees do: [:each | each layoutWithVerticalSpacing: aNumber]. subtrees isEmpty ifTrue: [tops := OrderedCollection with: figure top. bottoms := OrderedCollection with: figure bottom. ^self]. tops := OrderedCollection withAll: subtrees first tops. bottoms := OrderedCollection withAll: subtrees first bottoms. 2 to: subtrees size do: [:index | | each | each := subtrees at: index. each layoutBelow: bottoms space: aNumber. self addBottomsFrom: each; addTopsFrom: each]. figure translateTo: figure left @ ((self bottom + self top) // 2 - (figure extent // 2) y). tops addFirst: figure top. bottoms addFirst: figure bottom
moveDownBy: aNumber figure translateBy: 0 @ aNumber. subtrees do: [:each | each moveDownBy: aNumber]. tops notNil ifTrue: [tops := tops collect: [:each | each + aNumber]]. bottoms notNil ifTrue: [bottoms := bottoms collect: [:each | each + aNumber]]
top ^tops inject: SmallInteger maxVal into: [:sum :each | sum min: each]
tops ^tops
</methods> <methods> Refactory.Browser.Tree <category>initialize-release</category>
figure: aFigure subtrees: aTreeCollection figure := aFigure. subtrees := aTreeCollection
</methods> <methods> Refactory.Browser.Tree class <category>instance creation</category>
figure: aFigure subtrees: aTreeCollection ^(self new) figure: aFigure subtrees: aTreeCollection; yourself
</methods> <methods> Refactory.HotDraw.Tool class <category>tool states</category>
versionInformationToolStates "This method was automatically generated by the HotDraw ToolStateMachineEditor. To edit this method, evaluate the comment below" "| states transitions stateTable | states := ((Core.OrderedCollection new) add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Version Tool'; instVarAt: 3 put: '[:tool :event | ]'; instVarAt: 4 put: (Core.Point x: 242 y: 51); instVarAt: 5 put: false; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Update Information'; instVarAt: 3 put: '[:tool :event | tool drawing model versionInformationHolder value: (tool figureAtEvent: event) versionInformation]'; instVarAt: 4 put: (Core.Point x: 42 y: 139); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Clear Information'; instVarAt: 3 put: '[:tool :event | tool drawing model versionInformationHolder value: '''']'; instVarAt: 4 put: (Core.Point x: 24 y: 63); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Menu'; instVarAt: 3 put: '[:tool :event | ]'; instVarAt: 4 put: (Core.Point x: 563 y: 96); instVarAt: 5 put: false; instVarAt: 6 put: true; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Compare Editions'; instVarAt: 3 put: '[:tool :event | | startFigure endFigure origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true. startFigure := tool valueAt: #figure. endFigure := tool figureAtEvent: event. startFigure ~~ endFigure ifTrue: [startFigure compareVersionTo: endFigure model]]'; instVarAt: 4 put: (Core.Point x: 392 y: 479); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Mouse Press Compare'; instVarAt: 3 put: '[:tool :event | | startPoint | startPoint := tool cursorPointFor: event. tool valueAt: #figure put: (tool figureAtEvent: event); valueAt: #startPoint put: startPoint; valueAt: #lastPoint put: startPoint]'; instVarAt: 4 put: (Core.Point x: 409 y: 250); instVarAt: 5 put: false; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Abort Compare'; instVarAt: 3 put: '[:tool :event | | origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true]'; instVarAt: 4 put: (Core.Point x: 651 y: 338); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Move Mouse Compare'; instVarAt: 3 put: '[:tool :event | | currentPoint origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true. currentPoint := tool cursorPointFor: event. (LineSegment from: currentPoint to: origin) displayStrokedOn: tool graphicsContext. tool valueAt: #lastPoint put: currentPoint]'; instVarAt: 4 put: (Core.Point x: 333 y: 363); instVarAt: 5 put: false; instVarAt: 6 put: false; yourself); add: (Refactory.HotDraw.ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Browse'; instVarAt: 3 put: '[:tool :event | (tool figureAtEvent: event) browse]'; instVarAt: 4 put: (Core.Point x: 41 y: 311); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); yourself). stateTable := Dictionary new. states do: [:each | stateTable at: each name put: each]. transitions := OrderedCollection new. transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Version Tool'); to: (stateTable at: 'Update Information'); type: (Refactory.HotDraw.FigureTransitionType basicNew instVarAt: 1 put: #mouseMove; instVarAt: 2 put: ((Core.Array new: 1) at: 1 put: Refactory.Browser.VersionFigure; yourself); yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 265.43 y: 80.5707); add: (Core.Point x: 150.195 y: 143.964); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Version Tool'); to: (stateTable at: 'Clear Information'); type: (Refactory.HotDraw.TransitionType basicNew instVarAt: 1 put: #mouseMove; yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 241.915 y: 69.5427); add: (Core.Point x: 131.537 y: 76.3101); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Version Tool'); to: (stateTable at: 'Menu'); type: (Refactory.HotDraw.FigureTransitionType basicNew instVarAt: 1 put: #yellowButtonPress; instVarAt: 2 put: ((Core.Array new: 1) at: 1 put: Refactory.Browser.VersionFigure; yourself); yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 324.541 y: 62.9899); add: (Core.Point x: 562.311 y: 110.264); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Mouse Press Compare'); to: (stateTable at: 'Abort Compare'); type: (Refactory.HotDraw.TransitionType basicNew instVarAt: 1 put: #redButtonRelease; yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 490.195 y: 280.607); add: (Core.Point x: 666.255 y: 340.395); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Version Tool'); to: (stateTable at: 'Mouse Press Compare'); type: (Refactory.HotDraw.FigureTransitionType basicNew instVarAt: 1 put: #redButtonPress; instVarAt: 2 put: ((Core.Array new: 1) at: 1 put: Refactory.Browser.VersionFigure; yourself); yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 287.299 y: 82.8945); add: (Core.Point x: 453.078 y: 249.629); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Move Mouse Compare'); to: (stateTable at: 'Compare Editions'); type: (Refactory.HotDraw.FigureTransitionType basicNew instVarAt: 1 put: #redButtonRelease; instVarAt: 2 put: ((Core.Array new: 1) at: 1 put: Refactory.Browser.VersionFigure; yourself); yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 400.748 y: 394.919); add: (Core.Point x: 439.343 y: 478.161); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Move Mouse Compare'); to: (stateTable at: 'Abort Compare'); type: (Refactory.HotDraw.TransitionType basicNew instVarAt: 1 put: #redButtonRelease; yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 403.384 y: 394.802); add: (Core.Point x: 655.286 y: 361.385); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Move Mouse Compare'); to: (stateTable at: 'Move Mouse Compare'); type: (Refactory.HotDraw.TransitionType basicNew instVarAt: 1 put: #mouseMove; yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 332.332 y: 381.272); add: (Core.Point x: 274 y: 394); add: (Core.Point x: 283 y: 410); add: (Core.Point x: 354.489 y: 390.475); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Mouse Press Compare'); to: (stateTable at: 'Move Mouse Compare'); type: (Refactory.HotDraw.TransitionType basicNew instVarAt: 1 put: #mouseMove; yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 478.62 y: 281.598); add: (Core.Point x: 436.549 y: 363.49); yourself); yourself). transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Version Tool'); to: (stateTable at: 'Browse'); type: (Refactory.HotDraw.FigureTransitionType basicNew instVarAt: 1 put: #doubleClick; instVarAt: 2 put: ((Core.Array new: 1) at: 1 put: Refactory.Browser.VersionFigure; yourself); yourself); points: ((Core.OrderedCollection new) add: (Core.Point x: 275.523 y: 81.8984); add: (Core.Point x: 62.8048 y: 310.398); yourself); yourself). ToolStateMachineEditor openWithStates: states connections: transitions" Tool states at: 'Version Tool' put: (ToolState name: 'Version Tool' command: [:tool :event | ]). Tool states at: 'Update Information' put: (EndToolState name: 'Update Information' command: [:tool :event | tool drawing model versionInformationHolder value: (tool figureAtEvent: event) versionInformation]). Tool states at: 'Clear Information' put: (EndToolState name: 'Clear Information' command: [:tool :event | tool drawing model versionInformationHolder value: '']). Tool states at: 'Compare Editions' put: (EndToolState name: 'Compare Editions' command: [:tool :event | | startFigure endFigure origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true. startFigure := tool valueAt: #figure. endFigure := tool figureAtEvent: event. startFigure ~~ endFigure ifTrue: [startFigure compareVersionTo: endFigure model]]). Tool states at: 'Mouse Press Compare' put: (ToolState name: 'Mouse Press Compare' command: [:tool :event | | startPoint | startPoint := tool cursorPointFor: event. tool valueAt: #figure put: (tool figureAtEvent: event); valueAt: #startPoint put: startPoint; valueAt: #lastPoint put: startPoint]). Tool states at: 'Abort Compare' put: (EndToolState name: 'Abort Compare' command: [:tool :event | | origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true]). Tool states at: 'Move Mouse Compare' put: (ToolState name: 'Move Mouse Compare' command: [:tool :event | | currentPoint origin | origin := tool valueAt: #startPoint. tool drawing invalidateRectangle: (Rectangle vertex: origin vertex: (tool valueAt: #lastPoint)) repairNow: true. currentPoint := tool cursorPointFor: event. (LineSegment from: currentPoint to: origin) displayStrokedOn: tool graphicsContext. tool valueAt: #lastPoint put: currentPoint]). Tool states at: 'Browse' put: (EndToolState name: 'Browse' command: [:tool :event | (tool figureAtEvent: event) browse]). (Tool stateFor: 'Version Tool') yellowButtonPress: ((FigureTransitionTable new) on: Refactory.Browser.VersionFigure goto: (Tool stateFor: 'Menu'); yourself). (Tool stateFor: 'Version Tool') redButtonPress: ((FigureTransitionTable new) on: Refactory.Browser.VersionFigure goto: (Tool stateFor: 'Mouse Press Compare'); yourself). (Tool stateFor: 'Version Tool') mouseMove: ((FigureTransitionTable new) on: Refactory.Browser.VersionFigure goto: (Tool stateFor: 'Update Information'); goto: (Tool stateFor: 'Clear Information'); yourself). (Tool stateFor: 'Version Tool') doubleClick: ((FigureTransitionTable new) on: Refactory.Browser.VersionFigure goto: (Tool stateFor: 'Browse'); yourself). (Tool stateFor: 'Move Mouse Compare') redButtonRelease: ((FigureTransitionTable new) on: Refactory.Browser.VersionFigure goto: (Tool stateFor: 'Compare Editions'); goto: (Tool stateFor: 'Abort Compare'); yourself). (Tool stateFor: 'Move Mouse Compare') mouseMove: ((SimpleTransitionTable new) goto: (Tool stateFor: 'Move Mouse Compare'); yourself). (Tool stateFor: 'Mouse Press Compare') redButtonRelease: ((SimpleTransitionTable new) goto: (Tool stateFor: 'Abort Compare'); yourself). (Tool stateFor: 'Mouse Press Compare') mouseMove: ((SimpleTransitionTable new) goto: (Tool stateFor: 'Move Mouse Compare'); yourself).
</methods> <methods> Refactory.Browser.VersionCodeTool class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #DrawingEditor #defaultString: 'Drawing Editor' #catalogID: #browser) #bounds: #(#{Graphics.Rectangle} 800 600 1355 1080 ) #colors: #(#{UI.LookPreferences} ) #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 0 1 ) #name: #versionEditor #flags: 0 #majorKey: #{Refactory.Browser.VersionDrawingEditor} #minorKey: #windowSpec #clientKey: #versionEditor ) ) ) )
</methods> <methods> Refactory.Browser.VersionDrawingEditor class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #DrawingEditor #defaultString: 'Drawing Editor' #catalogID: #browser) #bounds: #(#{Graphics.Rectangle} 800 600 1355 1080 ) #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.ArbitraryComponentSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 -28 1 ) #flags: 11 #component: #drawing ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 -28 1 0 1 0 1 ) #flags: 0 #model: #versionInformationHolder #tabable: false #isReadOnly: true ) ) ) )
</methods> <methods> Refactory.Browser.CodeModel class <category>tool registration</category>
versionCodeToolClass <tool> ^VersionCodeTool
</methods> <initialize> Refactory.Browser.VersionCodeToolSelectionPolicy </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>TextFigure</name> <environment>Refactory.HotDraw</environment> <super>Refactory.HotDraw.Figure</super> <private>false</private> none paragraph selection <imports></imports> <category>HotDraw-Figures</category> <attributes> <package>HotDraw Framework</package> </attributes> </class> <class> <name>CodeTool</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserApplicationModel</super> <private>false</private> none codeModel menu <imports></imports> <category>Browser-Code Tools</category> <attributes> <package>Browser-BrowserUI</package> </attributes> </class> <class> <name>CodeToolSelectionPolicy</name> <environment>Refactory.Browser</environment> <super>Core.Object</super> <private>false</private> none codeModel <imports></imports> <category>Browser-Code Tool Selection Policies</category> <attributes> <package>Browser-BrowserUI</package> </attributes> </class> <class> <name>DrawingEditor</name> <environment>Refactory.HotDraw</environment> <super>UI.ApplicationModel</super> <private>false</private> none buttons drawing <imports></imports> <category>HotDraw-Framework</category> <attributes> <package>HotDraw Framework</package> </attributes> </class>