Package pivot.wtkx

Examples of pivot.wtkx.WTKXSerializer$Element


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

    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = new Window((Component)wtkxSerializer.readObject(getClass().getResource("table_pane_test.wtkx")));
        window.setTitle("TablePane Test");
        window.open(display);
    }
View Full Code Here


public class FormTest implements Application {
    private Frame frame = null;

    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        frame = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("form_test.wtkx")));
        frame.setTitle("Form Test");
        // frame.setPreferredSize(480, 360);
        frame.open(display);
    }
View Full Code Here

        }

        String src = properties.get(SRC_ARGUMENT);
        String title = properties.get(TITLE_ARGUMENT);

        WTKXSerializer wtkxSerializer = new WTKXSerializer();

        Component content = (Component)wtkxSerializer.readObject(src);
        window = new Window(content);
        window.setTitle(title);
        window.setMaximized(true);
        window.open(display);
    }
View Full Code Here

public class ColorListButtonTest implements Application {
    private Frame frame = null;

    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        frame = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("color_list_button_test.wtkx")));
        frame.setTitle("Color List Button Test");
        frame.setPreferredSize(480, 360);
        frame.open(display);
    }
View Full Code Here

    private TextInput textinputIntRange = null;
    private TextInput textinputDateRegex = null;
    private TextInput textinputCustomBoolean = null;

    public void startup(Display display, Dictionary<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = new Window((Component)wtkxSerializer.readObject(
            getClass().getResource("textInputValidator_test.wtkx")));
        textinputFloatRange = (TextInput)wtkxSerializer.getObjectByID("textinputFloatRange");
        textinputIntRange = (TextInput)wtkxSerializer.getObjectByID("textinputIntRange");
        textinputDateRegex = (TextInput)wtkxSerializer.getObjectByID("textinputDateRegex");
        textinputCustomBoolean = (TextInput)wtkxSerializer.getObjectByID("textinputCustomBoolean");

        // standard float range model
        textinputFloatRange.setText("0.5");
        textinputFloatRange.setValidator(new FloatRangeValidator(0.3f, 2000f));

        // test the listener by updating a label
        textinputFloatRange.getTextInputListeners().add(new TextInputListener() {
            public void maximumLengthChanged(TextInput textInput, int previousMaximumLength) {
            }

            public void passwordChanged(TextInput textInput) {
            }

            public void promptChanged(TextInput textInput, String previousPrompt) {
            }

            public void textKeyChanged(TextInput textInput, String previousTextKey) {
            }

            public void textNodeChanged(TextInput textInput, TextNode previousTextNode) {
            }

            public void textSizeChanged(TextInput textInput, int previousTextSize) {
            }

            public void textValidChanged(TextInput textInput) {
                invalidLabel.setText(textInput.isTextValid() ? "valid" : "invalid");
            }

            public void textValidatorChanged(TextInput textInput, Validator validator) {
            }
        });

        invalidLabel = (Label)wtkxSerializer.getObjectByID("invalidLabel");

        // standard int range model
        textinputIntRange.setText("0");
        textinputIntRange.setValidator(new IntRangeValidator(0, 100));
View Full Code Here

public class FileBrowserTest implements Application {
    private Frame frame = null;

    public void startup(Display display, Dictionary<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        frame = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("file_browser_test.wtkx")));

        TreeView folderTreeView = (TreeView)wtkxSerializer.getObjectByID("folderTreeView");

        String pathname = "/";
        final Folder rootFolder = new Folder(pathname);
        rootFolder.refresh();
        folderTreeView.setTreeData(rootFolder);
View Full Code Here

        ImageView imageView = new ImageView();
        imageView.setImage(getClass().getResource("IMG_0767_2.jpg"));
        panorama.setView(imageView);
        frame1.open(display);

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        frame2 = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("panorama_test.wtkx")));
        frame2.setTitle("Panorama Test 2");
        frame2.setPreferredSize(480, 360);
        frame2.open(display);
    }
View Full Code Here

                    // executes because this is a potentially time-consuming
                    // operation
                    inputStream = new BufferedInputStream(url.openStream());

                    if (url.getFile().endsWith("wtkd")) {
                        WTKXSerializer serializer = new WTKXSerializer();
                        image = (Drawing)serializer.readObject(inputStream);
                    } else {
                        BufferedImageSerializer serializer = new BufferedImageSerializer();
                        BufferedImage bufferedImage =
                            serializer.readObject(new MonitoredInputStream(inputStream));
                        image = new Picture(bufferedImage);
                    }
                } finally {
                    if (inputStream != null) {
                        inputStream.close();
View Full Code Here

        Prompt prompt = (Prompt)component;
        prompt.getPromptListeners().add(this);

        // Load the prompt content
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        Component content = null;

        try {
            content = (Component)wtkxSerializer.readObject(getClass().getResource("prompt_skin.wtkx"));
        } catch(Exception exception) {
            throw new RuntimeException(exception);
        }

        prompt.setContent(content);

        // Set the type image
        TerraTheme theme = (TerraTheme)Theme.getTheme();

        ImageView typeImageView = wtkxSerializer.getObjectByID("typeImageView");
        typeImageView.setImage(theme.getMessageIcon(prompt.getMessageType()));

        // Set the message
        Label messageLabel = wtkxSerializer.getObjectByID("messageLabel");
        String message = prompt.getMessage();
        messageLabel.setText(message);

        // Set the body
        FlowPane messageFlowPane = wtkxSerializer.getObjectByID("messageFlowPane");
        Component body = prompt.getBody();
        if (body != null) {
            messageFlowPane.add(body);
        }

        // Add the option buttons
        FlowPane buttonFlowPane = wtkxSerializer.getObjectByID("buttonFlowPane");

        for (int i = 0, n = prompt.getOptionCount(); i < n; i++) {
            Object option = prompt.getOption(i);

            PushButton optionButton = new PushButton(option);
View Full Code Here

        Alert alert = (Alert)component;
        alert.getAlertListeners().add(this);

        // Load the alert content
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        Component content = null;

        try {
            content = (Component)wtkxSerializer.readObject(getClass().getResource("alert_skin.wtkx"));
        } catch(Exception exception) {
            throw new RuntimeException(exception);
        }

        alert.setContent(content);

        // Set the type image
        TerraTheme theme = (TerraTheme)Theme.getTheme();

        ImageView typeImageView = wtkxSerializer.getObjectByID("typeImageView");
        typeImageView.setImage(theme.getMessageIcon(alert.getMessageType()));

        // Set the message
        Label messageLabel = wtkxSerializer.getObjectByID("messageLabel");
        String message = alert.getMessage();
        messageLabel.setText(message);

        // Set the body
        FlowPane messageFlowPane = wtkxSerializer.getObjectByID("messageFlowPane");
        Component body = alert.getBody();
        if (body != null) {
            messageFlowPane.add(body);
        }

        // Add the option buttons
        FlowPane buttonFlowPane = wtkxSerializer.getObjectByID("buttonFlowPane");

        for (int i = 0, n = alert.getOptionCount(); i < n; i++) {
            Object option = alert.getOption(i);

            PushButton optionButton = new PushButton(option);
View Full Code Here

TOP

Related Classes of pivot.wtkx.WTKXSerializer$Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.