Package org.flexdock.docking
Interface DockingPort
- All Superinterfaces:
DockingListener
,DockingMonitor
,EventListener
- All Known Implementing Classes:
DefaultDockingPort
,FloatingDockingPort
,Viewport
This interface is designed to specify the API's required by
DockingManager
for placing Dockable
instances within a
container. A DockingPort
is the parent container inside of which
Dockable
instances may be placed.- Author:
- Chris Butler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.flexdock.docking.event.DockingListener
DockingListener.Stub
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all docked components from theDockingPort
.boolean
Docks the specified Component in the specified region.boolean
Docks the specified Dockable in the specified region.Returns aLayoutNode
containing metadata that describes the current layout contained within thisDockingPort
.getClientProperty
(Object key) Returns the value of the property with the specified key.getComponent
(String region) Returns a reference to Component currently docked in the target region.getDockable
(String region) Returns a reference to Dockable currently docked in the target region.Returns aSet
of allDockables
presently contained by thisDockingPort
.Returns a reference to the currently docked component.Returns aDockingPortPropertySet
instance associated with thisDockingPort
.Returns theDockingStrategy
instance used by thisDockingPort
for docking operations.Returns aString
identifier that is unique within a JVM instance, but persistent across JVM instances.Returns the region of thisDockingPort
containing the coordinates within the specifiedPoint
.void
importLayout
(LayoutNode node) Examines aLayoutNode
and constructs a corresponding component hierarchy to match the specified layout.void
installMaximizedDockable
(Dockable dockable) Asks thisDockingPort
to temporarily install the specifiedDockable
and maximize its component.boolean
isDockingAllowed
(Component comp, String region) Returns a boolean indicating whether or not docking is allowed within the specified region.boolean
isParentDockingPort
(Component comp) Indicates whether or not the specified component is a child component docked within theDockingPort
.boolean
isRoot()
Returns a boolean indicating whether or not thisDockingPort
is nested within anotherDockingPort
.void
putClientProperty
(Object key, Object value) Adds an arbitrary key/value "client property" to thisDockingPort
.void
releaseForMaximization
(Dockable dockable) Asks thisDockingPort
to temporarily release its childDockable
for use by anotherDockingPort
to achieve maximization.void
Notifies thisDockingPort
that theDockable
previously released for maximization via a call toreleaseForMaximization(Dockable)
is now ready to be returned to its original state inside thisDockingPort
.void
Sets the persistent ID String to be returned bygetPersistentId()
.boolean
Removes the specified Component in from theDockingPort
.void
Notifies thisDockingPort
that theDockable
previously installed for maximization via a call toinstallMaximizedDockable(Dockable)
should now be returned to its originalDockingPort
and that thisDockingPort
should return to its original state from before the call toinstallMaximizedDockable(Dockable)
.Methods inherited from interface org.flexdock.docking.event.DockingListener
dockingCanceled, dockingComplete, dragStarted, dropStarted, undockingComplete, undockingStarted
Methods inherited from interface org.flexdock.docking.event.DockingMonitor
addDockingListener, getDockingListeners, removeDockingListener
-
Field Details
-
INITIAL_TAB_POSITION
- See Also:
-
-
Method Details
-
isDockingAllowed
Returns a boolean indicating whether or not docking is allowed within the specified region. Used byDockingManager
during drag operations. -
clear
void clear()Removes all docked components from theDockingPort
. -
dock
Docks the specified Dockable in the specified region. TheDockable's
getDockable()
component is used as the docking component. -
dock
Docks the specified Component in the specified region. Returnstrue
for success andfalse
for failure. -
getDockedComponent
Component getDockedComponent()Returns a reference to the currently docked component. -
getDockable
Returns a reference to Dockable currently docked in the target region. Returns null if there is no Dockable there. If a tabbed layout is present, this method will return the Dockable in the currently selected tab. -
getComponent
Returns a reference to Component currently docked in the target region. Returns null if there is no Component there. If a tabbed layout is present, this method will return the Component in the currently selected tab. -
getPersistentId
String getPersistentId()Returns aString
identifier that is unique within a JVM instance, but persistent across JVM instances. This is used for configuration mangement, allowing the JVM to recognize aDockingPort
instance within an application instance, persist the ID, and recall it in later application instances. The ID should be unique within an appliation instance so that there are no collisions with otherDockingPort
instances, but it should also be consistent from JVM to JVM so that the association between aDockingPort
instance and its ID can be remembered from session to session. -
setPersistentId
Sets the persistent ID String to be returned bygetPersistentId()
.- Parameters:
id
- the persistent ID to be applied.- See Also:
-
isParentDockingPort
Indicates whether or not the specified component is a child component docked within theDockingPort
. -
undock
Removes the specified Component in from theDockingPort
. Returnstrue
for success andfalse
for failure. -
getRegion
Returns the region of thisDockingPort
containing the coordinates within the specifiedPoint
. The return value will be one of the regions specified inorg.flexdock.util.DockingConstants
, includingCENTER_REGION
,NORTH_REGION
,SOUTH_REGION
,EAST_REGION
,WEST_REGION
, orUNKNOWN_REGION
.- Returns:
- the region containing the specified
Point
.
-
getClientProperty
Returns the value of the property with the specified key. Only properties added withputClientProperty
will return a non-null
value.- Parameters:
key
- the being queried- Returns:
- the value of this property or
null
- See Also:
-
putClientProperty
Adds an arbitrary key/value "client property" to thisDockingPort
.null
values are allowed. -
getDockingProperties
DockingPortPropertySet getDockingProperties()Returns aDockingPortPropertySet
instance associated with thisDockingPort
. Developers implementing theDockingPort
interface may or may not choose to provide their ownDockingPortPropertySet
implementation for use with this method. A default implementation is supplied by the framework and mostDockingPort
implementations, including all implementations provided by the framework, will return the defaultDockingPortPropertySet
via a call toorg.flexdock.docking.props.PropertyManager
. Developers are encouraged to take advantage of this by callingPropertyManager.getDockingPortPropertySet(this)
.- Returns:
- the
DockingPortPropertySet
associated with thisDockingPort
This method may not return anull
reference. - See Also:
-
getDockingStrategy
DockingStrategy getDockingStrategy()Returns theDockingStrategy
instance used by thisDockingPort
for docking operations.- See Also:
-
getDockables
Set getDockables()Returns aSet
of allDockables
presently contained by thisDockingPort
.- Returns:
- a
Set
ofDockables
contained by thisDockingPort
. If theDockingPort
contians noDockables
, and emptySet
is returned. This method may not return anull
reference.
-
isRoot
boolean isRoot()Returns a boolean indicating whether or not thisDockingPort
is nested within anotherDockingPort
. If there are no otherDockingPorts
within thisDockingPort's
container ancestor hierarchy, then this method will returntrue
. Otherwise, this method will returnfalse
. If the thisDockingPort
is not validated and/or is not part of a container hierarchy, this method should returntrue
. -
importLayout
Examines aLayoutNode
and constructs a corresponding component hierarchy to match the specified layout. The suppliedLayoutNode
will contain metadata describing a layout ofDockables
, including relative sizes, split proportions, tabbing sequences, etc. ThisDockingPort
is reponsible for constructing a validDockable
component layout based upon the metadata contained within the suppliedLayoutNode
- Parameters:
node
- theLayoutNode
describing the layout to construct- See Also:
-
exportLayout
LayoutNode exportLayout()Returns aLayoutNode
containing metadata that describes the current layout contained within thisDockingPort
. The returnedLayoutNode
should be structured such that a subsequent call toimportLayout()
on the sameDockingPort
should construct a visual component layout identical to that which currently exists in thisDockingPort
- Returns:
- a
LayoutNode
representing the current layout state within thisDockingPort
- See Also:
-
releaseForMaximization
Asks thisDockingPort
to temporarily release its childDockable
for use by anotherDockingPort
to achieve maximization. This method is called byDockingManager
in the course of maximizing aDockable
. Client code should not call this method directly.This
DockingPort
is expected to remove the specified dockable's component from its swing container hierarchy. Also, thisDockingPort
is expected to internally store enough information to restore its current state after a subsequent call toreturnFromMaximization()
.- Parameters:
dockable
- theDockable
that is requested to be maximized- See Also:
-
returnFromMaximization
void returnFromMaximization()Notifies thisDockingPort
that theDockable
previously released for maximization via a call toreleaseForMaximization(Dockable)
is now ready to be returned to its original state inside thisDockingPort
. This method is called byDockingManager
in the course of restoring a maximizedDockable
. Client code should not call this method directly. -
installMaximizedDockable
Asks thisDockingPort
to temporarily install the specifiedDockable
and maximize its component. This method is called byDockingManager
in the course of maximizing aDockable
. Client code should not call this method directly.This
DockingPort
is expected to display the specified dockable's component such that it occupies all (or the majority) of its screen resources. Also, thisDockingPort
is expected to internally store enough information to restore its current state after a subsequent call touninstallMaximizedDockable()
.- Parameters:
dockable
- theDockable
that is requested to be maximized- See Also:
-
uninstallMaximizedDockable
void uninstallMaximizedDockable()Notifies thisDockingPort
that theDockable
previously installed for maximization via a call toinstallMaximizedDockable(Dockable)
should now be returned to its originalDockingPort
and that thisDockingPort
should return to its original state from before the call toinstallMaximizedDockable(Dockable)
. This method is called byDockingManager
in the course of restoring a maximizedDockable
. Client code should not call this method directly.This
DockingPort
is expected to remove the maximized dockable's component from its swing container hierarchy.
-