Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Container$ContainerMouseListenerList


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

        Container container = (Container)component;

        // Add this as a container listener
        container.getContainerListeners().add(this);
        container.getContainerMouseListeners().add(this);

        // Set the focus traversal policy
        container.setFocusTraversalPolicy(DEFAULT_FOCUS_TRAVERSAL_POLICY);
    }
View Full Code Here


        Vote vote = rowEditorListeners.previewEditRow(this, tableView, rowIndex, columnIndex);

        if (vote == Vote.APPROVE) {
            editorPopup = new EditorPopup(tableView, rowIndex, columnIndex);

            Container tableViewParent = tableView.getParent();
            if (tableViewParent instanceof ScrollPane) {
                editorPopup.setTableViewScrollPane((ScrollPane)tableViewParent);
            }

            editorPopup.editRow();
View Full Code Here

    public void update() {
        // No-op
    }

    public void repaint(Component component, int x, int y, int width, int height) {
        Container parent = component.getParent();

        if (parent != null) {
            int tx = getTranslatedX(component);
            int ty = getTranslatedY(component);

            x = (int)((x * scaleX) + component.getX() + tx);
            y = (int)((y * scaleY) + component.getY() + ty);
            width = (int)Math.ceil(width * scaleX);
            height = (int)Math.ceil(height * scaleY);

            parent.repaint(x, y, width, height);
        }
    }
View Full Code Here

        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

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

        Container container = (Container)component;

        // Add this as a container listener
        container.getContainerListeners().add(this);
        container.getContainerMouseListeners().add(this);

        // Set the focus traversal policy
        container.setFocusTraversalPolicy(DEFAULT_FOCUS_TRAVERSAL_POLICY);
    }
View Full Code Here

    public void beginEdit(TableView tableViewArgument, int rowIndexArgument, int columnIndexArgument) {
        this.tableView = tableViewArgument;
        this.rowIndex = rowIndexArgument;
        this.columnIndex = columnIndexArgument;

        Container tableViewParent = tableViewArgument.getParent();
        tableViewScrollPane = (tableViewParent instanceof ScrollPane) ? (ScrollPane)tableViewParent : null;

        // Add/create the editor components
        TableView.ColumnSequence tableViewColumns = tableViewArgument.getColumns();
        TablePane.ColumnSequence tablePaneColumns = tablePane.getColumns();
View Full Code Here

    public void update() {
        // No-op
    }

    public void repaint(final Component component, int x, int y, int width, int height) {
        Container parent = component.getParent();

        if (parent != null) {
            int tx = getTranslatedX(component);
            int ty = getTranslatedY(component);

            int xUpdated = (int)((x * scaleX) + component.getX() + tx);
            int yUpdated = (int)((y * scaleY) + component.getY() + ty);
            int widthUpdated = (int)Math.ceil(width * scaleX);
            int heightUpdated = (int)Math.ceil(height * scaleY);

            parent.repaint(xUpdated, yUpdated, widthUpdated, heightUpdated);
        }
    }
View Full Code Here

    public void setHideDisabledFiles(boolean hideDisabledFiles) {
        fileBrowser.getStyles().put("hideDisabledFiles", hideDisabledFiles);
    }

    public boolean getShowOKButtonFirst() {
        Container parent = okButton.getParent();
        return parent.indexOf(okButton) < parent.indexOf(cancelButton);
    }
View Full Code Here

        return parent.indexOf(okButton) < parent.indexOf(cancelButton);
    }

    public void setShowOKButtonFirst(boolean showOKButtonFirst) {
        if (showOKButtonFirst != getShowOKButtonFirst()) {
            Container parent = okButton.getParent();
            parent.remove(okButton);
            parent.remove(cancelButton);

            if (showOKButtonFirst) {
                parent.add(okButton);
                parent.add(cancelButton);
            } else {
                parent.add(cancelButton);
                parent.add(okButton);
            }
        }
    }
View Full Code Here

        if (!window.requestFocus()) {
            Component.clearFocus();
        }

        // Center the dialog over its owner
        Container ancestor = window.getOwner();

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

        Dimensions size = window.getPreferredSize();
        int deltaWidth = ancestor.getWidth() - size.width;
        int deltaHeight = ancestor.getHeight() - size.height;

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

        window.setLocation(x, y);
    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Container$ContainerMouseListenerList

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.