How to create this layout programmatically

Hi all,
i stumbled across a problem, i wasn’t able to solve by myself or the documentation.
I am using the common library and wand to create a layout like this

I created this layout by dragging the views to the correct position.
Now i want to create this layout via java code. But i didn’t succeed, because it was impossible for me to create the docking layout you see to the right.
I tried many things, but i guess not the right ones.
Until now i only managed to arrange the views in a grid, but not in a grid with spanning rows/columns.

So i hope someone can give me a hint on how to create this type of layout.

Many thanks in advance!
Greetings, -chris-

How did you try to arrange them? A CGrid can definitely create this layout.

Hi Beni,
i did this:

CGrid grid = new CGrid(m_dockControl);
		
grid.add(1, 0, 1, 1, getRegisteredView(DeviceView.ID));
grid.add(0, 0, 0.15, 1, getRegisteredView(ButtonCtrlView.ID));
grid.add(2, 0, 0.2, 0.5, getRegisteredView(DevicesView.ID));
grid.add(2, 0, 0.2, 0.5, getRegisteredView(EventsView.ID));
		
CContentArea content = m_dockControl.getContentArea();
content.deploy(grid);

But to be honest, i don’t really understand how to handle the CGrid. I just tried it a couple times, but i didn’t find a way to span a dockable over to cells.

Thanks!
Greetings, -chris-

Just imagine a CGrid to be a JPanel with a null-layout and a Dockable a Component and child of this panel. Calling CGrid.add would have the same effect as calling Component.setBounds.

Try this:

CGrid grid = new CGrid(m_dockControl);
		
grid.add(0, 0, 25, 100, getRegisteredView(DeviceView.ID));
grid.add(25, 0, 50, 100, getRegisteredView(ButtonCtrlView.ID));
grid.add(75, 0, 25, 50, getRegisteredView(DevicesView.ID));
grid.add(75, 50, 25, 50, getRegisteredView(EventsView.ID));
		
CContentArea content = m_dockControl.getContentArea();
content.deploy(grid);

Damn! So simple?! Great!
Many thanks for your help!
Greetings, -chris-