User:Oleg Kobchenko/Lightweight Components

From J Wiki
Jump to navigation Jump to search
Round.png

Wm yes check.png

It's been common in all WikiPedia:GUI, esp. noted with emergence of Java Swing that there are heavyweight controls provided by the system and lightweight controls maintained with application API. There are certain things that are known about them. In particular, that heavyweight controls are expensive, have problems with overlapping, typically rectangular, etc.

So it is common to express custom complex views and controls with lightweight controls which are arranged on a single large heavyweight control, which acts as a container and delegates its events and painting to the "soft" lightweight controls.

Examples of such behavior are the J6/Grid component with controls such as checkboxes; and recently the media/paint addon, whose toolbar, colorwell, etc. are lightweight controls on single canvas. Your thumbnail view with selection frames can be done as the toolbar there, which also uses image files to draw buttons.

Although the distinction of light and heavy controls is found at least as early as Petzold book on Windows 3.0, it gained momentum with Java Swing, which in turn is based on Internet Foundation Classes by Nescape who sought cross-platfomness through drawing its own GUI. Internet Explorer drew its own controls, except frames until v5.0 and comboboxes until v7.0. This can be observed with Spy++ tool.

Interestingly, on Mac OS X most GUI is heavyweight, even Safari keeps all its elements, not only controls, as separate system controls, which can be observed with Accesibility Inspector. This can explained as their GUI as a whole being run as single compossited Quartz window server in which system components are lightweight. However, Firefox on Mac uses its own single canvas.

Windows Vista follows Quartz with its new WPF GUI described with XAML language, etc. Silverlight, Flash and OpenGL are also examples of single canvas GUI.


See Also


Contributed by Oleg Kobchenko