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 byDockingManagerfor placingDockableinstances within a container. ADockingPortis the parent container inside of whichDockableinstances 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.StringINITIAL_TAB_POSITION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all docked components from theDockingPort.booleandock(java.awt.Component comp, java.lang.String region)Docks the specified Component in the specified region.booleandock(Dockable dockable, java.lang.String region)Docks the specified Dockable in the specified region.LayoutNodeexportLayout()Returns aLayoutNodecontaining metadata that describes the current layout contained within thisDockingPort.java.lang.ObjectgetClientProperty(java.lang.Object key)Returns the value of the property with the specified key.java.awt.ComponentgetComponent(java.lang.String region)Returns a reference to Component currently docked in the target region.DockablegetDockable(java.lang.String region)Returns a reference to Dockable currently docked in the target region.java.util.SetgetDockables()Returns aSetof allDockablespresently contained by thisDockingPort.java.awt.ComponentgetDockedComponent()Returns a reference to the currently docked component.DockingPortPropertySetgetDockingProperties()Returns aDockingPortPropertySetinstance associated with thisDockingPort.DockingStrategygetDockingStrategy()Returns theDockingStrategyinstance used by thisDockingPortfor docking operations.java.lang.StringgetPersistentId()Returns aStringidentifier that is unique within a JVM instance, but persistent across JVM instances.java.lang.StringgetRegion(java.awt.Point p)Returns the region of thisDockingPortcontaining the coordinates within the specifiedPoint.voidimportLayout(LayoutNode node)Examines aLayoutNodeand constructs a corresponding component hierarchy to match the specified layout.voidinstallMaximizedDockable(Dockable dockable)Asks thisDockingPortto temporarily install the specifiedDockableand maximize its component.booleanisDockingAllowed(java.awt.Component comp, java.lang.String region)Returns a boolean indicating whether or not docking is allowed within the specified region.booleanisParentDockingPort(java.awt.Component comp)Indicates whether or not the specified component is a child component docked within theDockingPort.booleanisRoot()Returns a boolean indicating whether or not thisDockingPortis nested within anotherDockingPort.voidputClientProperty(java.lang.Object key, java.lang.Object value)Adds an arbitrary key/value "client property" to thisDockingPort.voidreleaseForMaximization(Dockable dockable)Asks thisDockingPortto temporarily release its childDockablefor use by anotherDockingPortto achieve maximization.voidreturnFromMaximization()Notifies thisDockingPortthat theDockablepreviously released for maximization via a call toreleaseForMaximization(Dockable)is now ready to be returned to its original state inside thisDockingPort.voidsetPersistentId(java.lang.String id)Sets the persistent ID String to be returned bygetPersistentId().booleanundock(java.awt.Component comp)Removes the specified Component in from theDockingPort.voiduninstallMaximizedDockable()Notifies thisDockingPortthat theDockablepreviously installed for maximization via a call toinstallMaximizedDockable(Dockable)should now be returned to its originalDockingPortand that thisDockingPortshould 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 byDockingManagerduring 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'sgetDockable()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. Returnstruefor success andfalsefor 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 aStringidentifier that is unique within a JVM instance, but persistent across JVM instances. This is used for configuration mangement, allowing the JVM to recognize aDockingPortinstance 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 otherDockingPortinstances, but it should also be consistent from JVM to JVM so that the association between aDockingPortinstance 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. Returnstruefor success andfalsefor failure.
-
getRegion
java.lang.String getRegion(java.awt.Point p)
Returns the region of thisDockingPortcontaining 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 withputClientPropertywill return a non-nullvalue.- 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.nullvalues are allowed.- See Also:
JComponent.putClientProperty(java.lang.Object, java.lang.Object)
-
getDockingProperties
DockingPortPropertySet getDockingProperties()
Returns aDockingPortPropertySetinstance associated with thisDockingPort. Developers implementing theDockingPortinterface may or may not choose to provide their ownDockingPortPropertySetimplementation for use with this method. A default implementation is supplied by the framework and mostDockingPortimplementations, including all implementations provided by the framework, will return the defaultDockingPortPropertySetvia a call toorg.flexdock.docking.props.PropertyManager. Developers are encouraged to take advantage of this by callingPropertyManager.getDockingPortPropertySet(this).- Returns:
- the
DockingPortPropertySetassociated with thisDockingPortThis method may not return anullreference. - See Also:
DockingPortPropertySet,PropertyManager.getDockingPortPropertySet(DockingPort)
-
getDockingStrategy
DockingStrategy getDockingStrategy()
Returns theDockingStrategyinstance used by thisDockingPortfor docking operations.- See Also:
DockingStrategy
-
getDockables
java.util.Set getDockables()
Returns aSetof allDockablespresently contained by thisDockingPort.- Returns:
- a
SetofDockablescontained by thisDockingPort. If theDockingPortcontians noDockables, and emptySetis returned. This method may not return anullreference.
-
isRoot
boolean isRoot()
Returns a boolean indicating whether or not thisDockingPortis nested within anotherDockingPort. If there are no otherDockingPortswithin thisDockingPort'scontainer ancestor hierarchy, then this method will returntrue. Otherwise, this method will returnfalse. If the thisDockingPortis not validated and/or is not part of a container hierarchy, this method should returntrue.
-
importLayout
void importLayout(LayoutNode node)
Examines aLayoutNodeand constructs a corresponding component hierarchy to match the specified layout. The suppliedLayoutNodewill contain metadata describing a layout ofDockables, including relative sizes, split proportions, tabbing sequences, etc. ThisDockingPortis reponsible for constructing a validDockablecomponent layout based upon the metadata contained within the suppliedLayoutNode- Parameters:
node- theLayoutNodedescribing the layout to construct- See Also:
LayoutNode,exportLayout()
-
exportLayout
LayoutNode exportLayout()
Returns aLayoutNodecontaining metadata that describes the current layout contained within thisDockingPort. The returnedLayoutNodeshould be structured such that a subsequent call toimportLayout()on the sameDockingPortshould construct a visual component layout identical to that which currently exists in thisDockingPort- Returns:
- a
LayoutNoderepresenting the current layout state within thisDockingPort - See Also:
LayoutNode,importLayout(LayoutNode)
-
releaseForMaximization
void releaseForMaximization(Dockable dockable)
Asks thisDockingPortto temporarily release its childDockablefor use by anotherDockingPortto achieve maximization. This method is called byDockingManagerin the course of maximizing aDockable. Client code should not call this method directly.This
DockingPortis expected to remove the specified dockable's component from its swing container hierarchy. Also, thisDockingPortis expected to internally store enough information to restore its current state after a subsequent call toreturnFromMaximization().- Parameters:
dockable- theDockablethat is requested to be maximized- See Also:
DockingManager.toggleMaximized(Component),DockingManager.toggleMaximized(Dockable)
-
returnFromMaximization
void returnFromMaximization()
Notifies thisDockingPortthat theDockablepreviously released for maximization via a call toreleaseForMaximization(Dockable)is now ready to be returned to its original state inside thisDockingPort. This method is called byDockingManagerin the course of restoring a maximizedDockable. Client code should not call this method directly.
-
installMaximizedDockable
void installMaximizedDockable(Dockable dockable)
Asks thisDockingPortto temporarily install the specifiedDockableand maximize its component. This method is called byDockingManagerin the course of maximizing aDockable. Client code should not call this method directly.This
DockingPortis expected to display the specified dockable's component such that it occupies all (or the majority) of its screen resources. Also, thisDockingPortis expected to internally store enough information to restore its current state after a subsequent call touninstallMaximizedDockable().- Parameters:
dockable- theDockablethat is requested to be maximized- See Also:
DockingManager.toggleMaximized(Component),DockingManager.toggleMaximized(Dockable)
-
uninstallMaximizedDockable
void uninstallMaximizedDockable()
Notifies thisDockingPortthat theDockablepreviously installed for maximization via a call toinstallMaximizedDockable(Dockable)should now be returned to its originalDockingPortand that thisDockingPortshould return to its original state from before the call toinstallMaximizedDockable(Dockable). This method is called byDockingManagerin the course of restoring a maximizedDockable. Client code should not call this method directly.This
DockingPortis expected to remove the maximized dockable's component from its swing container hierarchy.
-
-