Spark Basic Layout - Functional and Design SpecificationSpark Basic Layout - Functional and Design Specification | Summary and Background | Usage Scenarios | Detailed Description | API Description | Examples and Usage | Additional Implementation Details | Prototype Work | Compiler Work | Web Tier Compiler Impact | Flex Feature Dependencies | Backwards Compatibility | Accessibility | Performance | Globalization | Localization | Issues and Recommendations | Documentation | QA
Summary and BackgroundIn the Spark architecture, the containers and the layouts are separate objects. With Spark, we are providing generic containers, extensible/custom layouts as well as a few stock layouts with functionality that is parallel to the most-commonly used Halo layout containers. This spec describes the BasicLayout, which is the Spark counterpart of the Canvas absolute layout, but without the advanced constraints support (no support for constraintRows and constraintColumns). Goals:
Non-goals:
Usage Scenarios
Detailed DescriptionThe BasicLayout extends LayoutBase. It is the default layout of a GroupBase. Order of Precedence to Determine Element's Size
Order of Precedence to Determine Element's Position
Order of Precedence to Determine Default Extents for an Element
Order of Precedence to Determine Minimum Default Extents for an ElementThe minimum default extents are calculated the same way as the default extents. The only difference is that we take the element's minimum size instead of the preferred size in those cases where the element's size is constrained to the parent size (both left & right set or %width set, both top & bottom set or %height set). Calculating the Default Size - measure()
Note that we don't take into account the %width, %height to calculate the default size. Size and Arrange Elements - updateDisplayList(width, height)
Note that because of the way the constraints are defined, there are several meaningful ways to combine them. Let's take a look at a Group with size (100,100):
Scrolling supportBasicLayout doesn't override any of the inherited scrolling APIs from LayoutBase.
Pixel Boundaries and RoundingThe BasicLayout takes care to perform rounding for any computation that may yield fractional numbers, assuming that the inputs are always integer numbers:
API DescriptionThe BasicLayout extends LayoutBase. There are no additional public APIs beyond that. Examples and UsageAlign the text to y=40: <Group>
<layout>
<BasicLayout/>
</layout>
<Label text="blah" baseline="40"/>
</Group>
Left and Right constraints, we don't need to specify the layout as basic, as this is the default <Group>
<Label text="blah" left="40" right="10" verticalCenter="0"/>
</Group>
Example from the Spark Panel skin, default Skin layout is basic as well: <SparkSkin xmlns="http://ns.adobe.com/mxml/2009" alpha.disabled="0.5">
.....
<states>
<State name="normal" />
<State name="disabled" />
</states>
<!-- drop shadow -->
<Rect left="0" top="0" right="0" bottom="0">
<filters>
<DropShadowFilter blurX="20" blurY="20" alpha="0.32" distance="11" angle="90" knockout="true" />
</filters>
<fill>
<SolidColor color="0" />
</fill>
</Rect>
<!-- layer 1: border -->
<Rect left="0" right="0" top="0" bottom="0">
<stroke>
<SolidColorStroke color="0" alpha="0.50" weight="1" />
</stroke>
</Rect>
<!-- layer 2: background fill -->
<Rect id="background" left="1" top="1" right="1" bottom="1">
<fill>
<SolidColor color="0xFFFFFF" id="bgFill" />
</fill>
</Rect>
<!-- layer 3: title bar fill -->
<Rect left="1" right="1" top="1" height="30">
<fill>
<LinearGradient rotation="90">
<GradientEntry color="0xE2E2E2" />
<GradientEntry color="0xD9D9D9" />
</LinearGradient>
</fill>
</Rect>
<!-- layer 4: title bar highlight -->
<Rect left="1" right="1" top="1" height="30">
<stroke>
<LinearGradientStroke rotation="90" weight="1">
<GradientEntry color="0xEAEAEA" />
<GradientEntry color="0xBEBEBE" />
</LinearGradientStroke>
</stroke>
</Rect>
<!-- layer 5: text -->
<TextBox id="titleField"
left="10" right="4" top="2" height="30"
verticalAlign="middle" fontWeight="bold">
</TextBox>
<Group id="contentGroup" left="1" right="1" top="32" bottom="1">
</Group>
</SparkSkin>
Additional Implementation DetailsEnter implementation/design details for the feature here. This section may be updated after the spec signs off. Prototype WorkBasicLayout exists and is in a fairly complete state in the trunk. Compiler WorkNo. Web Tier Compiler ImpactNo. Flex Feature DependenciesDependencies on other Flex features. Backwards CompatibilityNo. AccessibilityDescribe any accessibility considerations. PerformancePossible optimizations
GlobalizationNo issues. LocalizationCompiler FeaturesNo command-line params, warnings, errors, etc. Framework FeaturesNo RTE messages. No UI text, images, skins, sounds. Issues and RecommendationsCurrently there's an issue with performing accurate measurement in cases where some child properties depend on the child's size. We have two such cases presently:
Recommendation: DocumentationDescribe any documentation issues or any tips for the doc team. QAIf there are testing tips for QA, note them here, include a link to the test plan document. |
|
| You must be logged in to comment. |
|---|
