
public class Resizable extends Object implements ResizeStartEvent.HasResizeStartHandlers, ResizeEndEvent.HasResizeEndHandlers
Applies drag handles to a widget to make it resizable. The drag handles are inserted into the widget and positioned absolute.
Only Component instances can be used with Resizable as Widget's do not fire
resize events. Widgets can be wrapped in a WidgetComponent instance to use with Resizable.
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
| Modifier and Type | Class and Description |
|---|---|
static class |
Resizable.Dir
The location of the resize handle in standard compass points.
|
static interface |
Resizable.ResizableAppearance |
| Constructor and Description |
|---|
Resizable(Component resize)
Creates a new resizable instance with 8-way resizing.
|
Resizable(Component resize,
Resizable.Dir... handles)
Creates a new resizable instance with the default appearance.
|
Resizable(Resizable.ResizableAppearance appearance,
Component resize,
Resizable.Dir... handles)
Creates a new resizable instance with the specified appearance.
|
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addResizeEndHandler(ResizeEndEvent.ResizeEndHandler handler)
Adds a
ResizeEndEvent.ResizeEndHandler handler for ResizeEndEvent
events. |
HandlerRegistration |
addResizeStartHandler(ResizeStartEvent.ResizeStartHandler handler)
Adds a
ResizeStartEvent.ResizeStartHandler handler for ResizeStartEvent
events. |
protected Element |
createProxy() |
Resizable.ResizableAppearance |
getAppearance() |
int |
getMaxHeight()
Returns the max height
|
int |
getMaxWidth()
Returns the max width.
|
int |
getMinHeight()
Returns the minimum height.
|
int |
getMinWidth()
Returns the minimum width.
|
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 |
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 minimum height (default to 50).
|
void |
setMinWidth(int minWidth)
Sets the minimum width (defaults to 50).
|
void |
setPreserveRatio(boolean preserveRatio)
True to preserve the original ratio between height and width during resize (defaults to false).
|
protected void |
syncHandleHeight() |
public Resizable(Component resize)
resize - the resize widgetpublic Resizable(Component resize, Resizable.Dir... handles)
resize - the resize widgethandles - the resize handle locationspublic Resizable(Resizable.ResizableAppearance appearance, Component resize, Resizable.Dir... handles)
appearance - the appearance of the resizableresize - the resize widgethandles - the resize handle locationspublic HandlerRegistration addResizeEndHandler(ResizeEndEvent.ResizeEndHandler handler)
ResizeEndEvent.HasResizeEndHandlersResizeEndEvent.ResizeEndHandler handler for ResizeEndEvent
events.addResizeEndHandler in interface ResizeEndEvent.HasResizeEndHandlershandler - the handlerpublic HandlerRegistration addResizeStartHandler(ResizeStartEvent.ResizeStartHandler handler)
ResizeStartEvent.HasResizeStartHandlersResizeStartEvent.ResizeStartHandler handler for ResizeStartEvent
events.addResizeStartHandler in interface ResizeStartEvent.HasResizeStartHandlershandler - the handlerpublic Resizable.ResizableAppearance getAppearance()
public int getMaxHeight()
public int getMaxWidth()
public int getMinHeight()
public int getMinWidth()
public boolean isDynamic()
public boolean isPreserveRatio()
public boolean isResizing()
true if if resizing.public void release()
public void setDynamic(boolean dynamic)
dynamic - true to resize directlypublic void setEnabled(boolean enable)
enable - true to enablepublic void setMaxHeight(int maxHeight)
maxHeight - the max heightpublic void setMaxWidth(int maxWidth)
maxWidth - the max widthpublic void setMinHeight(int minHeight)
minHeight - the minimum heightpublic void setMinWidth(int minWidth)
minWidth - the minimum widthpublic void setPreserveRatio(boolean preserveRatio)
preserveRatio - true to preserve the original aspect ratioprotected Element createProxy()
protected void init()
protected void onAttach()
protected void onComponentResize()
protected void onDetach()
protected void syncHandleHeight()
Copyright © 2018. All rights reserved.