Drag of External window

I will try to explain my problem.

I have created an application with 2 dockable windows on the main frame. From the first window, I have implemented to open external docking frames on a button click. My external docking frame is correclty displayed on the top of the main frame. To implement it, I have used the external method of the CLocation class. When I move my external window above the main frame, it is automatically stacked on the top of the application and I don’t want this behaviour for my external windows. I would like to know if it is possible to deactivate easily this functionnality only for my external docking windows? :slight_smile:

Thanks,

Fabien

Hold down “shift” while moving around the Dockable. This is configurable by the property “DockRelocatorMode.SCREEN_MASK”. Also holding down “alt” should prevent stacking (configured by the property “DockRelocatorMode.NO_COMBINATION_MASK”). You can set a custom “ModifierMask” which is active if no button like “shift”, “ctrl”, … is pressed.

Thank you for the answer!

On which object can I set the DockRelatorMode property or the ModifierMask object?

Thanks,

Fab

Either

control.putProperty( DockRelocatorMode.SCREEN_MASK, customModifierMask );```
or
```DockController controller = ...
controller.getProperties().set( DockRelocatorMode.SCREEN_MASK, customModifierMask );```

If you want to implement a custom DockRelocatorMode, you can install it using
```DockController controller = ...
controller.getRelocator().addMode( yourNewMode );```

I would like to configure my CControl using:

control.putProperty(DockRelocatorMode.NO_COMBINATION_MASK, customModifierMask);

but I don’t know how to configure the ModifierMask in order to prevent stacking all the time?

Like this:


import java.awt.event.InputEvent;

import javax.swing.JFrame;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CGrid;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.control.DockRelocatorMode;
import bibliothek.gui.dock.control.ModifierMask;

public class Dock01 {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setBounds(20, 20, 400, 400);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		CControl control = new CControl( frame );
		frame.add(control.getContentArea());
		
		CGrid grid = new CGrid(control);
		grid.add(0, 0, 1, 1, new DefaultSingleCDockable("a", "A"));
		grid.add(0, 1, 1, 1, new DefaultSingleCDockable("b", "B"));
		control.getContentArea().deploy(grid);
		
		control.putProperty(DockRelocatorMode.NO_COMBINATION_MASK, new ModifierMask(0, InputEvent.CTRL_DOWN_MASK));
		
		frame.setVisible(true);
	}
}

Now you can’t stack anything unless you hold down the ctrl key.