Pacchetto | spark.layouts |
Classe | public class ConstraintLayout |
Ereditarietà | ConstraintLayout LayoutBase OnDemandEventDispatcher Object |
Sottoclassi | FormItemLayout |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
Note: The Spark list-based controls (the Spark List control and its subclasses such as ButtonBar, ComboBox, DropDownList, and TabBar) do not support the ConstraintLayout class. Do not use ConstraintLayout with the Spark list-based controls.
Per-element supported constraints are left
, right
,
top
, bottom
, baseline
,
percentWidth
, and percentHeight
.
Element's minimum and maximum sizes will always be respected.
Columns and rows may have an explicit size or content size (no explicit size). Explicit size regions will be fixed at their specified size, while content size regions will stretch to fit only the elements constrained to them. If multiple content size regions are spanned by an element, the space will be divided equally among the content size regions.
The measured size of the container is calculated from the elements, their constraints, their preferred sizes, and the sizes of the rows and columns. The size of each row and column is just big enough to hold all of the elements constrained to it at their preferred sizes with constraints satisfied. The measured size of the container is big enough to hold all of the columns and rows as well as any other elements left at their preferred sizes with constraints satisfied.
During a call to the updateDisplayList()
method,
the element's size is determined according to
the rules in the following order of precedence (the element's minimum and
maximum sizes are always respected):
- If the element has
percentWidth
orpercentHeight
set, then its size is calculated as a percentage of the available size, where the available size is the region or container size minus anyleft
,right
,top
, orbottom
constraints. - If the element has both left and right constraints, it's width is
set to be the region's or container's width minus the
left
andright
constraints. - If the element has both
top
andbottom
constraints, it's height is set to be the container's height minus thetop
andbottom
constraints. - The element is set to its preferred width and/or height.
The element's position is determined according to the rules in the following order of precedence:
- If element's baseline is specified, then the element is positioned in
the vertical direction such that its
baselinePosition
(usually the base line of its first line of text) is aligned withbaseline
constraint. - If element's
top
orleft
constraints are specified, then the element is positioned such that the top-left corner of the element's layout bounds is offset from the top-left corner of the container by the specified values. - If element's
bottom
orright
constraints are specified, then the element is positioned such that the bottom-right corner of the element's layout bounds is offset from the bottom-right corner of the container by the specified values. - When no constraints determine the position in the horizontal or vertical direction, the element is positioned according to its x and y coordinates.
The content size of the container is calculated as the maximum of the coordinates of the bottom-right corner of all the layout elements and constraint regions.
Proprietà | Definito da | ||
---|---|---|---|
clipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport. | LayoutBase | ||
constraintColumns : Vector.<ConstraintColumn>
A Vector of ConstraintColumn instances that partition the target container. | ConstraintLayout | ||
constraintRows : Vector.<ConstraintRow>
A Vector of ConstraintRow instances that partition the target container. | ConstraintLayout | ||
constructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto. | Object | ||
dropIndicator : DisplayObject
The DisplayObject that this layout uses for
the drop indicator during a drag-and-drop operation. | LayoutBase | ||
horizontalScrollPosition : Number
The x coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase | ||
target : GroupBase
The GroupBase container whose elements are measured, sized and positioned
by this layout. | LayoutBase | ||
typicalLayoutElement : ILayoutElement
Used by layouts when fixed row/column sizes are requested but
a specific size isn't specified. | LayoutBase | ||
useVirtualLayout : Boolean
A container can hold any number of children. | LayoutBase | ||
verticalScrollPosition : Number
The y coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase |
Metodo | Definito da | ||
---|---|---|---|
Constructor. | ConstraintLayout | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | OnDemandEventDispatcher | ||
Calculates the drop location in the data provider of the drop target for
the specified dragEvent. | LayoutBase | ||
When useVirtualLayout is true,
this method can be used by the layout target
to clear cached layout information when the target changes. | LayoutBase | ||
Dispatches an event into the event flow. | OnDemandEventDispatcher | ||
Called by the target after a layout element
has been added and before the target's size and display list are
validated. | LayoutBase | ||
This method must is called by the target after a layout element
has been removed and before the target's size and display list are
validated. | LayoutBase | ||
Returns the specified element's layout bounds as a Rectangle or null
if the index is invalid, the corresponding element is null,
includeInLayout=false,
or if this layout's target property is null. | LayoutBase | ||
Returns the change to the horizontal scroll position to handle
different scrolling options. | LayoutBase | ||
getNavigationDestinationIndex(currentIndex:int, navigationUnit:uint, arrowKeysWrapFocus:Boolean):int
Delegation method that determines which item
to navigate to based on the current item in focus
and user input in terms of NavigationUnit. | LayoutBase | ||
Computes the verticalScrollPosition and
horizontalScrollPosition deltas needed to
scroll the element at the specified index into view. | LayoutBase | ||
Returns the change to the vertical scroll position to handle
different scrolling options. | LayoutBase | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | OnDemandEventDispatcher | ||
Indica se per un oggetto è definita una proprietà specifica. | Object | ||
Hides the previously shown drop indicator,
created by the showDropIndicator() method,
removes it from the display list and also stops the drag scrolling. | LayoutBase | ||
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro. | Object | ||
Measures the target's default size based on its content, and optionally
measures the target's default minimum size. | LayoutBase | ||
Indica se la proprietà specificata esiste ed è enumerabile. | Object | ||
Removes a listener from the EventDispatcher object. | OnDemandEventDispatcher | ||
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche. | Object | ||
Sizes, positions and parents the drop indicator based on the specified
drop location. | LayoutBase | ||
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate. | Object | ||
Restituisce la rappresentazione in formato stringa dell'oggetto specificato. | Object | ||
Sizes and positions the target's elements. | LayoutBase | ||
Called by the target at the end of its updateDisplayList
to have the layout update its scrollRect. | LayoutBase | ||
Restituisce il valore di base dell'oggetto specificato. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | OnDemandEventDispatcher |
Metodo | Definito da | ||
---|---|---|---|
Calculates how much to scroll for the specified dropLocation
during a drag and drop gesture. | LayoutBase | ||
Returns the index where a new item should be inserted if
the user releases the mouse at the specified coordinates
while completing a drag and drop gesture. | LayoutBase | ||
Calculates the bounds for the drop indicator that provides visual feedback
to the user of where the items will be inserted at the end of a drag and drop
gesture. | LayoutBase | ||
Returns the bounds of the first layout element that either spans or
is above the scrollRect's top edge. | LayoutBase | ||
Returns the bounds of the first layout element that either spans or
is below the scrollRect's bottom edge. | LayoutBase | ||
Returns the bounds of the first layout element that either spans or
is to the left of the scrollRect's left edge. | LayoutBase | ||
Returns the bounds of the first layout element that either spans or
is to the right of the scrollRect's right edge. | LayoutBase | ||
Returns the bounds of the target's scroll rectangle in layout coordinates. | LayoutBase | ||
Lays out the elements of the layout target using the current
widths and heights of the columns and rows. | ConstraintLayout | ||
measureAndPositionColumnsAndRows(constrainedWidth:Number = NaN, constrainedHeight:Number = NaN):void
Used by FormItemLayout to measure and set new column widths
and row heights before laying out the elements. | ConstraintLayout | ||
Called when the verticalScrollPosition or
horizontalScrollPosition properties change. | LayoutBase |
constraintColumns | proprietà |
constraintColumns:Vector.<ConstraintColumn>
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
A Vector of ConstraintColumn instances that partition the target container. The ConstraintColumn instance at index 0 is the left-most column; indices increase from left to right.
Implementazione
public function get constraintColumns():Vector.<ConstraintColumn>
public function set constraintColumns(value:Vector.<ConstraintColumn>):void
constraintRows | proprietà |
constraintRows:Vector.<ConstraintRow>
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
A Vector of ConstraintRow instances that partition the target container. The ConstraintRow instance at index 0 is the top-most column; indices increase from top to bottom.
Implementazione
public function get constraintRows():Vector.<ConstraintRow>
public function set constraintRows(value:Vector.<ConstraintRow>):void
ConstraintLayout | () | Funzione di costruzione |
public function ConstraintLayout()
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
Constructor.
layoutContent | () | metodo |
protected function layoutContent(unscaledWidth:Number, unscaledHeight:Number):void
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
Lays out the elements of the layout target using the current widths and heights of the columns and rows. Used by FormItemLayout after setting new column widths to lay elements using those new widths.
Parametri
unscaledWidth:Number — Specifies the width of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleX property of the component.
| |
unscaledHeight:Number — Specifies the height of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleY property of the component.
|
measureAndPositionColumnsAndRows | () | metodo |
protected function measureAndPositionColumnsAndRows(constrainedWidth:Number = NaN, constrainedHeight:Number = NaN):void
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10, AIR 1.5 |
Used by FormItemLayout to measure and set new column widths and row heights before laying out the elements.
Parametri
constrainedWidth:Number (default = NaN ) — The total width available for columns to stretch
or shrink their percent width columns. If NaN, percent width columns
are unconstrained and fit to their content.
| |
constrainedHeight:Number (default = NaN ) — The total height available for rows to stretch
or shrink their percent height rows. If NaN, percent height rows
are unconstrained and fit to their content.
|
Tue Jun 12 2018, 02:44 PM Z