qnx.fuse.ui.layouts.SizeCache

SizeCache

Properties | Methods


Packageqnx.fuse.ui.layouts
Classpublic final class SizeCache
InheritanceSizeCache Inheritance Object

Caches the preferred size of a control so that it does not need to be recomputed every time.

Class information:
BlackBerry 10 Version:   10.0.0

See also

LayoutMeasurement



Public Properties

 PropertyDefined By
  independentDimensions : Boolean
Gets or sets a boolean that indicates whether or not the dimensions (height and width) of a control can be modified independently of one another.
SizeCache
  preferredHeightConstantForLargerThanPreferredWidth : Boolean
Gets or sets a boolean that sets the preferred height of the control as the default constant for any width that is wider than the preferred width.
SizeCache

Public Methods

 MethodDefined By
  
Creates a SizeCache instance.
SizeCache
  
flush():void
Flushes the cache in order to recompute the size values and cache them.
SizeCache
  
getPreferredSize(width:Number, height:Number, callback:Function):Point
Returns the preferred size of the control.
SizeCache
  
measure(width:Number, height:Number, callback:Function):LayoutMeasurement
Returns the constrained size of the control, given the width and height of the control.
SizeCache

Property Detail

independentDimensions


independentDimensions:Boolean

Gets or sets a boolean that indicates whether or not the dimensions (height and width) of a control can be modified independently of one another.


Implementation

public function get independentDimensions():Boolean
public function set independentDimensions(value:Boolean):void

preferredHeightConstantForLargerThanPreferredWidth


preferredHeightConstantForLargerThanPreferredWidth:Boolean

Gets or sets a boolean that sets the preferred height of the control as the default constant for any width that is wider than the preferred width.


Implementation

public function get preferredHeightConstantForLargerThanPreferredWidth():Boolean
public function set preferredHeightConstantForLargerThanPreferredWidth(value:Boolean):void

Constructor Detail

SizeCache()


public function SizeCache()

Creates a SizeCache instance.

Method Detail

flush()


public function flush():void

Flushes the cache in order to recompute the size values and cache them. This function should be called if the control's contents have changed since the last query.

getPreferredSize()


public function getPreferredSize(width:Number, height:Number, callback:Function):Point

Returns the preferred size of the control.

Parameters

width:Number — The known width of the control (pixels).
height:Number — The known height of the control (pixels).
callback:Function — In the event that these key-pairs are not cached, this function will be used to calculate and cache the values.

Returns

Point — The preferred size of the control as a Point.

measure()


public function measure(width:Number, height:Number, callback:Function):LayoutMeasurement

Returns the constrained size of the control, given the width and height of the control.

Parameters

width:Number — The known width of the control (pixels).
height:Number — The known height of the control (pixels).
callback:Function — In the event that these key-pairs are not cached, this function will be used to calculate and cache the values.

Returns

LayoutMeasurement — A LayoutMeasurement instance.

See also

LayoutMeasurement.createConstrained





comments powered by Disqus