Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Bounds


        int height = (int)Math.ceil(component.getHeight() * scaleY);

        int tx = getTranslatedX(component);
        int ty = getTranslatedY(component);

        return new Bounds(tx, ty, width, height);
    }
View Full Code Here


        graphics = null;
    }

    @Override
    public Bounds getBounds(Component component) {
        return new Bounds(0, 0, component.getWidth(), component.getHeight());
    }
View Full Code Here

    @Override
    public void paint(Graphics2D graphics) {
        TabPane tabPane = (TabPane)getComponent();

        Bounds tabPaneBounds = tabPane.getBounds();

        // Call the base class to paint the background
        super.paint(graphics);

        // Paint the content background and border
        int x = 0;
        int y = 0;
        int width = 0;
        int height = 0;

        switch (tabOrientation) {
            case HORIZONTAL: {
                x = 0;
                y = Math.max(buttonPanorama.getY() + buttonPanorama.getHeight() - 1, 0);
                width = tabPaneBounds.width;
                height = Math.max(tabPaneBounds.height - y, 0);

                break;
            }

            case VERTICAL: {
                x = Math.max(buttonPanorama.getX() + buttonPanorama.getWidth() - 1, 0);
                y = 0;
                width = Math.max(tabPaneBounds.width - x, 0);
                height = tabPaneBounds.height;

                break;
            }
        }

        int selectedIndex = tabPane.getSelectedIndex();
        if (selectedIndex != -1
            || selectionChangeTransition != null) {
            Bounds contentBounds = new Bounds(x, y, width, height);

            graphics.setPaint(activeTabColor);
            graphics.fillRect(contentBounds.x, contentBounds.y,
                contentBounds.width, contentBounds.height);
View Full Code Here

                sheet.setPreferredSize(preferredWidth, preferredHeight);
            }
        } else {
            Cursor cursor = null;
            Bounds resizeHandleBounds = resizeHandle.getBounds();

            if (resizable && resizeHandleBounds.contains(x, y)) {
                boolean preferredWidthSet = component.isPreferredWidthSet();
                boolean preferredHeightSet = component.isPreferredHeightSet();

                if (preferredWidthSet
                    && preferredHeightSet) {
View Full Code Here

        owner.moveToFront();

        boolean consumed = super.mouseDown(component, button, x, y);

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

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

    public void alignToOwner() {
        Sheet sheet = (Sheet)getComponent();

        Window owner = sheet.getOwner();
        Bounds clientArea = owner.getClientArea();

        Point location = owner.mapPointToAncestor(owner.getDisplay(), clientArea.x, clientArea.y);
        sheet.setLocation(location.x + (clientArea.width - getWidth()) / 2, location.y);
    }
View Full Code Here

        graphics.fillRect(0, 0, width, height);

        // Paint the border
        graphics.setPaint(borderColor);

        Bounds contentBounds = new Bounds(0, 0,
            Math.max(width - TRIGGER_WIDTH - 1, 0), Math.max(height - 1, 0));
        GraphicsUtilities.drawRect(graphics, contentBounds.x, contentBounds.y,
            contentBounds.width + 1, contentBounds.height + 1);

        Bounds triggerBounds = new Bounds(Math.max(width - TRIGGER_WIDTH - 1, 0), 0,
            TRIGGER_WIDTH, Math.max(height - 1, 0));
        GraphicsUtilities.drawRect(graphics, triggerBounds.x, triggerBounds.y,
            triggerBounds.width + 1, triggerBounds.height + 1);

        // Paint the content
View Full Code Here

                        @Override
                        public void run() {
                            int selectedIndex = listView.getSelectedIndex();

                            if (selectedIndex >= 0) {
                                Bounds itemBounds = listView.getItemBounds(selectedIndex);
                                listView.scrollAreaToVisible(itemBounds);
                            }
                        }
                    });
View Full Code Here

                scale = easing.easeOut(getElapsedTime(), 1, -1, getDuration());
            }

            Display display = sheet.getDisplay();
            if (display != null) {
                Bounds decoratedBounds = sheet.getDecoratedBounds();
                display.repaint(decoratedBounds.x, decoratedBounds.y,
                    decoratedBounds.width, decoratedBounds.height + dy);

                Dimensions size = sheet.getPreferredSize();
                dy = -(int)(size.height * scale);
 
View Full Code Here

     * @param skinY the Y coordinate in the skin's frame of reference
     */
    protected abstract void setSkinLocation(int skinX, int skinY);

    public Bounds getBounds() {
        return new Bounds(x, y, width, height);
    }
View Full Code Here

TOP

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

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.