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 theBorderManager
interface. 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.Border
instance, or anull
border reference, for application to aDefaultDockingPort
and its child components. If theDefaultDockingPort
has no child component, thenmanagePortNullChild()
will apply the encapsulated border to theDefaultDockingPort
itself, rendering the visible outline of an emptyDockingPort
. If theDefaultDockingPort
has a genericComponent
as its child, excluding aJTabbedPane
orJSplitPane
, then the border for that component is set tonull
and the encapsulated border is applied to theDockingPort
viamanagePortSimpleChild()
. If theDefaultDockingPort
has aJTabbedPane
as its child, then anull
border is set for theJTabbedPane
and 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 aDefaultDockingPort
whose docked component is aJSplitPane
. This method removes all borders from theDefaultDockingPort
and 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 newStandardBorderManager
with anull
assigned border.StandardBorderManager(javax.swing.border.Border border)
Creates a newStandardBorderManager
with the specified assigned border.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.border.Border
getBorder()
Returns the currently assigned border.void
managePortNullChild(DockingPort port)
Set the border on the suppliedDockingPort
to the currently assigned border.void
managePortSimpleChild(DockingPort port)
Removes any border from theDockingPort's
docked component and set the border on theDockingPort
itself to the currently assigned border.void
managePortSplitChild(DockingPort port)
Removes any border from theDockingPort
itself and places the currently assigned border on the two child components of theDockingPort's</code JSplitPane
child.void
managePortTabbedChild(DockingPort port)
Removes any border from theDockingPort's
dockedJTabbedPane
component and sets the border on theDockingPort
itself to the currently assigned border.void
setBorder(javax.swing.border.Border border)
Sets the assigned border.
-
-
-
Constructor Detail
-
StandardBorderManager
public StandardBorderManager()
Creates a newStandardBorderManager
with anull
assigned border.
-
StandardBorderManager
public StandardBorderManager(javax.swing.border.Border border)
Creates a newStandardBorderManager
with 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 suppliedDockingPort
to the currently assigned border.- Specified by:
managePortNullChild
in interfaceBorderManager
- Parameters:
port
- theDockingPort
whose layout borders are to be managed- See Also:
BorderManager.managePortNullChild(DockingPort)
-
managePortSimpleChild
public void managePortSimpleChild(DockingPort port)
Removes any border from theDockingPort's
docked component and set the border on theDockingPort
itself to the currently assigned border.- Specified by:
managePortSimpleChild
in interfaceBorderManager
- Parameters:
port
- theDockingPort
whose layout borders are to be managed- See Also:
BorderManager.managePortSimpleChild(DockingPort)
-
managePortSplitChild
public void managePortSplitChild(DockingPort port)
Removes any border from theDockingPort
itself and places the currently assigned border on the two child components of theDockingPort's</code JSplitPane
child.- Specified by:
managePortSplitChild
in interfaceBorderManager
- Parameters:
port
- theDockingPort
whose layout borders are to be managed- See Also:
BorderManager.managePortSplitChild(DockingPort)
-
managePortTabbedChild
public void managePortTabbedChild(DockingPort port)
Removes any border from theDockingPort's
dockedJTabbedPane
component and sets the border on theDockingPort
itself to the currently assigned border.- Specified by:
managePortTabbedChild
in interfaceBorderManager
- Parameters:
port
- theDockingPort
whose layout borders are to be managed- See Also:
BorderManager.managePortTabbedChild(DockingPort)
-
-