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 set the doit field to false to cancel the action.
ResizeEnd : (source, widget, event)
Fires after a resize.


Field Summary
 boolean dynamic
          True to resize the widget directly instead of using a proxy (defaults to false).
 int maxHeight
          The maximum height for the widget (defaults 2000).
 int maxWidth
          The maximum width for the widget (defaults to 2000).
 int minHeight
          The minimum height for the widget (defaults to 50).
 int minWidth
          The minumum width for the widget (defaults to 50).
 boolean preserveRatio
          true to preserve the original ratio between height and width during resize.
 java.lang.String proxyStyle
          The style name used for proxy drags (defaults to 'x-resizable-proxy').
 
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.
 boolean isResizing()
          Returns true if if resizing.
 void release()
          Removes the drag handles.
 void removeResizeListener(ResizeListener listener)
          Removes a resize listener.
 void setEnabled(boolean enable)
          Enables or disables the drag handles.
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minWidth

public int minWidth
The minumum width for the widget (defaults to 50).


maxWidth

public int maxWidth
The maximum width for the widget (defaults to 2000).


minHeight

public int minHeight
The minimum height for the widget (defaults to 50).


maxHeight

public int maxHeight
The maximum height for the widget (defaults 2000).


preserveRatio

public boolean preserveRatio
true to preserve the original ratio between height and width during resize. Default value is false.


proxyStyle

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


dynamic

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

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 seperated by spaces
Method Detail

addResizeListener

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

Parameters:
listener - the listener

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

setEnabled

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

Parameters:
enable - true to enable