Question

We're integrating Draw2D/GEF into an application, and are encountering an issue with the standard layouts provided.

We have a collection (say 100) of elements that need to be displayed in a grid-like fashion. We implemented our view using a GraphViewer, and applied a GridLayoutAlgorithm.

This works almost as we'd like it to, but the one stipulation we haven't been able to meet is that each node must be of a constant, defined size. Say, 50x50 pixels. The current GridLayoutAlgorithm we're using resizes the nodes so that they all fit in the window. If our window is small, the 100 elements become minuscule. We would instead like them to fill the width, then wrap to multiple rows, with a vertical scrollbar.

For the life of me, I can't find a simple, straightforward way to accomplish this.

Was it helpful?

Solution

Kind of a bummer answer, but I just ended up writing my own subclass of a GridLayoutAlgorithm and did a bunch of the math by hand. Frustrating that this wasn't included out-of-the-box, but it works fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top