

So basically, the behaviour I want to achieve is like that of a text editor, which scrolls down if you just enter enough text (like the WYSIWYG text editor here on stackoverflow). However, if I have a lot of nodes in the graph, I want to display the vertical scrollbar, because as it is now, the nodes just disappear below the bottom end of the screen. This works well enough, so that when I resize the application window to a smaller size, the editor are gets smaller, and the node figures perform a quasi "line break" a la FlowLayout. To suppress the scrollbars, I have set tPreferredSize(new Dimension(getViewer().getControl().getSize())). This would be the point where usually the horizontal scrollbar appears. Its model children are Nodes, which should be displayed according to FlowLayout, i.e., one after the other, with "line breaks" when a node figure (a Label) would move beyond the visible part of the GraphicalViewer. GraphEditPart has a figure of type Layer, which is layed out with FlowLayout. Example of FlowLayout class: Using FlowLayout() constructor. FlowLayout(int align, int hgap, int vgap): creates a flow layout with the given alignment and the given horizontal and vertical gap. Example of FlowLayout class: Using FlowLayout() constructor FileName: FlowLayoutExample. FlowLayout(int align): creates a flow layout with the given alignment and a default 5 unit horizontal and vertical gap. The problem is to actualize the model's position after choosing some FlowLayout - because without doing it, after changing back to XYLayout old positions are loaded from the model. Each component in a FlowLayout gets as much space as it needs and no more. Then it begins a new row below it and moves from left to right again. FlowLayout when used arranges swing components from left to right until there’s no more space available. Every model itself contains its position and size, the boxes its layout, too. Java Swing Tutorial Explaining the FlowLayout.

if teher is No JRE and click on add jre tab and provide the directory location of the Jre and add that. FlowLayout(int align, int hgap, int vgap): creates a flow layout with the given alignment and the given horizontal and vertical gap. XYLayout and FlowLayout and the possibility to change them. and then replace the dependency of your project with the new JRE you installed in eclipse. I use SimpleRootEditPart for the GraphicalViewer. Or Add a new JRE in eclipse using Window>Preferences>Java>Installed JRE and locate the path of the JRE folder in your machine.

My editor extends GraphicalEditor, as I'm not needing a palette at all. There are two types of EditPart: 1) GraphEditPart, 2) NodeEditPart. I'm implementing a GEF editor and am facing the following problem.
