Spark layout of flex4 Beta

Source: Internet
Author: User
Document directory
  • Comparison of spark and halo Layout
Spark layout of flex4 Beta

Comparison of spark and halo Layout

Like other new features of the spark architecture, the new layout is also developed based on the powerful halo layout. Flex3 developers will find it easy to understand General execution processes, corresponding APIs, and layout logic. However, SPARK focuses more on modular design, so it is still different and improved in some places.

Same features

For developers who use mxml, there is no big change. Imagewidth,height,minWidth,explicitWidth, AndpercentWidthSome attributes and Their syntax and semantics have not changed. Still supportedleft,right,top,horizontalCenter, AndbaselineThese styles.

Component developers will also find similar elements. The core layout management class and component lifecycle have not changed. Three very familiar methods for component developers-commitProperties(),measure(), AndupdateDisplayList()-It is still called by the layout manager in the same order, and the failure rules have not changed.

Inmeasure()When the method is called, the component will still set the default size. Similarly, the component isupdateDisplayList()When the method is called, it will still set the size for its child elements.

Significantly different

Perhaps the most obvious difference is that spark layout is separated from the container! When a spark container callsmeasure()OrupdateDisplayList()The measurement and sub-element placement are completed by a spark layout instance. This separation mode brings many other related novelty points:

  • The layout logic is abstracted into a separate class inherited from the layoutbase class. layoutbase is the most basic class of spark layout.
  • New APIs are introduced into spark layout and its elements for measuring, setting, and placing values. This is a typical application of the ilayoutelement interface and supports 2D and 3D transformations. If you do not create your own layout, you may not notice this interface, but if you do so, you will find how efficient it is.
  • LayoutVirtualization-The project Renderer for creating, destroying, and recycling data containers is completely handed over to the render roup container (spark is the basic construction block developed by the Data container) for implementation. It is relatively easy to support the virtualization of spark layout because the heavy task worker roup is completed.
  • The display list order of the spark container is separated from the subelement order. For example, the first child element can be rendered on the top of the last child element.
New Features

The change in Spark layout is committed to making the entire system more modular, more powerful, and more scalable. The following is a list of new features and improvements of spark mentioned earlier:

  • Configurable Layout-Because the layout logic is separated from the container, spark containers can be configured with different spark la s, even when running. This reduces the number of container classes and improves modularity and code reusability. For example, there is only one list class in spark. To obtain the tilelist function in Halo, you only need to create a tilelayout instance for it.
  • Custom Layout-Along with the separation of layout logic and containers, the new layoutbase class and the ilayoutelement interface allow developers to develop powerful layouts faster and easier, and then combine them with spark containers.
  • Arbitrary 2D transformation-Spark layout now supports random 2D transformations. This function is built in the ilayoutelement interface and supported by all spark container subclasses. This makes it easy to develop custom la s that support 2D transformations.
  • Smooth pixel scrolling-This function is supported by batch roup, so that all spark containers support smooth pixel scrolling. It is also easy to implement smooth scrolling in custom la S.
  • 3D support-The layoutbase and ilayoutelement interfaces support 3D. Currently, classes with 3D custom Layout appear on the network, such as coverflow, usel, and wheellayout.
  • Deep Management-Developers can specify the depth of any sub-element, whether in mxml or custom layout.
  • Post-layout transformation-Developers can specifyx,y,z,rotation,scaleAnd other attributes without any impact on the layout. Because now All Spark la s have built-in 2D transformation support, this new feature is very practical. For a move-up effect, when you move the mouse over a thumbnail of the horizontal layout list, it will zoom in or rotate in 3D, but it will not squeeze other thumbnails to the right.
  • Compatible coordinate space-All the size attributes are as follows:width,height,measuredWidth, AndmeasuredHeight PersistenceConsistent pre-transformation. In this way, the conflict is eliminated, as shown in"measure()MediummeasuredWidthYesunscaled,updateDisplayList()But ".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.