com.extjs.gxt.ui.client.fx
Class Resizable

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.fx.Resizable
All Implemented Interfaces:
Observable

public class Resizable
extends BaseObservable

Applies drag handles to a widget to make it resizable. The drag handles are inserted into the widget and positioned absolute.

Here is the list of valid resize handles:

 Value   Description
 ------  -------------------
 'n'     north
 's'     south
 'e'     east
 'w'     west
 'nw'    northwest
 'sw'    southwest
 'se'    southeast
 'ne'    northeast
 'all'   all
 
Events:
ResizeStart : (source, widget, event)
Fires before a resize operation start. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
ResizeEnd : (source, widget, event)
Fires after a resize.


Nested Class Summary
protected static class Resizable.Dir
           
 
Constructor Summary
Resizable(BoxComponent resize)
          Creates a new resizable instance with 8-way resizing.
Resizable(BoxComponent resize, java.lang.String handles)
          Creates a new resizable instance.
 
Method Summary
 void addResizeListener(ResizeListener listener)
          Adds a resize listener.
protected  com.google.gwt.user.client.Element createProxy()
           
 int getMaxHeight()
          Returns the max height
 int getMaxWidth()
          Returns the max width.
 int getMinHeight()
          Returns the min height.
 int getMinWidth()
          Returns the min width.
 java.lang.String getProxyStyle()
          Returns the proxy style.
protected  void init()
           
 boolean isDynamic()
          Returns true if widget is being resized directly.
 boolean isPreserveRatio()
          Returns true if the aspect ratio is being preserved.
 boolean isResizing()
          Returns true if if resizing.
protected  void onAttach()
           
protected  void onComponentResize()
           
protected  void onDetach()
           
 void release()
          Removes the drag handles.
 void removeResizeListener(ResizeListener listener)
          Removes a resize listener.
 void setDynamic(boolean dynamic)
          True to resize the widget directly instead of using a proxy (defaults to false).
 void setEnabled(boolean enable)
          Enables or disables the drag handles.
 void setMaxHeight(int maxHeight)
          Sets the max height (defaults to 2000).
 void setMaxWidth(int maxWidth)
          Sets the max width (defaults to 2000).
 void setMinHeight(int minHeight)
          Sets the min height (default to 50).
 void setMinWidth(int minWidth)
          Sets the min width (defaults to 50).
 void setPreserveRatio(boolean preserveRatio)
          True to preserve the original ratio between height and width during resize (defaults to false).
 void setProxyStyle(java.lang.String proxyStyle)
          Sets the style name used for proxy drags (defaults to 'x-resizable-proxy').
 void syncHandleHeight()
           
 
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
 

Constructor Detail

Resizable

public Resizable(BoxComponent resize)
Creates a new resizable instance with 8-way resizing.

Parameters:
resize - the resize widget

Resizable

public Resizable(BoxComponent resize,
                 java.lang.String handles)
Creates a new resizable instance.

Parameters:
resize - the resize widget
handles - the resize handle locations separated by spaces
Method Detail

addResizeListener

public void addResizeListener(ResizeListener listener)
Adds a resize listener.

Parameters:
listener - the listener

getMaxHeight

public int getMaxHeight()
Returns the max height

Returns:
the max height

getMaxWidth

public int getMaxWidth()
Returns the max width.

Returns:
the max width

getMinHeight

public int getMinHeight()
Returns the min height.

Returns:
the min height

getMinWidth

public int getMinWidth()
Returns the min width.

Returns:
the min width

getProxyStyle

public java.lang.String getProxyStyle()
Returns the proxy style.

Returns:
the proxy style

isDynamic

public boolean isDynamic()
Returns true if widget is being resized directly.

Returns:
the dynamic state

isPreserveRatio

public boolean isPreserveRatio()
Returns true if the aspect ratio is being preserved.

Returns:
true if the aspect ratio is being preserved

isResizing

public boolean isResizing()
Returns true if if resizing.

Returns:
the resize state

release

public void release()
Removes the drag handles.


removeResizeListener

public void removeResizeListener(ResizeListener listener)
Removes a resize listener.

Parameters:
listener - the listener

setDynamic

public void setDynamic(boolean dynamic)
True to resize the widget directly instead of using a proxy (defaults to false).

Parameters:
dynamic - true to resize directly

setEnabled

public void setEnabled(boolean enable)
Enables or disables the drag handles.

Parameters:
enable - true to enable

setMaxHeight

public void setMaxHeight(int maxHeight)
Sets the max height (defaults to 2000).

Parameters:
maxHeight - the max height

setMaxWidth

public void setMaxWidth(int maxWidth)
Sets the max width (defaults to 2000).

Parameters:
maxWidth - the max width

setMinHeight

public void setMinHeight(int minHeight)
Sets the min height (default to 50).

Parameters:
minHeight - the min height

setMinWidth

public void setMinWidth(int minWidth)
Sets the min width (defaults to 50).

Parameters:
minWidth - the min width

setPreserveRatio

public void setPreserveRatio(boolean preserveRatio)
True to preserve the original ratio between height and width during resize (defaults to false).

Parameters:
preserveRatio - true to preserve the original aspect ratio

setProxyStyle

public void setProxyStyle(java.lang.String proxyStyle)
Sets the style name used for proxy drags (defaults to 'x-resizable-proxy').

Parameters:
proxyStyle - the proxy style

syncHandleHeight

public void syncHandleHeight()

createProxy

protected com.google.gwt.user.client.Element createProxy()

init

protected void init()

onAttach

protected void onAttach()

onComponentResize

protected void onComponentResize()

onDetach

protected void onDetach()