<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2008 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package spark.layouts
{

import mx.core.ILayoutElement;
import mx.core.IVisualElement;

import spark.components.supportClasses.GroupBase;
import spark.layouts.supportClasses.LayoutBase;
import spark.layouts.supportClasses.LayoutElementHelper;

/**
 *  BasicLayout arranges the layout elements according to their settings,
 *  independent of each-other.
 *
 *  Per-element supported constraints are left, right, top, bottom, horizontalCenter,
 *  verticalCenter, baseline, percentWidth, percentHeight.
 *  Element's minimum and maximum sizes will always be respected.
 *
 *  The measured size of the container is calculated from the elements, their
 *  constraints and their preferred sizes.
 *
 *  During updateDisplayList() 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):
 *  <ul>
 *    <li>If the element has percentWidth or percentHeight set, then its size
 *    is calculated as a percentage of the container size, minus any left, right,
 *    top, bottom constraints.</li>
 *
 *    <li>If the element has both left and right constraints, it's width is
 *    set to be the container's width minus the left and right constraints.</li>
 * 
 *    <li>If the element has both top and bottom constraints, it's height is
 *    set to be the container's height minus the top and bottom constraints.</li>
 *
 *    <li>The element is set to its preferred width and/or height.</li>
 *  </ul>
 * 
 *  The element's position is determined according to the rules in the following
 *  order of precedence:
 *  <ul>
 *    <li>If element's horizontalCenter/verticalCenter is specified, then the
 *    element is positioned such that the distance between the element's center
 *    and the container's center is equal to the horizontalCenter/verticalCenter.
 *    Set horizontalCenter/verticalCenter to zero to cetner the element within
 *    the container in the horizontal/vertical direction.</li>
 * 
 *    <li>If element's baseline is specified, then the element is positioned in
 *    the vertical direction such that its baselinePosition (usually the baseline
 *    of its first line of text) is aligned with baseline constraint.</li>
 *
 *    <li>If element's top/left 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.</li>
 *
 *    <li>If element's bottom/right 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.</li>
 * 
 *    <li>When no constraints determine the position in the horizontal/vertical
 *    direction, the element is positioned according to its x/y coordinates.</li>
 *  </ul>
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
public class BasicLayout extends LayoutBase
{<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2008 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package spark.layouts
{

import mx.core.ILayoutElement;
import mx.core.IVisualElement;

import spark.components.supportClasses.GroupBase;
import spark.layouts.supportClasses.LayoutBase;
import spark.layouts.supportClasses.LayoutElementHelper;

/**
 *  BasicLayout arranges the layout elements according to their settings,
 *  independent of each-other.
 *
 *  Per-element supported constraints are left, right, top, bottom, horizontalCenter,
 *  verticalCenter, baseline, percentWidth, percentHeight.
 *  Element's minimum and maximum sizes will always be respected.
 *
 *  </p>The measured size of the container is calculated from the elements, their
 *  constraints and their preferred sizes. The measured size of the container
 *  is big enough to fit in all of the elements at their preferred sizes with
 *  their constraints satisified. Here are some examples of how measured size is
 *  calculated:
 *  <ul>
 *    <li>If the container has a single element with left constraint specified,
 *    then the container's measured width will be equal to the element's preferred
 *    width plus the value of the left constraint.</li>
 *
 *    <li>If the container has a single element with percentWidth specified, 
 *    then the container's measured width will be equal to the element's preferred width.
 *    Even though the element's precentWidth is not direclty factored in the calculations,
 *    it will be respected during updateDisplayList().</li>
 * 
 *    <li>If the container has a single element with baseline constraint specified,
 *    then the container's measured height will be equal to the element's preferred height
 *    plus the baseline and minus the value of the element's baselinePosition property.</li>
 *
 *    <li>If the container has a single elment with verticalCenter constraint specified,
 *    then the container's measured height will be equal to the element's preferred height
 *    plus double the value of the verticalCenter constraint.</li>
 *  </ul>
 * </p>
 *
 *  During updateDisplayList() 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):
 *  <ul>
 *    <li>If the element has percentWidth or percentHeight set, then its size
 *    is calculated as a percentage of the available size, where the available
 *    size is the container size minus any left, right,
 *    top, bottom constraints.</li>
 *
 *    <li>If the element has both left and right constraints, it's width is
 *    set to be the container's width minus the left and right constraints.</li>
 * 
 *    <li>If the element has both top and bottom constraints, it's height is
 *    set to be the container's height minus the top and bottom constraints.</li>
 *
 *    <li>The element is set to its preferred width and/or height.</li>
 *  </ul>
 * 
 *  The element's position is determined according to the rules in the following
 *  order of precedence:
 *  <ul>
 *    <li>The horizontalCenter/verticalCenter constraints specify the distance
 *    between the container's center and the element's center.
 *    Set horizontalCenter/verticalCenter to zero to cetner the element within
 *    the container in the horizontal/vertical direction.</li>
 * 
 *    <li>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 with baseline constraint.</li>
 *
 *    <li>If element's top/left 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.</li>
 *
 *    <li>If element's bottom/right 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.</li>
 * 
 *    <li>When no constraints determine the position in the horizontal/vertical
 *    direction, the element is positioned according to its x/y coordinates.</li>
 *  </ul>
 *
 *  The content size of the container is calculated as the maximum of the
 *  coordinates of the bottom-right corner of all the layout elements.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
public class BasicLayout extends LayoutBase
{
{'fraction_non_alphanumeric': 0.10367500293530586, 'fraction_numerical': 0.002583069155806035, 'mean_word_length': 3.1429961089494163, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2139883', 'n_tokens_mistral': 2125, 'n_tokens_neox': 2037, 'n_words': 1011}