Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
Last active September 14, 2016 11:37
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 peteruhnak/b62c776bcb93dedb849b to your computer and use it in GitHub Desktop.
Save peteruhnak/b62c776bcb93dedb849b to your computer and use it in GitHub Desktop.
Roassal questions

Roassal questions

Q: What is the exact difference between Equidistant and Weighted layouts?

Q: Why is RTHorizontalFlowLayout named horizontal, if it flows in columns from top to bottom?

My expectation (and Kilon's as well) is that the name should be based on elements flow. So since elements in RTHorizontalFlowLayout flow from top to bottom, RTVerticalFlowLayout seems more correct.

For comparision:

layouts

(image generated with https://gist.github.com/peteruhnak/c1537ffcccddf86ac389 )

Q: Shouldn't there be protocols for left/right alignment in RTFlowLayout?

If I have elements organized in columns I can align them to the left by using alignTop, and to right by alignBottom (this is derived from RTAbstractFlowLayout). But since it is in columns, it would make more sense to have alignLeft and alignRight.

Also I can limit the width of a line in horizontal flow with maxWidth:, so shouldn't there be also limit for vertical flow column height maxHeight:?

=> Pierre worked on this. I am forwarding the email to him.

Q: Why one cannot specify alignment for RTAbstractGridLayout?

This seems like oversight.

=> We could do that. But the makes the code with a lot of ifTrue:ifFalse:. Things that I would like to avoid.

By RTAbstractGridLayout I meant both RTCellLayout and RTGridLayout; neither of them provide alignment support.

Bug: RTCellLayout layouting issues

| v es |
v := RTView new.
es := (RTBox new size: 20) elementsOn: (1 to: 15).
v addAll: es.
RTCellLayout new
	gapSize: 10;
	on: es.

v

issues:

  • first line is misaligned
  • gapSize: is only applied to x-axis

=> Indeed. You’re right. I am wondering what the RTCellLayout is useful for. Juraj worked on it. I will ask him.

Q: RTTreeLayout - Doubled lines?

When I apply tree layout to the following presentation all lines are duplicated. On top of the expected ones (blue lines originating from center) there are also gray lines originating from the borders of the elements. But if I change the layout to dominance tree they disappear.

| view classes b | 
view := RTView new.
view @ RTDraggableView @ RTZoomableView.

classes := RTShape withAllSubclasses, TRShape withAllSubclasses.

b := RTMondrian new.
b view:view.
b shape circle.
b nodes: classes. 
b edges connectFrom: #superclass.

b shape line
     color: (Color blue alpha: 0.2).
b edges notUseInLayout; connectToAll: #dependentClasses.
b normalizer
    normalizeSize: #numberOfMethods using: #sqrt;
    normalizeColor: #numberOfMethods using: (Array with: Color green with: Color red) using: #sqrt.
b layout tree. "<--- double lines"
"b layout dominanceTree." "<--- single lines"
b build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment