Chapter 5. Layout Managers

When a figure contains children, its layout manager is responsible for setting the bounds and location of each child. There is no implicit layout manager, so if no manager is provided, then the children are not displayed. Layout managers may use the preferred size of the figure as well as a constraint to position and size the children.

5.1 List Constraints

Constraints are extra data that the LayoutManager may require when positioning the children. For example, the XYLayout (see Section 5.3.7 on page 63) takes a Rectangle as its constraint which provides the location and size for the figure.

XYLayout layout = new XYLayout();root.setLayoutManager(layout);root.add(figures[0]);layout.setConstraint(figures[0], new Rectangle(10, ...

Get The Eclipse Graphical Editing Framework (GEF) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.