Package pivot.wtk

Examples of pivot.wtk.Bounds


            return offset;
        }

        @Override
        public Bounds getCharacterBounds(int offset) {
            Bounds bounds;

            Paragraph paragraph = (Paragraph)getNode();
            if (offset == paragraph.getCharacterCount() - 1) {
                bounds = new Bounds(terminatorBounds);
            } else {
                bounds = super.getCharacterBounds(offset);
            }

            return bounds;
View Full Code Here


            String text = textNode.getText();
            GlyphVector glyphVector = font.createGlyphVector(fontRenderContext, text);

            Shape glyphVisualBounds = glyphVector.getGlyphVisualBounds(offset);
            Rectangle glyphBounds = glyphVisualBounds.getBounds();
            Bounds bounds = new Bounds(glyphBounds.x, 0, glyphBounds.width, getHeight());

            return bounds;
        }
View Full Code Here

            return 0;
        }

        @Override
        public Bounds getCharacterBounds(int offset) {
            return new Bounds(0, 0, getWidth(), getHeight());
        }
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 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

        if (verticalScrollBar.isVisible()) {
            width -= verticalScrollBar.getWidth();
        }

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

        return index;
    }

    public Bounds getHeaderBounds(int index) {
        Bounds headerBounds = null;

        TableViewHeader tableViewHeader = (TableViewHeader)getComponent();
        TableView tableView = tableViewHeader.getTableView();

        if (tableView != null) {
            Sequence<Integer> columnWidths =
                TerraTableViewSkin.getColumnWidths(tableView.getColumns(), getWidth());

            if (index < 0
                || index >= columnWidths.getLength()) {
                throw new IndexOutOfBoundsException();
            }

            int cellX = 0;
            for (int i = 0; i < index; i++) {
                cellX += (columnWidths.get(i) + 1);
            }

            headerBounds = new Bounds(cellX, 0, columnWidths.get(index), getHeight() - 1);
        }

        return headerBounds;
    }
View Full Code Here

        TableView tableView = tableViewHeader.getTableView();

        if (tableView != null) {
            if (Mouse.getCapturer() == tableViewHeader) {
                TableView.Column column = tableView.getColumns().get(resizeHeaderIndex);
                Bounds headerBounds = getHeaderBounds(resizeHeaderIndex);
                int columnWidth = Math.max(x - headerBounds.x, MINIMUM_COLUMN_WIDTH);
                column.setWidth(columnWidth, false);
            } else {
                int headerIndex = getHeaderAt(x);

                if (headerIndex != -1
                    && columnsResizable) {
                    Bounds headerBounds = getHeaderBounds(headerIndex);
                    TableView.Column column = tableView.getColumns().get(headerIndex);

                    if (!column.isRelative()
                        && x > headerBounds.x + headerBounds.width - RESIZE_HANDLE_SIZE) {
                        tableViewHeader.setCursor(Cursor.RESIZE_EAST);
View Full Code Here

        if (tableView != null) {
            int headerIndex = getHeaderAt(x);

            if (headerIndex != -1) {
                Bounds headerBounds = getHeaderBounds(headerIndex);
                TableView.Column column = tableView.getColumns().get(headerIndex);

                if (columnsResizable
                    && !column.isRelative()
                    && x > headerBounds.x + headerBounds.width - RESIZE_HANDLE_SIZE) {
View Full Code Here

                x += westButtonWidth;
                width -= westButtonWidth;
            }
        }

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

TOP

Related Classes of 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.