Last active
March 23, 2018 15:14
-
-
Save fuhrmanator/a810408002d829b2946f2e454d74faae to your computer and use it in GitHub Desktop.
Pharo sample to show UML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| b classes targetClassNames | | |
classes := MooseModel root allModels first allClasses select: [:each | | |
(each container mooseName beginsWith:'edu::' ) and: (each name endsWith: 'Optimizer') ]. | |
"La doc sur les collections m'est toujours super utile: http://pharo.gforge.inria.fr/PBE1/PBE1ch10.html" | |
targetClassNames := Set withAll: #('CBMOptimizer','CBMSOptimizer','CBMUtilityOptimizer'). | |
view := RTView new. | |
view @ RTZoomableView. | |
b := RTUMLClassBuilder new | |
instanceVariables: #attributes; | |
methodselector: #name; | |
methodsNames: #methods; | |
view: view. | |
b attributeShape color: Color black. | |
b methodShape color: Color brown. | |
b classNameShape color: Color black. | |
b lineShape arrowedLine color: Color blue. | |
b boxShape borderColor: Color black. | |
b addObjects: (classes select: [:c | targetClassNames includes: c name ]). | |
b layout tree. | |
b build. | |
^ b view |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment