Skip to content

Instantly share code, notes, and snippets.

@fuhrmanator
Last active March 23, 2018 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuhrmanator/a810408002d829b2946f2e454d74faae to your computer and use it in GitHub Desktop.
Save fuhrmanator/a810408002d829b2946f2e454d74faae to your computer and use it in GitHub Desktop.
Pharo sample to show UML
| 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