org.flexdock.docking
public interface DockingPort extends DockingListener, DockingMonitor
DockingManager
for placing Dockable
instances within a
container. A DockingPort
is the parent container inside of which
Dockable
instances may be placed.DockingListener.Stub
Modifier and Type | Field and Description |
---|---|
static String |
INITIAL_TAB_POSITION |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all docked components from the
DockingPort . |
boolean |
dock(Component comp,
String region)
Docks the specified Component in the specified region.
|
boolean |
dock(Dockable dockable,
String region)
Docks the specified Dockable in the specified region.
|
LayoutNode |
exportLayout()
Returns a
LayoutNode containing metadata that describes the
current layout contained within this DockingPort . |
Object |
getClientProperty(Object key)
Returns the value of the property with the specified key.
|
Component |
getComponent(String region)
Returns a reference to Component currently docked in the target region.
|
Dockable |
getDockable(String region)
Returns a reference to Dockable currently docked in the target region.
|
Set |
getDockables()
Returns a
Set of all Dockables presently contained by
this DockingPort . |
Component |
getDockedComponent()
Returns a reference to the currently docked component.
|
DockingPortPropertySet |
getDockingProperties()
Returns a
DockingPortPropertySet instance associated with this
DockingPort . |
DockingStrategy |
getDockingStrategy()
Returns the
DockingStrategy instance used by this
DockingPort for docking operations. |
String |
getPersistentId()
Returns a
String identifier that is unique within a JVM instance,
but persistent across JVM instances. |
String |
getRegion(Point p)
Returns the region of this
DockingPort containing the coordinates
within the specified Point . |
void |
importLayout(LayoutNode node)
Examines a
LayoutNode and constructs a corresponding component
hierarchy to match the specified layout. |
void |
installMaximizedDockable(Dockable dockable)
Asks this
DockingPort to temporarily install the specified
Dockable 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 the
DockingPort . |
boolean |
isRoot()
Returns a boolean indicating whether or not this
DockingPort is
nested within another DockingPort . |
void |
putClientProperty(Object key,
Object value)
Adds an arbitrary key/value "client property" to this
DockingPort . |
void |
releaseForMaximization(Dockable dockable)
Asks this
DockingPort to temporarily release its child
Dockable for use by another DockingPort to achieve
maximization. |
void |
returnFromMaximization()
Notifies this
DockingPort that the Dockable previously
released for maximization via a call to
releaseForMaximization(Dockable) is now ready to be returned to
its original state inside this DockingPort . |
void |
setPersistentId(String id)
Sets the persistent ID String to be returned by
getPersistentId() . |
boolean |
undock(Component comp)
Removes the specified Component in from the
DockingPort . |
void |
uninstallMaximizedDockable()
Notifies this
DockingPort that the Dockable previously
installed for maximization via a call to
installMaximizedDockable(Dockable) should now be returned to its
original DockingPort and that this DockingPort should
return to its original state from before the call to
installMaximizedDockable(Dockable) . |
dockingCanceled, dockingComplete, dragStarted, dropStarted, undockingComplete, undockingStarted
addDockingListener, getDockingListeners, removeDockingListener
static final String INITIAL_TAB_POSITION
boolean isDockingAllowed(Component comp, String region)
DockingManager
during drag operations.void clear()
DockingPort
.boolean dock(Dockable dockable, String region)
Dockable's
getDockable()
component is used as the docking
component.boolean dock(Component comp, String region)
true
for success and false
for failure.Component getDockedComponent()
Dockable getDockable(String region)
Component getComponent(String region)
String getPersistentId()
String
identifier that is unique within a JVM instance,
but persistent across JVM instances. This is used for configuration
mangement, allowing the JVM to recognize a DockingPort
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 other DockingPort
instances, but it should also be consistent from JVM to JVM so that the
association between a DockingPort
instance and its ID can be
remembered from session to session.void setPersistentId(String id)
getPersistentId()
.id
- the persistent ID to be applied.getPersistentId()
boolean isParentDockingPort(Component comp)
DockingPort
.boolean undock(Component comp)
DockingPort
. Returns
true
for success and false
for failure.String getRegion(Point p)
DockingPort
containing the coordinates
within the specified Point
. The return value will be one of the
regions specified in org.flexdock.util.DockingConstants
,
including CENTER_REGION
, NORTH_REGION
,
SOUTH_REGION
, EAST_REGION
, WEST_REGION
, or
UNKNOWN_REGION
.Point
.Object getClientProperty(Object key)
putClientProperty
will return a non-null
value.key
- the being queriednull
JComponent.getClientProperty(java.lang.Object)
void putClientProperty(Object key, Object value)
DockingPort
.
null
values are allowed.DockingPortPropertySet getDockingProperties()
DockingPortPropertySet
instance associated with this
DockingPort
. Developers implementing the DockingPort
interface may or may not choose to provide their own
DockingPortPropertySet
implementation for use with this method. A
default implementation is supplied by the framework and most
DockingPort
implementations, including all implementations
provided by the framework, will return the default
DockingPortPropertySet
via a call to
org.flexdock.docking.props.PropertyManager
. Developers are
encouraged to take advantage of this by calling
PropertyManager.getDockingPortPropertySet(this)
.DockingPortPropertySet
associated with this
DockingPort
This method may not return a null
reference.DockingPortPropertySet
,
PropertyManager.getDockingPortPropertySet(DockingPort)
DockingStrategy getDockingStrategy()
DockingStrategy
instance used by this
DockingPort
for docking operations.DockingStrategy
Set getDockables()
Set
of all Dockables
presently contained by
this DockingPort
.Set
of Dockables
contained by this
DockingPort
. If the DockingPort
contians no
Dockables
, and empty Set
is returned. This
method may not return a null
reference.boolean isRoot()
DockingPort
is
nested within another DockingPort
. If there are no other
DockingPorts
within this DockingPort's
container ancestor
hierarchy, then this method will return true
. Otherwise, this
method will return false
. If the this DockingPort
is not
validated and/or is not part of a container hierarchy, this method should
return true
.void importLayout(LayoutNode node)
LayoutNode
and constructs a corresponding component
hierarchy to match the specified layout. The supplied LayoutNode
will contain metadata describing a layout of Dockables
,
including relative sizes, split proportions, tabbing sequences, etc. This
DockingPort
is reponsible for constructing a valid
Dockable
component layout based upon the metadata contained
within the supplied LayoutNode
node
- the LayoutNode
describing the layout to constructLayoutNode
,
exportLayout()
LayoutNode exportLayout()
LayoutNode
containing metadata that describes the
current layout contained within this DockingPort
. The returned
LayoutNode
should be structured such that a subsequent call to
importLayout()
on the same DockingPort
should construct a
visual component layout identical to that which currently exists in this
DockingPort
LayoutNode
representing the current layout state within
this DockingPort
LayoutNode
,
importLayout(LayoutNode)
void releaseForMaximization(Dockable dockable)
DockingPort
to temporarily release its child
Dockable
for use by another DockingPort
to achieve
maximization. This method is called by DockingManager
in the
course of maximizing a Dockable
. 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, this
DockingPort
is expected to internally store enough information to
restore its current state after a subsequent call to
returnFromMaximization()
.
dockable
- the Dockable
that is requested to be maximizedDockingManager.toggleMaximized(Component)
,
DockingManager.toggleMaximized(Dockable)
void returnFromMaximization()
DockingPort
that the Dockable
previously
released for maximization via a call to
releaseForMaximization(Dockable)
is now ready to be returned to
its original state inside this DockingPort
. This method is
called by DockingManager
in the course of restoring a maximized
Dockable
. Client code should not call this method directly.void installMaximizedDockable(Dockable dockable)
DockingPort
to temporarily install the specified
Dockable
and maximize its component. This method is called by
DockingManager
in the course of maximizing a Dockable
.
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, this DockingPort
is expected to internally store
enough information to restore its current state after a subsequent call
to uninstallMaximizedDockable()
.
dockable
- the Dockable
that is requested to be maximizedDockingManager.toggleMaximized(Component)
,
DockingManager.toggleMaximized(Dockable)
void uninstallMaximizedDockable()
DockingPort
that the Dockable
previously
installed for maximization via a call to
installMaximizedDockable(Dockable)
should now be returned to its
original DockingPort
and that this DockingPort
should
return to its original state from before the call to
installMaximizedDockable(Dockable)
. This method is called by
DockingManager
in the course of restoring a maximized
Dockable
. Client code should not call this method directly.
This DockingPort
is expected to remove the maximized dockable's
component from its swing container hierarchy.