net.java.swingfx.jdraggable
Interface DraggableManager

All Superinterfaces:
ContainerListener, EventListener
All Known Implementing Classes:
DefaultDraggableManager

public interface DraggableManager
extends ContainerListener

An interface which defines a manager whose responsibility is to enable dragging for Component's of a Container which registers itself as the "draggable container"

Since:
v0.1
$Header: /cvs/swingfx/docs/net/java/swingfx/jdraggable/DraggableManager.html,v 1.1 2005/06/23 00:24:21 codecraig Exp $
Author:
craig

Field Summary
static byte STATE_DRAGGING
          the component is being dragged
static byte STATE_STILL
          the component is not being dragged
static byte STATE_UNKNOWN
          the state of the component is unknown
 
Method Summary
 boolean dragging()
          Called while the Component is being dragged
 Container getDraggableContainer()
          Returns the Container which has been registered as the "draggable container"
 DragPolicy getDragPolicy()
          Returns the DragPolicy for which this manager obides by
 byte getState(Draggable draggableComponent)
          Returns the state of the given Draggable component
 void registerDraggableContainer(Container draggableContainer)
          Registers the given Container with this manager to enable the container's Draggable components to be draggable
 void setDragPolicy(DragPolicy dragPolicy)
          Set the policy for which components are eligible for dragging
 void setNullifyLayout(boolean nullifyLayout)
          Sets whether the "draggable container" layout manager should be set to null once a component is dragged, or not.
 boolean shouldNullifyLayout()
          Returns the "nullify layout" value
 boolean startDrag(Component componentToDrag)
          Called before a Component is actually dragged
 boolean stopDrag()
          Called when a Component has stopped being dragged
 void unregisterDraggableContainer(Container draggableContainer)
          Un-Registers the given Container from this manager which stops this manager from managing the container
 
Methods inherited from interface java.awt.event.ContainerListener
componentAdded, componentRemoved
 

Field Detail

STATE_UNKNOWN

static final byte STATE_UNKNOWN
the state of the component is unknown

See Also:
Constant Field Values

STATE_STILL

static final byte STATE_STILL
the component is not being dragged

See Also:
Constant Field Values

STATE_DRAGGING

static final byte STATE_DRAGGING
the component is being dragged

See Also:
Constant Field Values
Method Detail

getDraggableContainer

Container getDraggableContainer()
Returns the Container which has been registered as the "draggable container"

Returns:
the Container which was registered as the "draggable container" or null if no Container is registered

startDrag

boolean startDrag(Component componentToDrag)
Called before a Component is actually dragged

Parameters:
componentToDrag - the component which was chosen to be dragged
Returns:
true if the "drag" can continue, false otherwise

dragging

boolean dragging()
Called while the Component is being dragged

Returns:
true if the dragging can continue, false otherwise

stopDrag

boolean stopDrag()
Called when a Component has stopped being dragged

Returns:
true if no errors occurred when the drag completed, false otherwise

registerDraggableContainer

void registerDraggableContainer(Container draggableContainer)
Registers the given Container with this manager to enable the container's Draggable components to be draggable

Parameters:
draggableContainer - the Container whose Draggable components should be able to be dragged

unregisterDraggableContainer

void unregisterDraggableContainer(Container draggableContainer)
Un-Registers the given Container from this manager which stops this manager from managing the container

Parameters:
draggableContainer - the Container to unregister

getState

byte getState(Draggable draggableComponent)
Returns the state of the given Draggable component

Parameters:
draggableComponent - the Draggable whose state is of interest
Returns:
the state of draggableComponent as defined in this interface
See Also:
STATE_DRAGGING, STATE_STILL, STATE_UNKNOWN

setDragPolicy

void setDragPolicy(DragPolicy dragPolicy)
Set the policy for which components are eligible for dragging

Parameters:
dragPolicy - the policy to set
See Also:
getDragPolicy(), DragPolicy

getDragPolicy

DragPolicy getDragPolicy()
Returns the DragPolicy for which this manager obides by

Returns:
the DragPolicy for this manager
See Also:
setDragPolicy(DragPolicy), DragPolicy

shouldNullifyLayout

boolean shouldNullifyLayout()
Returns the "nullify layout" value

Returns:
true to nullify the layout manager of the "draggable container", false otherwise

setNullifyLayout

void setNullifyLayout(boolean nullifyLayout)
Sets whether the "draggable container" layout manager should be set to null once a component is dragged, or not.
By not setting the layout manager to null, the components may lose their "dragged" position if the container is resized.
By default this value is true

Parameters:
nullifyLayout - true to nullify the layout manager, false otherwise