Packageorg.aswing.geom
Classpublic class IntDimension

The Dimension class encapsulates the width and height of a componentin a single object.
Note this Class use int as its parameters on purpose to avoid problems that happended in aswing before.



Public Properties
 PropertyDefined by
  height : int = 0
IntDimension
  width : int = 0
IntDimension
Public Methods
 MethodDefined by
  
IntDimension(width:int = 0, height:int = 0)
Creates a dimension.
IntDimension
  
change(deltaW:int, deltaH:int):IntDimension
modify the size and return itself.
IntDimension
  
changedSize(deltaW:int, deltaH:int):IntDimension
return a new size with this size with a change.
IntDimension
  
Duplicates current instance.
IntDimension
  
Combines current and specified dimensions by getting max sizes and puts result into itself.
IntDimension
  
Combines current and specified dimensions by getting max sizes and returns new IntDimension object
IntDimension
  
[static] Create a big dimension for component.
IntDimension
  
Decreases the size by s and return its self(this).
IntDimension
  
equals(o:Object):Boolean
Returns whether or not the passing o is an same value IntDimension.
IntDimension
  
getBounds(x:int = 0, y:int = 0):IntRectangle
return a new bounds with this size with a location.
IntDimension
  
Increases the size by s and return its self(this).
IntDimension
  
Sets the size as same as the dim.
IntDimension
  
setSizeWH(width:int, height:int):void
Sets the size with width and height.
IntDimension
  
toString():String
IntDimension
Property detail
heightproperty
public var height:int = 0
widthproperty 
public var width:int = 0
Constructor detail
IntDimension()constructor
public function IntDimension(width:int = 0, height:int = 0)

Creates a dimension.

Parameters
width:int (default = 0)
 
height:int (default = 0)
Method detail
change()method
public function change(deltaW:int, deltaH:int):IntDimension

modify the size and return itself.

Parameters
deltaW:int
 
deltaH:int

Returns
IntDimension
changedSize()method 
public function changedSize(deltaW:int, deltaH:int):IntDimension

return a new size with this size with a change.

Parameters
deltaW:int
 
deltaH:int

Returns
IntDimension
clone()method 
public function clone():IntDimension

Duplicates current instance.

Returns
IntDimension — copy of the current instance.
combine()method 
public function combine(d:IntDimension):IntDimension

Combines current and specified dimensions by getting max sizes and puts result into itself.

Parameters
d:IntDimension

Returns
IntDimension — the combined dimension itself.
combineSize()method 
public function combineSize(d:IntDimension):IntDimension

Combines current and specified dimensions by getting max sizes and returns new IntDimension object

Parameters
d:IntDimension

Returns
IntDimension — a new dimension with combined size.
createBigDimension()method 
public static function createBigDimension():IntDimension

Create a big dimension for component.

Returns
IntDimension — a IntDimension(100000, 100000)
decreaseSize()method 
public function decreaseSize(s:IntDimension):IntDimension

Decreases the size by s and return its self(this).

Parameters
s:IntDimension

Returns
IntDimensionthis.
equals()method 
public function equals(o:Object):Boolean

Returns whether or not the passing o is an same value IntDimension.

Parameters
o:Object

Returns
Boolean
getBounds()method 
public function getBounds(x:int = 0, y:int = 0):IntRectangle

return a new bounds with this size with a location.

Parameters
x:int (default = 0) — the location x.
 
y:int (default = 0)

Returns
IntRectangle — the bounds.
increaseSize()method 
public function increaseSize(s:IntDimension):IntDimension

Increases the size by s and return its self(this).

Parameters
s:IntDimension

Returns
IntDimensionthis.
setSize()method 
public function setSize(dim:IntDimension):void

Sets the size as same as the dim.

Parameters
dim:IntDimension
setSizeWH()method 
public function setSizeWH(width:int, height:int):void

Sets the size with width and height.

Parameters
width:int
 
height:int
toString()method 
public function toString():String

Returns
String