Package org.flexdock.docking.defaults
Class StandardBorderManager
- java.lang.Object
-
- org.flexdock.docking.defaults.StandardBorderManager
-
- All Implemented Interfaces:
BorderManager
public class StandardBorderManager extends java.lang.Object implements BorderManager
This class provides a standard implementation of theBorderManagerinterface. It is designed to avoid the negative visual effects caused by nesting docked components that have individual borders. It accomplishes this by establishing and maintaining a single border for all docked components This class encapsulates ajavax.swing.border.Borderinstance, or anullborder reference, for application to aDefaultDockingPortand its child components. If theDefaultDockingPorthas no child component, thenmanagePortNullChild()will apply the encapsulated border to theDefaultDockingPortitself, rendering the visible outline of an emptyDockingPort. If theDefaultDockingPorthas a genericComponentas its child, excluding aJTabbedPaneorJSplitPane, then the border for that component is set tonulland the encapsulated border is applied to theDockingPortviamanagePortSimpleChild(). If theDefaultDockingPorthas aJTabbedPaneas its child, then anullborder is set for theJTabbedPaneand all of its child components, and the encapsulated border is applied to theDockingPort. This is accomplished by callingmanagePortTabbedChild(). Finally,managePortSplitChild()will manage the border for aDefaultDockingPortwhose docked component is aJSplitPane. This method removes all borders from theDefaultDockingPortand the split pane divider and applies the encapsulated border to both left and right child components of theJSplitPane.- Author:
- Christopher Butler
-
-
Constructor Summary
Constructors Constructor Description StandardBorderManager()Creates a newStandardBorderManagerwith anullassigned border.StandardBorderManager(javax.swing.border.Border border)Creates a newStandardBorderManagerwith the specified assigned border.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.border.BordergetBorder()Returns the currently assigned border.voidmanagePortNullChild(DockingPort port)Set the border on the suppliedDockingPortto the currently assigned border.voidmanagePortSimpleChild(DockingPort port)Removes any border from theDockingPort'sdocked component and set the border on theDockingPortitself to the currently assigned border.voidmanagePortSplitChild(DockingPort port)Removes any border from theDockingPortitself and places the currently assigned border on the two child components of theDockingPort's</code JSplitPanechild.voidmanagePortTabbedChild(DockingPort port)Removes any border from theDockingPort'sdockedJTabbedPanecomponent and sets the border on theDockingPortitself to the currently assigned border.voidsetBorder(javax.swing.border.Border border)Sets the assigned border.
-
-
-
Constructor Detail
-
StandardBorderManager
public StandardBorderManager()
Creates a newStandardBorderManagerwith anullassigned border.
-
StandardBorderManager
public StandardBorderManager(javax.swing.border.Border border)
Creates a newStandardBorderManagerwith the specified assigned border.- Parameters:
border- the currently assigned border.
-
-
Method Detail
-
getBorder
public javax.swing.border.Border getBorder()
Returns the currently assigned border.- Returns:
- the currently assigned border.
-
setBorder
public void setBorder(javax.swing.border.Border border)
Sets the assigned border. Null values are acceptable.- Parameters:
border- the assigned border.
-
managePortNullChild
public void managePortNullChild(DockingPort port)
Set the border on the suppliedDockingPortto the currently assigned border.- Specified by:
managePortNullChildin interfaceBorderManager- Parameters:
port- theDockingPortwhose layout borders are to be managed- See Also:
BorderManager.managePortNullChild(DockingPort)
-
managePortSimpleChild
public void managePortSimpleChild(DockingPort port)
Removes any border from theDockingPort'sdocked component and set the border on theDockingPortitself to the currently assigned border.- Specified by:
managePortSimpleChildin interfaceBorderManager- Parameters:
port- theDockingPortwhose layout borders are to be managed- See Also:
BorderManager.managePortSimpleChild(DockingPort)
-
managePortSplitChild
public void managePortSplitChild(DockingPort port)
Removes any border from theDockingPortitself and places the currently assigned border on the two child components of theDockingPort's</code JSplitPanechild.- Specified by:
managePortSplitChildin interfaceBorderManager- Parameters:
port- theDockingPortwhose layout borders are to be managed- See Also:
BorderManager.managePortSplitChild(DockingPort)
-
managePortTabbedChild
public void managePortTabbedChild(DockingPort port)
Removes any border from theDockingPort'sdockedJTabbedPanecomponent and sets the border on theDockingPortitself to the currently assigned border.- Specified by:
managePortTabbedChildin interfaceBorderManager- Parameters:
port- theDockingPortwhose layout borders are to be managed- See Also:
BorderManager.managePortTabbedChild(DockingPort)
-
-