Hi Leonel In CodeCity the components are laid out starting with the inner components and continuing with the next outer component level. When translating a component, I needed to make sure that its inner components move together with it.From what I see in your result, it looks like that could be the problem. I am not sure how translation is done in Roassal, but I hope this helps you move forward towards fixing the problem. CheersRicky _____________________________ From: Leonel Merino merino@inf.unibe.ch Sent: Friday, December 16, 2016 11:18 Subject: [Moose-dev] Re: CodeCity in latest Moose? To: Moose-related development moose-dev@list.inf.unibe.ch
Hi all, Thanks for the replies. Let me ask you one more question. As an exercise, I want to reproduce in Roassal2 the top view of CodeCity. So I took this script from CCScriptExamples>>cityOfJavaSystem:-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| models builder | models := MooseModel root allModels. builder := CCBuilder new. models notEmpty ifTrue: [ | namespaces classes classNormalizer packageNormalizer | builder packingLayout. namespaces := models first allModelNamespaces. classes := namespaces flatCollect: #classes. packageNormalizer := CCColorNormalizer new low: (Color gray: 0.6); high: (Color gray: 0.95); transformation: #nestingLevel; population: namespaces. builder shapeBuilder platform color: packageNormalizer. builder nodes: namespaces. classNormalizer := CCColorNormalizer new low: (Color gray: 0.25); high: Color blue; transformation: #numberOfLinesOfCode; population: classes. builder shapeBuilder box color: classNormalizer; height: #numberOfMethods; width: #numberOfAttributes; depth: #numberOfAttributes. builder nodes: classes. builder nest: namespaces node: #yourself in: #parentScope. builder nest: classes node: #yourself in: #namespaceScope ]. builder open-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-It produced this view: Then I produced the following Roassal2 script based on the nodes from the previous builder object:-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-v := RTView new.classes := builder nodes reject: [ :e | e model class = FAMIXNamespace ].packages := builder nodes select: [ :e | e model class = FAMIXNamespace ].els1 := (RTBox new height: #depth; width: #width; color: #color) elementsOn: classes.els2 := (RTBox new height: [ :e | e contentBoundingVolume depth ]; width: [ :e | e contentBoundingVolume width ]; color: #color) elementsOn: packages.els1 do: [ :e | e translateTo: (e model position x + (e model depth / 2)) @ (e model position z + (e model width / 2)) ].els2 do: [ :e | e translateTo: (e model position x + (e model contentBoundingVolume depth / 2)) @ (e model position z + (e model contentBoundingVolume width / 2)) ].v addAll: els2 , els1.els2 @ RTDraggable.v-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Although the boxes that represent classes seem correct, I have trouble positioning the boxes that corresponds to packages. Does anyone have an idea of how to fix this?
Best regards, Leonel MerinoPhD studentUniversity of Bern+41 78 405 43 38merino@inf.unibe.ch 2016-12-14 18:32 GMT+01:00 Stephan Eggermont stephan@stack.nl: A pre-spur pre-pharo5, that is.
Stephan
Verstuurd vanaf mijn iPhone
Op 14 dec. 2016 om 17:06 heeft Tudor Girba tudor@tudorgirba.com het volgende geschreven:
Code City should work in Pharo 5.
_______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev