Package org.flexdock.docking
Interface DockingPort
-
- All Superinterfaces:
DockingListener
,DockingMonitor
,java.util.EventListener
- All Known Implementing Classes:
DefaultDockingPort
,FloatingDockingPort
,Viewport
public interface DockingPort extends DockingListener, DockingMonitor
This interface is designed to specify the API's required byDockingManager
for placingDockable
instances within a container. ADockingPort
is the parent container inside of whichDockable
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 Modifier and Type Field Description static java.lang.String
INITIAL_TAB_POSITION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Removes all docked components from theDockingPort
.boolean
dock(java.awt.Component comp, java.lang.String region)
Docks the specified Component in the specified region.boolean
dock(Dockable dockable, java.lang.String region)
Docks the specified Dockable in the specified region.LayoutNode
exportLayout()
Returns aLayoutNode
containing metadata that describes the current layout contained within thisDockingPort
.java.lang.Object
getClientProperty(java.lang.Object key)
Returns the value of the property with the specified key.java.awt.Component
getComponent(java.lang.String region)
Returns a reference to Component currently docked in the target region.Dockable
getDockable(java.lang.String region)
Returns a reference to Dockable currently docked in the target region.java.util.Set
getDockables()
Returns aSet
of allDockables
presently contained by thisDockingPort
.java.awt.Component
getDockedComponent()
Returns a reference to the currently docked component.DockingPortPropertySet
getDockingProperties()
Returns aDockingPortPropertySet
instance associated with thisDockingPort
.DockingStrategy
getDockingStrategy()
Returns theDockingStrategy
instance used by thisDockingPort
for docking operations.java.lang.String
getPersistentId()
Returns aString
identifier that is unique within a JVM instance, but persistent across JVM instances.java.lang.String
getRegion(java.awt.Point p)
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(java.awt.Component comp, java.lang.String region)
Returns a boolean indicating whether or not docking is allowed within the specified region.boolean
isParentDockingPort(java.awt.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(java.lang.Object key, java.lang.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
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
.void
setPersistentId(java.lang.String id)
Sets the persistent ID String to be returned bygetPersistentId()
.boolean
undock(java.awt.Component comp)
Removes the specified Component in from theDockingPort
.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)
.-
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 Detail
-
INITIAL_TAB_POSITION
static final java.lang.String INITIAL_TAB_POSITION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDockingAllowed
boolean isDockingAllowed(java.awt.Component comp, java.lang.String region)
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
boolean dock(Dockable dockable, java.lang.String region)
Docks the specified Dockable in the specified region. TheDockable's
getDockable()
component is used as the docking component.
-
dock
boolean dock(java.awt.Component comp, java.lang.String region)
Docks the specified Component in the specified region. Returnstrue
for success andfalse
for failure.
-
getDockedComponent
java.awt.Component getDockedComponent()
Returns a reference to the currently docked component.
-
getDockable
Dockable getDockable(java.lang.String region)
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
java.awt.Component getComponent(java.lang.String region)
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
java.lang.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
void setPersistentId(java.lang.String id)
Sets the persistent ID String to be returned bygetPersistentId()
.- Parameters:
id
- the persistent ID to be applied.- See Also:
getPersistentId()
-
isParentDockingPort
boolean isParentDockingPort(java.awt.Component comp)
Indicates whether or not the specified component is a child component docked within theDockingPort
.
-
undock
boolean undock(java.awt.Component comp)
Removes the specified Component in from theDockingPort
. Returnstrue
for success andfalse
for failure.
-
getRegion
java.lang.String getRegion(java.awt.Point p)
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
java.lang.Object getClientProperty(java.lang.Object key)
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:
JComponent.getClientProperty(java.lang.Object)
-
putClientProperty
void putClientProperty(java.lang.Object key, java.lang.Object value)
Adds an arbitrary key/value "client property" to thisDockingPort
.null
values are allowed.- See Also:
JComponent.putClientProperty(java.lang.Object, java.lang.Object)
-
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:
DockingPortPropertySet
,PropertyManager.getDockingPortPropertySet(DockingPort)
-
getDockingStrategy
DockingStrategy getDockingStrategy()
Returns theDockingStrategy
instance used by thisDockingPort
for docking operations.- See Also:
DockingStrategy
-
getDockables
java.util.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
void importLayout(LayoutNode node)
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:
LayoutNode
,exportLayout()
-
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:
LayoutNode
,importLayout(LayoutNode)
-
releaseForMaximization
void releaseForMaximization(Dockable dockable)
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:
DockingManager.toggleMaximized(Component)
,DockingManager.toggleMaximized(Dockable)
-
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
void installMaximizedDockable(Dockable dockable)
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:
DockingManager.toggleMaximized(Component)
,DockingManager.toggleMaximized(Dockable)
-
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.
-
-