|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sgx.j2s.js.NativeWrapper org.sgx.j2s.yui3.yui.YUINativeWrapper org.sgx.j2s.yui3.yui.event.EventTarget org.sgx.j2s.yui3.yui.Attribute org.sgx.j2s.yui3.yui.Base org.sgx.j2s.aui.Resize
public class Resize
A base class for Resize, providing:
Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)
Applies drag handles to an element to make it resizable
Here is the list of valid resize handles: [ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]. You can read this list as top, top-right, right, bottom-right, bottom, bottom-left, left, top-left.
The drag handles are inserted into the element and positioned absolute. Some elements, such as a textarea or image, don't support children. To overcome that, set wrap:true in your config and the element willbe wrapped for you automatically.
Quick Example:
var instance = new A.Resize({ node: '#resize1', proxy: true, preserveRatio: true, wrap: true, maxHeight: 170, maxWidth: 400, handles: 't, tr, r, br, b, bl, l, tl' });
Field Summary |
---|
Fields inherited from class org.sgx.j2s.yui3.yui.YUINativeWrapper |
---|
Y |
Fields inherited from class org.sgx.j2s.js.NativeWrapper |
---|
_data, _EMPTYPARAMS |
Constructor Summary | |
---|---|
Resize()
|
Method Summary | |
---|---|
void |
eachHandle(java.lang.Runnable fn)
Loop through each handle which is being used and executes a callback. |
java.lang.Object |
getConstrain2node()
Constrain the resize to a particular node. |
java.lang.Object |
getConstrain2region()
Constrain the resize to a particular region. |
java.lang.Object |
getConstrain2view()
constrain2view - Object Will attempt to constrain the drag node to the boundaries of the viewport region. |
java.lang.String[] |
getHandles()
handles - Array | String The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. |
int |
getMaxHeight()
The maximum height of the element Default Value: Infinity |
int |
getMaxWidth()
maxWidth - Number The maximum width of the element Default Value: Infinity |
int |
getMinHeight()
minHeight - Number The minimum height of the element Default Value: 15 |
int |
getMinWidth()
minWidth - Number The minimum width of the element Default Value: 15 |
java.lang.Object |
getNode()
node - Node The selector or element to resize. |
java.lang.Object |
getProxyEl()
proxyEl - String | Node The Resize proxy element. |
java.lang.Object |
getTickX()
tickX - Number | false The number of x ticks to span the resize to. |
java.lang.Object |
getTickY()
tickY - Number | false The number of y ticks to span the resize to. |
java.lang.Object |
getWrapper()
wrapper - writeonce String | Node Element to wrap the wrapTypes. |
java.lang.Object |
getWrapTypes()
wrapTypes - Regex Elements that requires a wrapper by default. |
boolean |
isAutoHide()
False to ensure that the resize handles are always visible, true to display them only when the user mouses over the resizable borders. |
boolean |
isPreserveRatio()
preserveRatio - boolean Maintain the element's ratio when resizing. |
boolean |
isProxy()
proxy - boolean Resize a proxy element instead of the real element. |
boolean |
isResizing()
resizing - boolean True when the element is being Resized. |
boolean |
isWrap()
wrap - boolean True to wrap an element with a div if needed (required for textareas and images, defaults to false) in favor of the handles config option. |
void |
setAutoHide(boolean autoHide)
False to ensure that the resize handles are always visible, true to display them only when the user mouses over the resizable borders. |
void |
setConstrain2node(java.lang.Object constrain2node)
Constrain the resize to a particular node. |
void |
setConstrain2region(java.lang.Object constrain2region)
Constrain the resize to a particular region. |
void |
setConstrain2view(java.lang.Object constrain2view)
constrain2view - Object Will attempt to constrain the drag node to the boundaries of the viewport region. |
void |
setHandles(java.lang.String[] handles)
handles - Array | String The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. |
void |
setMaxHeight(int maxHeight)
The maximum height of the element Default Value: Infinity |
void |
setMaxWidth(int maxWidth)
maxWidth - Number The maximum width of the element Default Value: Infinity |
void |
setMinHeight(int minHeight)
minHeight - Number The minimum height of the element Default Value: 15 |
void |
setMinWidth(int minWidth)
minWidth - Number The minimum width of the element Default Value: 15 |
void |
setNode(java.lang.Object node)
node - Node The selector or element to resize. |
void |
setPreserveRatio(boolean preserveRatio)
preserveRatio - boolean Maintain the element's ratio when resizing. |
void |
setProxy(boolean proxy)
proxy - boolean Resize a proxy element instead of the real element. |
void |
setProxyEl(java.lang.Object proxyEl)
proxyEl - String | Node The Resize proxy element. |
void |
setResizing(boolean resizing)
resizing - boolean True when the element is being Resized. |
void |
setTickX(java.lang.Object tickX)
tickX - Number | false The number of x ticks to span the resize to. |
void |
setTickY(java.lang.Object tickY)
tickY - Number | false The number of y ticks to span the resize to. |
void |
setWrap(boolean wrap)
wrap - boolean True to wrap an element with a div if needed (required for textareas and images, defaults to false) in favor of the handles config option. |
void |
setWrapper(java.lang.Object wrapper)
wrapper - writeonce String | Node Element to wrap the wrapTypes. |
void |
setWrapTypes(java.lang.Object wrapTypes)
wrapTypes - Regex Elements that requires a wrapper by default. |
Methods inherited from class org.sgx.j2s.yui3.yui.Attribute |
---|
addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs |
Methods inherited from class org.sgx.j2s.yui3.yui.event.EventTarget |
---|
after, before, detach, detachAll, fire, getEvent, on, once, publish |
Methods inherited from class org.sgx.j2s.yui3.yui.YUINativeWrapper |
---|
_load |
Methods inherited from class org.sgx.j2s.js.NativeWrapper |
---|
_call, _get, _getData, create |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Resize()
Method Detail |
---|
public boolean isAutoHide()
public void setAutoHide(boolean autoHide)
public java.lang.Object getConstrain2node()
public void setConstrain2node(java.lang.Object constrain2node)
public java.lang.Object getConstrain2region()
public void setConstrain2region(java.lang.Object constrain2region)
public java.lang.Object getConstrain2view()
public void setConstrain2view(java.lang.Object constrain2view)
public java.lang.String[] getHandles()
public void setHandles(java.lang.String[] handles)
public int getMaxHeight()
public void setMaxHeight(int maxHeight)
public int getMaxWidth()
public void setMaxWidth(int maxWidth)
public int getMinHeight()
public void setMinHeight(int minHeight)
public int getMinWidth()
public void setMinWidth(int minWidth)
public java.lang.Object getNode()
public void setNode(java.lang.Object node)
public boolean isPreserveRatio()
public void setPreserveRatio(boolean preserveRatio)
public boolean isProxy()
public void setProxy(boolean proxy)
public java.lang.Object getProxyEl()
public void setProxyEl(java.lang.Object proxyEl)
public boolean isResizing()
public void setResizing(boolean resizing)
public java.lang.Object getTickX()
public void setTickX(java.lang.Object tickX)
public java.lang.Object getTickY()
public void setTickY(java.lang.Object tickY)
public boolean isWrap()
public void setWrap(boolean wrap)
public java.lang.Object getWrapper()
public void setWrapper(java.lang.Object wrapper)
public java.lang.Object getWrapTypes()
public void setWrapTypes(java.lang.Object wrapTypes)
public void eachHandle(java.lang.Runnable fn)
Loop through each handle which is being used and executes a callback. Example: instance.eachHandle( function(handleName, index) { ... } ); Parameters: fnCallback function to be executed for each handle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |