Packageorg.aswing.resizer
Classpublic class ResizerController

ResizerController make manage resizer feature easily.
  var button : JButton = new JButton("click");
  button.setSize( 100,25 );
  button.setLocation( 100, 100 );
  
  var label1 : JLabel = new JLabel("avoid resizing");
  label1.setSize(100, 25);
  label1.setLocation( 200, 50 );
  
  var label2 : JLabel = new JLabel("ok for resizing");
  label2.setSize(100, 25);
  label2.setLocation( 50, 50 );
  label2.setOpaque( true );
 
  try
  {
   // Direct affectation
   var resizer : ResizerController = ResizerController.init( button );
   
   // Simple call to #init method
   ResizerController.init( label1 );
   ResizerController.init( label2 );
  }
  catch( e : Error )
  {
   // log error message
  }
  
  //We can retreive ResizerController for a specific component like :
  var labelResizer : ResizerController = ResizerController.getController( label1 );
  labelResizer.setResizable( false );
  
  resizer.setResizeDirectly( true );
  
  // content must have a layout set to EmptyLayout to allow correct resizing
  content.append( button );
  content.append( label1 );
  content.append( label2 );
 

Many thanks Romain Ecarnot, this class is based on his ResizerController, and all resizer implement are inspired by him.



Public Methods
 MethodDefined by
  
ResizerController(comp:Component, resizer:Resizer = null)
Constructor.
ResizerController
  
create(comp:Component, resizer:Resizer = null):ResizerController
[static] Create resizing behaviour to passed-in component.
ResizerController
  
destroy():void
Destroy this resizercontroller, set the resizer to null.
ResizerController
  
Returns reference to the real used component.
ResizerController
  
[static] Returns the default resizer class.
ResizerController
  
Returns the resizer controller defined in {
ResizerController
  
isResizable():Boolean
Returns whether this component is resizable by the user.
ResizerController
  
isResizeDirectly():Boolean
Return whether need resize widget directly when drag the resizer arrow.
ResizerController
  
setDefaultResizerClass(cl:Class):void
[static] Sets the default resizer class.
ResizerController
  
setResizable(b:Boolean):void
Sets whether this component is resizable by the user.
ResizerController
  
setResizeDirectly(b:Boolean):void
Indicate whether need resize widget directly when drag the resizer arrow.
ResizerController
  
Sets the {
ResizerController
Constructor detail
ResizerController()constructor
public function ResizerController(comp:Component, resizer:Resizer = null)

Constructor.

Parameters
comp:Component — Component where applying resize behaviour.
 
resizer:Resizer (default = null) — the resizer, default is null means to create a default one.
Method detail
create()method
public static function create(comp:Component, resizer:Resizer = null):ResizerController

Create resizing behaviour to passed-in component.

Parameters
comp:Component — the component which need to be resizable
 
resizer:Resizer (default = null) — (optional)the resizer, default there will be a default one instance created.

Returns
ResizerController
destroy()method 
public function destroy():void

Destroy this resizercontroller, set the resizer to null.

getComponent()method 
public function getComponent():Component

Returns reference to the real used component.

Returns
Component
getDefaultResizerClass()method 
public static function getDefaultResizerClass():Class

Returns the default resizer class.

Returns
Class
getResizer()method 
public function getResizer():Resizer

Returns the resizer controller defined in {

Returns
Resizer

See also

isResizable()method 
public function isResizable():Boolean

Returns whether this component is resizable by the user.

By default, all components are initially resizable.

Returns
Boolean

See also

isResizeDirectly()method 
public function isResizeDirectly():Boolean

Return whether need resize widget directly when drag the resizer arrow.

Returns
Boolean

See also

setDefaultResizerClass()method 
public static function setDefaultResizerClass(cl:Class):void

Sets the default resizer class.

Parameters
cl:Class — the default resizer class.
setResizable()method 
public function setResizable(b:Boolean):void

Sets whether this component is resizable by the user.

Parameters
b:Boolean — {

See also

setResizeDirectly()method 
public function setResizeDirectly(b:Boolean):void

Indicate whether need resize widget directly when drag the resizer arrow.

if set to {Parameters

b:Boolean

See also

org.aswing.Resizer.setResizeDirectly()
setResizer()method 
public function setResizer(r:Resizer):void

Sets the {

Parameters
r:Resizer — {

See also