Package pivot.wtk

Examples of pivot.wtk.Bounds


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

        if (highlightedIndex != -1) {
            Bounds rowBounds = getRowBounds(highlightedIndex);
            repaintComponent(rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height);
        }

        highlightedIndex = -1;
        editIndex = -1;
View Full Code Here


    @Override
    public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
        int wheelRotation, int x, int y) {
        if (highlightedIndex != -1) {
            Bounds rowBounds = getRowBounds(highlightedIndex);
            repaintComponent(rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height);
        }

        highlightedIndex = -1;
View Full Code Here

        return index;
    }

    public Bounds getItemBounds(int index) {
        int itemHeight = getItemHeight();
        return new Bounds(0, index * itemHeight, getWidth(), itemHeight);
    }
View Full Code Here

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

        if (highlightedIndex != -1) {
            Bounds itemBounds = getItemBounds(highlightedIndex);
            repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
        }

        highlightedIndex = -1;
        editIndex = -1;
View Full Code Here

    @Override
    public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
        int wheelRotation, int x, int y) {
        if (highlightedIndex != -1) {
            Bounds itemBounds = getItemBounds(highlightedIndex);
            repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
        }

        highlightedIndex = -1;
View Full Code Here

        // Get the data being edited
        String columnName = tableView.getColumns().get(columnIndex).getName();
        Object cellData = rowData.get(columnName);

        // Get the cell bounds
        Bounds cellBounds = tableView.getCellBounds(rowIndex, columnIndex);
        tableView.scrollAreaToVisible(cellBounds);
        cellBounds = tableView.getVisibleArea(cellBounds);

        // Create the text input
        textInput = new TextInput();
View Full Code Here

        // Get the data being edited
        List<?> treeData = treeView.getTreeData();
        TreeNode nodeData = (TreeNode)Sequence.Tree.get(treeData, path);

        // Get the node bounds
        Bounds nodeBounds = treeView.getNodeBounds(path);
        int nodeIndent = treeView.getNodeIndent(path.getLength());
        nodeBounds = new Bounds(nodeBounds.x + nodeIndent, nodeBounds.y,
            nodeBounds.width - nodeIndent, nodeBounds.height);

        // Render the node data
        TreeViewNodeRenderer nodeRenderer = (TreeViewNodeRenderer)treeView.getNodeRenderer();
        nodeRenderer.render(nodeData, treeView, false, false,
            TreeView.NodeCheckState.UNCHECKED, false, false);
        nodeRenderer.setSize(nodeBounds.width, nodeBounds.height);

        // Get the text bounds
        Bounds textBounds = nodeRenderer.getTextBounds();

        if (textBounds != null) {
            textInput = new TextInput();
            Insets padding = (Insets)textInput.getStyles().get("padding");

            // Calculate the bounds of what we're editing
            Bounds editBounds = new Bounds(nodeBounds.x + textBounds.x - (padding.left + 1),
                nodeBounds.y, nodeBounds.width - textBounds.x + (padding.left + 1),
                nodeBounds.height);

            // Scroll to make the text as visible as possible
            treeView.scrollAreaToVisible(editBounds.x, editBounds.y,
View Full Code Here

        // Load the row data into the editor components
        editorTablePane.load(rowData);

        // Calculate the visible bounds of the row
        Bounds editBounds = tableView.getRowBounds(rowIndex);
        tableView.scrollAreaToVisible(editBounds);
        editBounds = tableView.getVisibleArea(editBounds);

        // Open the popup over the row
        popup.setLocation(editBounds.x, editBounds.y);
View Full Code Here

        return rowIndex;
    }

    public Bounds getRowBounds(int row) {
        if (rowHeights == null) {
            return new Bounds(0, 0, 0, 0);
        }

        int rowY = padding.top;

        for (int i = 0; i < row; i++) {
            rowY += rowHeights[i] + verticalSpacing;
        }

        return new Bounds(0, rowY, getWidth(), rowHeights[row]);
    }
View Full Code Here

        return columnIndex;
    }

    public Bounds getColumnBounds(int column) {
        if (columnWidths == null) {
            return new Bounds(0, 0, 0, 0);
        }

        int columnX = padding.left;

        for (int j = 0; j < column; j++) {
            columnX += columnWidths[j] + horizontalSpacing;
        }

        return new Bounds(columnX, 0, columnWidths[column], getHeight());
    }
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.