Design Hints
Contents
Overview
Designing applications for
SuperWaba requires thought because of the wide range of platforms supported. Applications have to perform across a range of CPU speed, memory sizes, font sizes, screen types and language variations.
Hardware Considerations
Screen Type
SuperWaba will run on anything from a PC with multiple-head monitors to a 160x160 screen on a PDA watch. Consequently the user interface has to be flexible enough to cope. Try using the BEFORE/AFTER/LEFT/RIGHT positioning for your buttons rather than absolute positioning. Where you do use absolute positioning, try to do it in terms of a fraction of %JAVADOC{SW:waba.ui.Container}%.getClientRect() rather than exactly specifying the pixels.
Use the free scrolling container class from the main downloads area if you really can't figure out how to manage control layout on smaller screens.
Remember also that a %JAVADOC{SW:waba.ui.Button}% containing a 16x16 pixel %JAVADOC{SW:waba.fx.Image}% on a 160x160 screen takes up 1% of the screen, but on a 320x240 display it takes a miniscule 0.2% - you need to resize your graphics as well as your buttons or the user may not be able to make them out.
CPU Speeds
Be sympathetic to underpowered devices. Do not create and destroy lots of Java classes just because it is considered good Java style. It will ruin the user's experience, so be prepared to compromise.
Software Considerations
Using Containers Instead of Windows
Do use %JAVADOC{SW:waba.ui.Container}% instead of creating lots of full-screen instances of Window. The overheads on %JAVADOC{SW:waba.ui.Container}% are smaller. The example file examples/ui/ContainerSwitch in the
SuperWabaSDK shows how to do this.
To put the title above a container when switching to it, put a case in the
onEvent() function of your %JAVADOC{SW:waba.ui.Control}% derived class like this:
switch (event.type) {
case ControlEvent.FOCUS_IN:
/* When we get the focus, redraw the title. */
if (event.target == this) {
MainWindow.getMainWindow().setTitle("This Modules Title");
}
break;
...
}
You may find that MainWindow titles are overwritten when new containers are created by WINDOW_CLOSED events generated from menus. The trick to getting this right is in 3 parts:
- Set the MainWindow title from your container on a FOCUS_IN event.
- Use the menu's WINDOW_CLOSED event to start a short timer (100ms or so).
- Use the timer event to invoke the menu option and kill the timer.
Scrollable Containers
One way of ensuring that all the information will fit on the user's screen is to put it in a scrollable container. These are not implemented by the
SuperWaba VM or standard libraries, but some keen developers have produced code to manage them.
Find The Icon
So which of the many application icons is being displayed? Trying to figure this out can be difficult, so here is a collection of
SuperWaba application icons that have had their dimensions added to them. Some are a bit scrappy, so feel free to tidy them up.
Remember that you will need to reset a
PocketPC? in order to view the changed icons.
--
VikOlliver - 12 Sep 2004