Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Point


        if (resizable && button == Mouse.Button.LEFT) {
            Bounds resizeHandleBounds = resizeHandle.getBounds();

            if (resizeHandleBounds.contains(x, y)) {
                resizeOffset = new Point(getWidth() - x, getHeight() - y);
                Mouse.capture(container);
            }
        }

        return consumed;
View Full Code Here


        Window owner = sheet.getOwner();
        if (owner != null) {
            Bounds clientArea = owner.getClientArea();

            Point location = owner.mapPointToAncestor(owner.getDisplay(), clientArea.x,
                clientArea.y);
            int x = location.x;
            int y = location.y;

            switch (slideSource) {
View Full Code Here

        triggerGraphics.dispose();

        // Paint the trigger highlight
        if (listButton.isRepeatable()) {
            Point mouseLocation = listButton.getMouseLocation();

            if (mouseLocation != null) {
                graphics.setPaint(new Color(0, 0, 0, 0.25f));

                if (triggerBounds.contains(mouseLocation)) {
View Full Code Here

        TextInput textInput = suggestionPopup.getTextInput();
        textInput.getComponentStateListeners().add(textInputStateListener);
        textInput.getComponentKeyListeners().add(textInputKeyListener);

        // Size and position the popup
        Point location = textInput.mapPointToAncestor(textInput.getDisplay(), 0, 0);
        window.setLocation(location.x, location.y + textInput.getHeight() - 1);
        window.setMinimumWidth(textInput.getWidth());
        window.setMaximumHeight(display.getHeight() - window.getY());
    }
View Full Code Here

        if (Mouse.getCapturer() == component) {
            Palette palette = (Palette)getComponent();
            Display display = palette.getDisplay();

            Point location = palette.mapPointToAncestor(display, x, y);

            // Pretend that the mouse can't move off screen (off the display)
            location = new Point(Math.min(Math.max(location.x, 0), display.getWidth() - 1),
                Math.min(Math.max(location.y, 0), display.getHeight() - 1));

            if (dragOffset != null) {
                // Move the window
                palette.setLocation(location.x - dragOffset.x, location.y - dragOffset.y);
View Full Code Here

        if (button == Mouse.Button.LEFT
            && !maximized) {
            Bounds titleBarBounds = titleBarTablePane.getBounds();

            if (titleBarBounds.contains(x, y)) {
                dragOffset = new Point(x, y);
                Mouse.capture(component);
            } else {
                Bounds resizeHandleBounds = resizeHandle.getBounds();

                if (resizeHandleBounds.contains(x, y)) {
                    resizeOffset = new Point(getWidth() - x, getHeight() - y);
                    Mouse.capture(component);
                }
            }
        }
View Full Code Here

        triggerGraphics.dispose();

        // Paint the trigger highlight
        if (listButton.isRepeatable()) {
            Point mouseLocation = listButton.getMouseLocation();

            if (mouseLocation != null) {
                graphics.setPaint(new Color(0, 0, 0, 0.25f));

                if (triggerBounds.contains(mouseLocation)) {
View Full Code Here

        File file = null;

        FileBrowser fileBrowser = (FileBrowser)getComponent();
        Component component = fileBrowser.getDescendantAt(x, y);
        if (component == fileTableView) {
            Point location = fileTableView.mapPointFromAncestor(fileBrowser, x, y);

            int index = fileTableView.getRowAt(location.y);
            if (index != -1) {
                file = (File)fileTableView.getTableData().get(index);
            }
View Full Code Here

            // Draw the left and top borders
            switch (tabOrientation) {
                case HORIZONTAL: {
                    graphics.draw(new Line2D.Double(left, top, left, bottom));

                    Point selectedTabButtonLocation = activeTabButton.mapPointToAncestor(tabPane, 0, 0);
                    graphics.draw(new Line2D.Double(left, top, selectedTabButtonLocation.x + 0.5, top));
                    graphics.draw(new Line2D.Double(selectedTabButtonLocation.x + activeTabButton.getWidth() - 0.5,
                        top, right, top));

                    break;
                }

                case VERTICAL: {
                    graphics.draw(new Line2D.Double(left, top, right, top));

                    Point selectedTabButtonLocation = activeTabButton.mapPointToAncestor(tabPane, 0, 0);
                    graphics.draw(new Line2D.Double(left, top, left, selectedTabButtonLocation.y + 0.5));
                    graphics.draw(new Line2D.Double(left, selectedTabButtonLocation.y + activeTabButton.getHeight() - 0.5,
                        left, bottom));

                    break;
View Full Code Here

        if (Mouse.getCapturer() == component) {
            Sheet sheet = (Sheet)getComponent();
            Display display = sheet.getDisplay();

            Point location = sheet.mapPointToAncestor(display, x, y);

            // Pretend that the mouse can't move off screen (off the display)
            location = new Point(Math.min(Math.max(location.x, 0), display.getWidth() - 1),
                Math.min(Math.max(location.y, 0), display.getHeight() - 1));

            if (resizeOffset != null) {
                // Resize the frame
                int preferredWidth = -1;
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Point

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.