Change DND behavior of DefaultSingleCDockable in a SplitDockStation

Hi all,

how can I change the be drag and drop behavior of DefaultSingleCDockable in a SplitDockStation.

I would like control the new size of DefaultSingleCDockable, if it is droped in the north, east, south or west. In these cases that the new size should be 50 percent of the size underlining DefaultSingleCDockable.

Currently I’m using 1.0.8

Thanks,
Martin

The exact behavior of the drop operation for SplitDockStations is controller by a SplitLayoutManager. The manager can be set through the property “SplitDockStation.LAYOUT_MANAGER”.

You can extend one of the existing SplitLayoutManagers. Starting from “DefaultSplitLayoutManager” you would have to override methods like “calculateDivider” or “calculateSideSnap” to accomplish your goals.

Hi Beni,

thanks for your help.

Here is my solution:

        PropertyKey<SplitLayoutManager> key = SplitDockStation.LAYOUT_MANAGER;
        control.putProperty(key, new DefaultSplitLayoutManager() {
            @Override
            public void calculateDivider(SplitDockStation station,
                    PutInfo putInfo, Leaf origin) {
                super.calculateDivider(station, putInfo, origin);
                putInfo.setDivider(0.5);
            }
        });```


Martin