| java.lang.Object net.mygwt.ui.client.util.Observable net.mygwt.ui.client.fx.Draggable
Draggable | public class Draggable extends Observable (Code) | | Adds drag behavior to any widget. Drag operations can be initiated from the
widget itself, or another widget, such as the header in a dialog.
It is possible to specify event targets that will be ignored. If the target
element has a 'my-nodrag' style it will not trigger a drag operation.
- Events:
- DragStart : (source, widget, event)
Fires after a drag has started.
- source : this
- widget : drag widget
- event : the dom event
- DragMove : (source, widget, event)
Fires after the mouse moves.
- source : this
- widget : drag widget
- event : the dom event
- DragCancel : (source, widget, event)
Fires after a drag has been cancelled.
- source : this
- widget : drag widget
- event : the dom event
- DragEnd : (source, widget, event)
Fires after a drag has ended.
- source : this
- widget : drag widget
- event : the dom event
|
Field Summary | |
public boolean | constrainClient true to set client area constraints. | public boolean | constrainHorizontal true to stop horizontal movement. | public boolean | constrainVertical true to stop vertical movement. | public Widget | container If specified, drag will be constrained by container bounds. | public boolean | moveAfterProxyDrag true to move source widget aftet a proxy drag. | public String | proxyStyle proxyStyle is the style name used for proxy drags. | public boolean | sizeProxyToSource true to set proxy dimensions the same as the drag widget. | public boolean | updateZIndex updateZIndex specifies if the CSS z-index should be updated on the widget
being dragged. | public boolean | useProxy true to use a proxy widget during drag operation. |
constrainClient | public boolean constrainClient(Code) | | true to set client area constraints. Default value is
true
|
constrainHorizontal | public boolean constrainHorizontal(Code) | | true to stop horizontal movement. Default value is
false
|
constrainVertical | public boolean constrainVertical(Code) | | true to stop vertical movement. Default value is
false
|
container | public Widget container(Code) | | If specified, drag will be constrained by container bounds.
|
moveAfterProxyDrag | public boolean moveAfterProxyDrag(Code) | | true to move source widget aftet a proxy drag. Default
values is true
|
proxyStyle | public String proxyStyle(Code) | | proxyStyle is the style name used for proxy drags. Default value is
'my-drag-proxy'.
|
sizeProxyToSource | public boolean sizeProxyToSource(Code) | | true to set proxy dimensions the same as the drag widget.
Default value is true
|
updateZIndex | public boolean updateZIndex(Code) | | updateZIndex specifies if the CSS z-index should be updated on the widget
being dragged. Setting this value to true will ensure that
the dragged element is always displayed over all other widgets. Default
value is true .
|
useProxy | public boolean useProxy(Code) | | true to use a proxy widget during drag operation. Default
value is true
|
Draggable | public Draggable(Component dragWidget)(Code) | | Creates a new draggable instance.
Parameters: dragWidget - the widget to be dragged |
Draggable | public Draggable(Component dragWidget, Component handle)(Code) | | Create a new draggable instance.
Parameters: dragWidget - the widget to be dragged Parameters: handle - the widget drags will be initiated from |
addDragListener | public void addDragListener(DragListener listener)(Code) | | Adds a listener to receive drag events.
Parameters: listener - the drag listener to be added |
getDragHandle | public Widget getDragHandle()(Code) | | Returns the drag handle.
the drag handle |
getDragWidget | public Widget getDragWidget()(Code) | | Returns the widget being dragged.
the drag widget |
isDragging | public boolean isDragging()(Code) | | Returns true if a drag is in progress.
the drag state |
removeDragListener | public void removeDragListener(DragListener listener)(Code) | | Removes a previously added listener.
Parameters: listener - the listener to be removed |
setEnabled | public void setEnabled(boolean enabled)(Code) | | Enables dragging if the argument is true , and disables it
otherwise.
Parameters: enabled - the new enabled state |
setXConstraint | public void setXConstraint(int left, int right)(Code) | | Constrains the horizontal travel.
Parameters: left - the number of pixels the element can move to the left Parameters: right - the number of pixels the element can move to the right |
setYConstraint | public void setYConstraint(int top, int bottom)(Code) | | Constrains the vertical travel.
Parameters: top - the number of pixels the element can move to the up Parameters: bottom - the number of pixels the element can move to the down |
|
|