Resize priority when minimized

Hello,

I’m a new user of the DockingFrame API and experience an annoying issue whith a little piece of code.
I have several DefaultMultipleCDockable in a JFrame. As one is minimized, I would like to be able to define a priority for the remaining dockables to use the space relased by the minimized one.
I supposed this could be achived using ResizeRequest object but it does not seem so.

I’d also want to set the size of the button at the edge of the screen created when a dockable is minimized.

Thanks in advance for the help

About prioritizing the remaining space: The feature you require does not exist. ResizeRequest is only useful to set the size of a Dockable (or set of Dockables) one time. And unfortunately it is not that easy to implement, there are a lot of special cases to consider. If you really want you can try (I can give you some pointers where to start), but I will not implement it in the near future.

About the button: the button itself is a “DockTitle”, it is created using the identifier FlapDockStation.BUTTON_TITLE_ID. You could either write your own button, or maybe modifying the border may be enough? Like this:


import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.border.Border;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.common.mode.ExtendedMode;
import bibliothek.gui.dock.themes.ThemeManager;
import bibliothek.gui.dock.themes.border.BorderModifier;

public class FlapDockButtonTest {
	public static void main( String[] args ){
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.setBounds( 20, 20, 400, 400 );
		CControl control = new CControl( frame );
		frame.add( control.getContentArea() );
		
		initLargerMinimizeButton( control );
		
		DefaultSingleCDockable dockable = new DefaultSingleCDockable( "a", "Aaaa" );
		control.addDockable( dockable );
		dockable.setVisible( true );
		dockable.setExtendedMode( ExtendedMode.MINIMIZED );
		
		frame.setVisible( true );
	}
	
	private static void initLargerMinimizeButton( CControl control ){
		ThemeManager manager = control.getController().getThemeManager();
		
		manager.setBorderModifier( ThemeManager.BORDER_MODIFIER + ".title.button", new Modifier() );
		manager.setBorderModifier( ThemeManager.BORDER_MODIFIER + ".title.button.pressed", new Modifier() );
		manager.setBorderModifier( ThemeManager.BORDER_MODIFIER + ".title.button.selected", new Modifier() );
		manager.setBorderModifier( ThemeManager.BORDER_MODIFIER + ".title.button.selected.pressed", new Modifier() );
		
	}
	
	private static class Modifier implements BorderModifier{
		@Override
		public Border modify( Border border ){
			Border result = BorderFactory.createEmptyBorder( 10, 10, 10, 10 );
			if( border != null ){
				result = BorderFactory.createCompoundBorder( border, result );
			}
			return result;
		}
	}
}

Thank you for the reply.
If you have the time, you can quickly explain the pointers you mentioned in order to code the desired feature I can see if I can handle it, but I cannot give any guarantee of success. Besides, I do have an awfull schedule for the next two months at least, so it would be done during my spare time.

The big Component in the middle of the application, showing all the Dockables, is a “SplitDockStation”.
The location and size of the children of the SplitDockStation are handled by an interface called “SplitLayoutManager”. The layout itself is represented by a tree with a “Root”, some "Node"s (which have two children and are divided horizontally or vertically), some "Leaf"s (which represent Dockables) and "Placeholder"s (which represent invisible Dockables). The SplitLayoutManager has access to that tree.

When using a CControl, the SplitLayoutManager is actually an instance of “CLockedResizeLayoutManager”.

This SplitLayoutManager has a method “updateBounds” which is responsible, as the name suggests, for updating the location and size of Dockables. Personally I would try to override this method. If called you make a copy of the current layout. On the next call you compare the previous with the current layout, this way you’ll notice when a Dockable was moved or removed. And if you recognize a missing Dockable you update the “divider” property of all the "Node"s that are somehow related to the Dockable.

To install a custom SplitLayoutManager use code like this:

control.putProperty( SplitDockStation.LAYOUT_MANAGER, new CLockedResizeLayoutManager( control ) );```