Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Dialog$DialogStateListenerList


        Frame dialogOwner = new Frame();
        dialogOwner.setTitle("Dialog Owner");
        dialogOwner.setPreferredSize(160, 60);
        dialogOwner.open(display);

        Dialog dialog = new Dialog();
        dialog.setTitle("Dialog 1");
        dialog.setPreferredSize(160, 60);
        dialog.open(dialogOwner);

        Dialog dialog2 = new Dialog();
        dialog2.setTitle("Dialog 2");
        dialog2.setPreferredSize(160, 60);
        dialog2.open(dialog);
    }
View Full Code Here


    @Override
    public void install(Component component) {
        super.install(component);

        Dialog dialog = (Dialog)component;
        dialog.getDialogStateListeners().add(this);

        setShowMaximizeButton(false);
        setShowMinimizeButton(false);
    }
View Full Code Here

        setShowMinimizeButton(false);
    }

    @Override
    public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
        Dialog dialog = (Dialog)component;
        Window rootOwner = dialog.getRootOwner();
        rootOwner.moveToFront();

        return super.mouseDown(component, button, x, y);
    }
View Full Code Here

    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        boolean consumed = false;

        Dialog dialog = (Dialog)getComponent();

        if (keyCode == Keyboard.KeyCode.ENTER) {
            dialog.close(true);
            consumed = true;
        } else if (keyCode == Keyboard.KeyCode.ESCAPE) {
            dialog.close(false);
            consumed = true;
        } else {
            consumed = super.keyPressed(component, keyCode, keyLocation);
        }
View Full Code Here

    private class RepositionCallback implements Runnable {
        private static final float GOLDEN_SECTION = 0.382f;

        @Override
        public void run() {
            Dialog dialog = (Dialog)getComponent();
            Container ancestor = dialog.getOwner();

            if (ancestor == null) {
                ancestor = dialog.getDisplay();
            }

            int deltaWidth = ancestor.getWidth() - getWidth();
            int deltaHeight = ancestor.getHeight() - getHeight();

            int x = Math.max(0, Math.round(ancestor.getX() + 0.5f * deltaWidth));
            int y = Math.max(0, Math.round(ancestor.getY() + GOLDEN_SECTION * deltaHeight));

            dialog.setLocation(x, y);

            queuedCallback = null;
        }
View Full Code Here

        // window1bii.requestFocus();

        ApplicationContext.queueCallback(new Runnable() {
            @Override
            public void run() {
                final Dialog dialog = new Dialog();
                dialog.setTitle("Dialog 1");
                dialog.setPreferredSize(280, 100);
                dialog.open(dialogOwner);

                ApplicationContext.queueCallback(new Runnable() {
                    @Override
                    public void run() {
                        Dialog dialog2 = new Dialog();
                        dialog2.setTitle("Dialog 2");
                        dialog2.setPreferredSize(220, 80);
                        dialog2.open(dialog);
                    }
                });
            }
        });
    }
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        Dialog dialog = (Dialog)component;
        dialog.getDialogStateListeners().add(this);

        setShowMaximizeButton(false);
        setShowMinimizeButton(false);
    }
View Full Code Here

        setShowMinimizeButton(false);
    }

    @Override
    public boolean mouseDown(Container container, Mouse.Button button, int x, int y) {
        Dialog dialog = (Dialog)container;
        if (!dialog.isTopMost()) {
            Window rootOwner = dialog.getRootOwner();
            rootOwner.moveToFront();
        }

        return super.mouseDown(container, button, x, y);
    }
View Full Code Here

     */
    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        boolean consumed = false;

        Dialog dialog = (Dialog)getComponent();

        if (keyCode == Keyboard.KeyCode.ENTER) {
            dialog.close(true);
            consumed = true;
        } else if (keyCode == Keyboard.KeyCode.ESCAPE) {
            dialog.close(false);
            consumed = true;
        } else {
            consumed = super.keyPressed(component, keyCode, keyLocation);
        }

View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        Dialog dialog = (Dialog)component;
        dialog.getDialogStateListeners().add(this);

        setShowMaximizeButton(false);
        setShowMinimizeButton(false);
    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Dialog$DialogStateListenerList

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.