Interface FloatPolicy
-
- All Known Implementing Classes:
DefaultFloatPolicy
,FloatPolicy.NullFloatPolicy
public interface FloatPolicy
This interface describes a set of method used to determine how floating events should be handled. Classes implementing this interface should be plugged into to theFloatPolicyManager
to affect floating behavior of the framework at runtime.- Author:
- Christopher Butler
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
FloatPolicy.NullFloatPolicy
Provides a default implementation of the FloatPolicy interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isFloatDropAllowed(DockingEvent evt)
Indicates whether floating should be allowed for the specifiedDockingEvent
at the end of a drag operation.boolean
isFloatingAllowed(Dockable dockable)
Returnstrue
if floating should be allowed for the specifiedDockable
.
-
-
-
Method Detail
-
isFloatingAllowed
boolean isFloatingAllowed(Dockable dockable)
Returnstrue
if floating should be allowed for the specifiedDockable
. This method will be invoked by theFloatPolicyManager
at the beginning of a drag operation to determine whether or not floating support will be enabled for theDockable
as a result of the drag. If this method returnsfalse
, floating will not be allowed for the drag operation against the specifiedDockable
.- Parameters:
dockable
- theDockable
to be checked for floating support- Returns:
true
if floating should be allowed for the specifiedDockable
;false
otherwise.
-
isFloatDropAllowed
boolean isFloatDropAllowed(DockingEvent evt)
Indicates whether floating should be allowed for the specifiedDockingEvent
at the end of a drag operation. TheFloatPolicyManager
will catch all attempts to float aDockable
at the end of a drag operation and invoke this method on all installedFloatPolicies
. If any of them returnsfalse
, the docking operation will be canceled.- Parameters:
evt
- theDockingEvent
to be checked for drop-to-float support- Returns:
true
if floating should be allowed for the specifiedDockingEvent
;false
otherwise.
-
-