Panoramas

Panoramas scroll via four directional scroll arrows shown at the top, left, bottom, or right as needed. They are not as common as scroll panes in application development, but are used by other components such as ListButton and MenuPopup to present long lists of items.

The following example demonstrates the Panorama component. It is identical to the previous example except that it uses a panorama instead of a scroll pane:

The WTKX source for this example is shown below:

<Window title="Panoramas" maximized="true"
    xmlns:wtkx="http://pivot.apache.org/wtkx"
    xmlns="org.apache.pivot.wtk">
    <content>
        <Border styles="{padding:0, color:10}">
            <content>
                <Panorama styles="{buttonColor:'0xffffffff', buttonBackgroundColor:'0x00000044'}">
                    <view>
                        <ImageView image="org/apache/pivot/tutorials/IMG_1147.jpg"
                            tooltipText="Pemaquid Point Lighthouse, Bristol ME"/>
                    </view>
                </Panorama>
            </content>
        </Border>
    </content>
</Window>

The Java source is as follows:

package org.apache.pivot.tutorials.navigation;

import org.apache.pivot.collections.Map;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.DesktopApplicationContext;
import org.apache.pivot.wtk.Display;
import org.apache.pivot.wtk.Window;
import org.apache.pivot.wtkx.WTKXSerializer;

public class Panoramas implements Application {
    private Window window = null;

    public void startup(Display display, Map<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "panoramas.wtkx");
        window.open(display);
    }

    public boolean shutdown(boolean optional) {
        if (window != null) {
            window.close();
        }

        return false;
    }

    public void suspend() {
    }

    public void resume() {
    }

    public static void main(String[] args) {
        DesktopApplicationContext.main(Panoramas.class, args);
    }
}

Next: Progress Indicators