qnx.fuse.ui.utils.LayoutUtil

LayoutUtil

Methods


Packageqnx.fuse.ui.utils
Classpublic class LayoutUtil
InheritanceLayoutUtil Inheritance Object

A set of helper methods for layout and component measurement.

Class information:
BlackBerry 10 Version:   10.0.0



Public Methods

 MethodDefined By
  
addHints(hint1:Number, hint2:Number):Number
[static] Adds two layout constraint hints.
LayoutUtil
  
computeAlignment(cellStart:Number, cellSize:Number, controlSize:Number, align:String):Number
[static] Computes the position of the control in a cell basd on the alignment.
LayoutUtil
  
contains(container:IContainer, child:DisplayObject):Boolean
[static] Checks if a display object is the immediate child of a container.
LayoutUtil
  
[static] Returns a Vector of ILayoutElement that participate in layout.
LayoutUtil
  
removeFrom(container:IContainer, child:DisplayObject):void
[static] Safely removes a child display object from a parent container.
LayoutUtil
  
restrictPoint(pointToCorrect:Point, widthHint:Number, heightHint:Number):Point
[static] Restricts the supplied point to the width and hegiht hints.
LayoutUtil

Method Detail

addHints()


public static function addHints(hint1:Number, hint2:Number):Number

Adds two layout constraint hints.

Parameters

hint1:Number — The first hint.
hint2:Number — The second hint.

Returns

Number — The sum of the two hints.

computeAlignment()


public static function computeAlignment(cellStart:Number, cellSize:Number, controlSize:Number, align:String):Number

Computes the position of the control in a cell basd on the alignment.

Parameters

cellStart:Number — The starting position of the cell.
cellSize:Number — The size of the cell.
controlSize:Number — The size of the control.
align:String — The alignment of the control.

Returns

Number — Returns the new position of the control in the cell.

contains()


public static function contains(container:IContainer, child:DisplayObject):Boolean

Checks if a display object is the immediate child of a container.

Parameters

container:IContainer — The parent container.
child:DisplayObject — The object to check

Returns

Boolean — true if child is truely an immediate child of container.

getLayoutElements()


public static function getLayoutElements(container:IContainer):Vector.<ILayoutElement>

Returns a Vector of ILayoutElement that participate in layout.

Parameters

container:IContainer — The container in which to search for ILayoutElement that should be included in the layout.

Returns

Vector.<ILayoutElement> — A Vector of ILayoutElement that participate in layout.

removeFrom()


public static function removeFrom(container:IContainer, child:DisplayObject):void

Safely removes a child display object from a parent container.

Parameters

container:IContainer — The parent container.
child:DisplayObject — The child to be removed

restrictPoint()


public static function restrictPoint(pointToCorrect:Point, widthHint:Number, heightHint:Number):Point

Restricts the supplied point to the width and hegiht hints.

Parameters

pointToCorrect:Point — The point to restrict
widthHint:Number — The width restriction.
heightHint:Number — The height restriction.

Returns

Point — The restricted point.




comments powered by Disqus