|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.fx.Draggable
public class Draggable
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 'x-nodrag' style it will not trigger a drag operation.
Field Summary | |
---|---|
protected int |
conHeight
|
protected int |
conWidth
|
protected int |
conX
|
protected int |
conY
|
protected int |
dragStartX
|
protected int |
dragStartY
|
protected int |
lastX
|
protected int |
lastY
|
protected El |
proxyEl
|
protected com.extjs.gxt.ui.client.util.Rectangle |
startBounds
|
Constructor Summary | |
---|---|
Draggable(com.extjs.gxt.ui.client.widget.Component dragComponent)
Creates a new draggable instance. |
|
Draggable(com.extjs.gxt.ui.client.widget.Component dragComponent,
com.extjs.gxt.ui.client.widget.Component handle)
Create a new draggable instance. |
Method Summary | |
---|---|
void |
addDragListener(com.extjs.gxt.ui.client.event.DragListener listener)
Adds a listener to receive drag events. |
protected void |
afterDrag()
|
void |
cancelDrag()
Cancels the drag if running. |
protected El |
createProxy()
|
com.extjs.gxt.ui.client.widget.Component |
getContainer()
Returns the drag container. |
com.extjs.gxt.ui.client.widget.Component |
getDragHandle()
Returns the drag handle. |
com.extjs.gxt.ui.client.widget.Component |
getDragWidget()
Returns the widget being dragged. |
java.lang.String |
getProxyStyle()
Returns the proxy style. |
int |
getStartDragDistance()
Returns the number of pixels the cursor must move before dragging begins. |
boolean |
isConstrainClient()
Returns true if drag is constrained to the viewport. |
boolean |
isConstrainHorizontal()
Returns true if horizontal movement is constrained. |
boolean |
isConstrainVertical()
Returns true if vertical movement is constrained. |
boolean |
isDragging()
Returns true if a drag is in progress. |
boolean |
isEnabled()
Returns true if enabled. |
boolean |
isMoveAfterProxyDrag()
Returns true if the drag widget is moved after a proxy drag. |
boolean |
isSizeProxyToSource()
Returns true if the proxy element is sized to match the drag widget. |
boolean |
isUpdateZIndex()
Returns true if the z-index is updated after a drag. |
boolean |
isUseProxy()
Returns true if proxy element is enabled. |
protected void |
onMouseDown(com.extjs.gxt.ui.client.event.ComponentEvent ce)
|
protected void |
onMouseMove(com.google.gwt.user.client.Event event)
|
void |
release()
Removes the drag handles. |
void |
removeDragListener(com.extjs.gxt.ui.client.event.DragListener listener)
Removes a previously added listener. |
void |
setConstrainClient(boolean constrainClient)
True to set constrain movement to the viewport (defaults to true). |
void |
setConstrainHorizontal(boolean constrainHorizontal)
True to stop horizontal movement (defaults to false). |
void |
setConstrainVertical(boolean constrainVertical)
True to stop vertical movement (defaults to false). |
void |
setContainer(com.extjs.gxt.ui.client.widget.Component container)
Specifies a container to which the drag widget is constrained. |
void |
setEnabled(boolean enabled)
Enables dragging if the argument is true , and disables it
otherwise. |
void |
setMoveAfterProxyDrag(boolean moveAfterProxyDrag)
True to move source widget after a proxy drag (defaults to true). |
void |
setProxy(El element)
Sets the proxy element. |
void |
setProxyStyle(java.lang.String proxyStyle)
Sets the style name used for proxy drags (defaults to 'my-drag-proxy'). |
void |
setSizeProxyToSource(boolean sizeProxyToSource)
True to set proxy dimensions the same as the drag widget (defaults to true). |
void |
setStartDragDistance(int startDragDistance)
Specifies how far the cursor must move after mousedown to start dragging (defaults to 2). |
void |
setUpdateZIndex(boolean updateZIndex)
True if the CSS z-index should be updated on the widget being dragged. |
void |
setUseProxy(boolean useProxy)
True to use a proxy widget during drag operation (defaults to true). |
void |
setXConstraint(int left,
int right)
Constrains the horizontal travel. |
void |
setYConstraint(int top,
int bottom)
Constrains the vertical travel. |
protected void |
startDrag(com.google.gwt.user.client.Event event)
|
protected void |
stopDrag(com.google.gwt.user.client.Event event)
|
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable |
---|
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int conX
protected int conY
protected int conWidth
protected int conHeight
protected int dragStartX
protected int dragStartY
protected int lastX
protected int lastY
protected com.extjs.gxt.ui.client.util.Rectangle startBounds
protected El proxyEl
Constructor Detail |
---|
public Draggable(com.extjs.gxt.ui.client.widget.Component dragComponent)
dragComponent
- the component to be draggedpublic Draggable(com.extjs.gxt.ui.client.widget.Component dragComponent, com.extjs.gxt.ui.client.widget.Component handle)
dragComponent
- the component to be draggedhandle
- the component drags will be initiated fromMethod Detail |
---|
public void addDragListener(com.extjs.gxt.ui.client.event.DragListener listener)
listener
- the drag listener to be addedpublic void cancelDrag()
public com.extjs.gxt.ui.client.widget.Component getContainer()
public com.extjs.gxt.ui.client.widget.Component getDragHandle()
public com.extjs.gxt.ui.client.widget.Component getDragWidget()
public java.lang.String getProxyStyle()
public int getStartDragDistance()
public boolean isConstrainClient()
public boolean isConstrainHorizontal()
public boolean isConstrainVertical()
public boolean isDragging()
true
if a drag is in progress.
public boolean isEnabled()
true
if enabled.
public boolean isMoveAfterProxyDrag()
public boolean isSizeProxyToSource()
public boolean isUpdateZIndex()
public boolean isUseProxy()
public void release()
public void removeDragListener(com.extjs.gxt.ui.client.event.DragListener listener)
listener
- the listener to be removedpublic void setConstrainClient(boolean constrainClient)
constrainClient
- true to constrain to viewportpublic void setConstrainHorizontal(boolean constrainHorizontal)
constrainHorizontal
- true to stop horizontal movementpublic void setConstrainVertical(boolean constrainVertical)
constrainVertical
- true to stop vertical movementpublic void setContainer(com.extjs.gxt.ui.client.widget.Component container)
container
- the containerpublic void setEnabled(boolean enabled)
true
, and disables it
otherwise.
enabled
- the new enabled statepublic void setMoveAfterProxyDrag(boolean moveAfterProxyDrag)
moveAfterProxyDrag
- true to move after a proxy dragpublic void setProxy(El element)
element
- the proxy elementpublic void setProxyStyle(java.lang.String proxyStyle)
proxyStyle
- the proxy stylepublic void setSizeProxyToSource(boolean sizeProxyToSource)
sizeProxyToSource
- true to update proxy sizepublic void setStartDragDistance(int startDragDistance)
startDragDistance
- the start distance in pixelspublic void setUpdateZIndex(boolean updateZIndex)
true
will ensure that the dragged
element is always displayed over all other widgets (defaults to true).
updateZIndex
- true update the z-indexpublic void setUseProxy(boolean useProxy)
useProxy
- true use a proxypublic void setXConstraint(int left, int right)
left
- the number of pixels the element can move to the leftright
- the number of pixels the element can move to the rightpublic void setYConstraint(int top, int bottom)
top
- the number of pixels the element can move to the upbottom
- the number of pixels the element can move to the downprotected void afterDrag()
protected El createProxy()
protected void onMouseDown(com.extjs.gxt.ui.client.event.ComponentEvent ce)
protected void onMouseMove(com.google.gwt.user.client.Event event)
protected void startDrag(com.google.gwt.user.client.Event event)
protected void stopDrag(com.google.gwt.user.client.Event event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |