Archive for AS3-Layout-Framework
How to write custom LayoutComponents
November 28th, 2008 • AS3-Layout-Framework, Actionscript 3.0
To write custom ILayoutComponents or ILayoutContainer, there is just one method (processLayoutEvent( type: int, c: ILayoutComponent )) that needs to be overridden to handle layout events. This method will be invoked internally by a ILayoutComponent after ILayout implementations changed the position, layout bounds or the cropped size.
Read more »
The FlowLayout
November 21st, 2008 • AS3-Layout-Framework, Actionscript 3.0
A FlowLayout arranges ILayoutComponents in a row until no more ILayoutComponents fit in that row. The ILayoutComponents will be arranged to their preferred size and therefore won't be cropped.
In addition the FlowLayout offers the possibility to choose different style settings which are also modifiable at runtime.
Read more »
The GridLayout
November 16th, 2008 • AS3-Layout-Framework, Actionscript 3.0
The GridLayout implements ILayout and is therefore responsible for layouting ILayoutContainers.
It lays out all ILayoutComponents of a ILayoutContainer in a rectangular grid, which means that all ILayoutComponents will be positioned in equal-sized rectangles.
Read more »
How to use the AS3-Layout-Framework
November 9th, 2008 • 11 comments AS3-Layout-Framework, Actionscript 3.0, Design Patterns
The AS3-Layout-Framework is basically very simple and easy to understand. It is based on one structural (Composite) and one behavioural (Strategy) pattern.
The composite pattern is used to compose objects into tree structures to represent part-whole hierarchies. Also it has the advantage to let clients treat individual objects and compositions of objects uniformly[GHJV95]. While updating all ILayoutComponents, a ILayoutContainer ( extends ILayoutComponent) lays out its subcomponents and a simple ILayoutComponent just handles its bounds ( Figure 1 shows the inheritance structure of the participants in more detail ).
The strategy pattern is used to encapsulate algorithms in objects with a well formed interface and lets the algorithm vary independently from clients that use it[GHJV95].
In the AS3-Layout-Framework the ILayout embodied the strategy pattern. This makes the creation of concrete layouts very simple and easy to plug in (f.e. GridLayout, FlowLayout).
Read more »
Actionscript 3.0 Layout Framework
October 26th, 2008 • AS3-Layout-Framework, Actionscript 3.0, Design Patterns
During the last weeks I worked on an layout framework for actionscript 3.0 in my free time. I thought I would get some inspiration from the JAVA layout framework, and yes I got it.
Unfortunately the layout framework itself was overengineered and was not totally fulfilling my conceivabilities.
I just wanted a layout framework which is easy to extend, lightweight and fast with interfaces flexible enough for be used in other solutions( f.e. drag and drop).
Read more »
Recent Comments