From VisualWorks®, 7.6 of 8. Februar 2008 on 28. Februar 2008 at 6:33:13 (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>ADvanceDiagramTool</name> <environment>ICC.ADvance</environment> <super>Refactory.Browser.CodeTool</super> <private>false</private> none diagramPainter <imports></imports> <category>RBBrowserUI</category> <attributes> <package>ADvance2RefactoringBrowser</package> </attributes> </class> <comment> ICC.ADvance.ADvanceDiagramTool
ADvance - Refactoring Browser Integration Instance Variables: diagramPainter <AD2DiagramPainter> Viewer / Editor of the ADvance Subject. oldClassSelection <Class> description of oldClassSelection
</comment> <methods> ICC.ADvance.ADvanceDiagramTool <category>updating</category>
updateContents "Show the default diagram for the selected code node: - Class - Show the hierarchy diagram of the class' default subject (which is given by the class if the class is already used as an ADvance subject class, or created on the fly). - Package - Show the overview diagram of the package's default subject (which is given by the class PackageNameDefaultSubject if existing). - Parcel - Same as for package. Show diagram always fit to window, but do not treat that zoom change as a modification." | theSubject | (theSubject := self selectedSubject) notNil ifTrue: [self diagramPainter openDiagramOn: theSubject name: #RB. self diagramPainter fitToWindowMaxZoom: 1.0. self diagramPainter model beUnmodified]
updateRequest ^super updateRequest and: [self diagramPainter changeRequest]
</methods> <methods> ICC.ADvance.ADvanceDiagramTool <category>accessing</category>
diagramPainter diagramPainter isNil ifTrue: [diagramPainter := ICC.ADvance.AD2DiagramPainter new]. ^diagramPainter
selectedClass "ADvance subjects are always for instance behavior, so ensure that not meta is used." | selectedClassOrMeta | selectedClassOrMeta := super selectedClass. ^(selectedClassOrMeta notNil and: [selectedClassOrMeta isMeta]) ifTrue: [selectedClassOrMeta instanceBehavior] ifFalse: [selectedClassOrMeta]
</methods> <methods> ICC.ADvance.ADvanceDiagramTool <category>private</category>
selectedSubject "Answers the default subject for selected class (if a class is selcted) or for selected parcel / selected package else." self selectedClass notNil ifTrue: [^self subjectForClass: self selectedClass]. "self package answers first package of a selected bundle, so we have to check if indeed a package is selected." (self pundle notNil and: [self pundle isPackage]) ifTrue: [^self subjectForPackage: self pundle]. self parcel notNil ifTrue: [^self subjectForParcel: self parcel]. ^nil
subjectForClass: aClass "Answers a new Subject, if the class isn't a subject yet, and the already defined subject otherwise. In both cases, all super and subclasses are added to the subject (if there are too many subclasses (as for Object), only direct sublcasses are taken)." | theSubclasses | (theSubclasses := aClass allSubclasses) size > 100 ifTrue: [theSubclasses := #()]. ^(aClass isADvanceSubject ifTrue: [aClass advanceSubject] ifFalse: [(AD2Subject new) baseClass: aClass; name: (aClass name, ' (Default Class Subject)'); yourself]) addClasses: ((OrderedCollection with: aClass), theSubclasses, aClass allSuperclasses) saveNow: false; "saving is done only in case of diagram saving" yourself
subjectForPackage: aPackage "Answers the default subject of this package. It is given by class with name (aPackage name, 'DefaultSubject'), which is created on saving if not yet existing." | theSubjectClassOrNil theSubjectName | theSubjectName := aPackage name, ' (Default Package Subject)'. theSubjectClassOrNil := (self advance utils cleanStringFor: theSubjectName) asQualifiedReference valueOrDo: [nil]. ^((theSubjectClassOrNil notNil and: [theSubjectClassOrNil isADvanceSubject]) ifTrue: [theSubjectClassOrNil advanceSubject] ifFalse: [(AD2Subject new) baseClass: theSubjectClassOrNil; name: theSubjectName; yourself]) addClasses: (aPackage allClasses collect: [:eachClassDescriptor | eachClassDescriptor value]) saveNow: false; yourself
subjectForParcel: aParcel "Answers the default subject of this parcel. It is given by class with name (aParcel name, 'DefaultSubject'), which is created on saving if not yet existing." | theSubjectClassOrNil theSubjectName | theSubjectName := aParcel name, ' (Default Parcel Subject)'. theSubjectClassOrNil := (self advance utils cleanStringFor: theSubjectName) asQualifiedReference valueOrDo: [nil]. ^((theSubjectClassOrNil notNil and: [theSubjectClassOrNil isADvanceSubject]) ifTrue: [theSubjectClassOrNil advanceSubject] ifFalse: [(AD2Subject new) baseClass: theSubjectClassOrNil; name: theSubjectName; yourself]) addClasses: ((OrderedCollection withAll: aParcel definedClasses) addAll: aParcel extendedClasses; yourself) saveNow: false; yourself
</methods> <methods> ICC.ADvance.ADvanceDiagramTool <category>tab APIs</category>
isActive ^self selectedSubject notNil
tabName ^(#ADvanceDiagram << #browser >> 'ADvance Diagram') asString
</methods> <methods> ICC.ADvance.ADvanceDiagramTool class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> ICC.ADvance.ADvanceDiagramTool class <category>interface specs</category>
windowSpec "Tools.UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Unlabeled Canvas' #bounds: #(#{Graphics.Rectangle} 640 512 1163 895 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 0 1 ) #name: #diagramPainter #flags: 0 #majorKey: #{ICC.ADvance.AD2DiagramPainter} #minorKey: #windowSpec #clientKey: #diagramPainter ) ) ) )
</methods> <methods> Refactory.Browser.CodeModel class <category>tool registration</category>
advanceRBIToolClass <tool> ^ICC.ADvance.ADvanceDiagramTool
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <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>