Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Bounds


    @Override
    public void paint(Graphics2D graphics) {
        super.paint(graphics);

        int width = getWidth();
        Bounds monthYearRowBounds = calendarTablePane.getRowBounds(0);
        graphics.setColor(highlightBackgroundColor);
        graphics.fillRect(monthYearRowBounds.x, monthYearRowBounds.y,
            monthYearRowBounds.width, monthYearRowBounds.height);

        Bounds labelRowBounds = calendarTablePane.getRowBounds(1);

        graphics.setColor(dividerColor);
        int dividerY = labelRowBounds.y + labelRowBounds.height - 2;
        GraphicsUtilities.drawLine(graphics, 2, dividerY, Math.max(0, width - 4), Orientation.HORIZONTAL);
    }
View Full Code Here


        return headerIndex;
    }

    @Override
    public Bounds getHeaderBounds(int headerIndex) {
        Bounds headerBounds = null;

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

        if (tableView != null) {
            if (headerIndex < 0
                || headerIndex >= headerWidths.getLength()) {
                throw new IndexOutOfBoundsException();
            }

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

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

        return headerBounds;
    }
View Full Code Here

                Mouse.capture(tableViewHeader);
            }

            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()
                        && column.getWidth() != -1
                        && x > headerBounds.x + headerBounds.width - RESIZE_HANDLE_SIZE) {
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()
                        && column.getWidth() != -1
View Full Code Here

        for (int i = 0; i < row; i++) {
            rowY += cellHeight + verticalSpacing;
        }

        return new Bounds(0, rowY, getWidth(), cellHeight);
    }
View Full Code Here

        for (int j = 0; j < column; j++) {
            columnX += cellWidth + horizontalSpacing;
        }

        return new Bounds(columnX, 0, cellWidth, getHeight());
    }
View Full Code Here

    /**
     * Gets the bounding box defined by the specified node, or <tt>null</tt>
     * if the node is not currently visible.
     */
    protected final Bounds getNodeBounds(NodeInfo nodeInfo) {
        Bounds bounds = null;

        int index = visibleNodes.indexOf(nodeInfo);

        if (index >= 0) {
            int nodeHeight = getNodeHeight();
            int nodeY = index * (nodeHeight + VERTICAL_SPACING);

            bounds = new Bounds(0, nodeY, getWidth(), nodeHeight);
        }

        return bounds;
    }
View Full Code Here

    /**
     * Repaints the region occupied by the specified node.
     */
    protected void repaintNode(NodeInfo nodeInfo) {
        Bounds bounds = getNodeBounds(nodeInfo);
        if (bounds != null) {
            repaintComponent(bounds);
        }
    }
View Full Code Here

    @Override
    public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
        int wheelRotation, int x, int y) {
        if (highlightedNode != null) {
            Bounds nodeBounds = getNodeBounds(highlightedNode);

            highlightedNode.setHighlighted(false);
            highlightedNode = null;

            if (nodeBounds != null) {
View Full Code Here

        return path;
    }

    @Override
    public Bounds getNodeBounds(Path path) {
        Bounds nodeBounds = null;

        NodeInfo nodeInfo = getNodeInfoAt(path);

        if (nodeInfo != null) {
            nodeBounds = getNodeBounds(nodeInfo);
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.