Package pivot.wtk

Examples of pivot.wtk.Bounds


        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


        // Draw the border
        graphics.setPaint(titleBarBorderColor);
        graphics.drawRect(0, 0, width - 1, titleBarHeight + 1);
        // Draw the content area
        Bounds contentAreaRectangle = new Bounds(0, titleBarHeight + 2,
            width - 1, height - (titleBarHeight + 3));
        graphics.setPaint(contentBorderColor);
        graphics.drawRect(contentAreaRectangle.x, contentAreaRectangle.y,
            contentAreaRectangle.width, contentAreaRectangle.height);
View Full Code Here

        Window window = (Window)getComponent();
        boolean maximized = window.isMaximized();

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

            if (titleBarBounds.contains(x, y)) {
                dragOffset = new Point(x, y);
                Mouse.capture(component);
            }
        }
View Full Code Here

        // Get the data being edited
        List<?> listData = listView.getListData();
        ListItem listItem = (ListItem)listData.get(index);

        // Get the item bounds
        Bounds itemBounds = listView.getItemBounds(index);
        int itemIndent = listView.getItemIndent();
        itemBounds.x += itemIndent;
        itemBounds.width -= itemIndent;

        // Render the item data
        ListViewItemRenderer itemRenderer = (ListViewItemRenderer)listView.getItemRenderer();
        itemRenderer.render(listItem, listView, false, false, false, false);
        itemRenderer.setSize(itemBounds.width, itemBounds.height);

        // Calculate the text bounds
        Bounds textBounds = itemRenderer.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(itemBounds);
            editBounds.x += textBounds.x - (padding.left + 1);
            editBounds.width -= textBounds.x;
            editBounds.width += (padding.left + 1);

            // Scroll to make the text as visible as possible
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));
        graphics.drawRect(contentBounds.x, contentBounds.y, contentBounds.width, contentBounds.height);

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

        // Paint the content
        Button.DataRenderer dataRenderer = listButton.getDataRenderer();
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));
        graphics.drawRect(contentBounds.x, contentBounds.y, contentBounds.width, contentBounds.height);

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

        // Paint the content
        Button.DataRenderer dataRenderer = calendarButton.getDataRenderer();
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.x += nodeIndent;
        nodeBounds.width -= nodeIndent;

        // 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);
            editBounds.x += textBounds.x - (padding.left + 1);
            editBounds.width -= textBounds.x;
            editBounds.width += (padding.left + 1);

            // Scroll to make the text as visible as possible
View Full Code Here

  public void update() {
    // No-op
  }

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

            tag.paint(graphics);
        }
    }

    public Bounds getBounds(Component component) {
        Bounds bounds;

        if (tag == null) {
            bounds = null;
        } else {
            bounds = new Bounds();

            switch (horizontalAlignment) {
                case LEFT: {
                    bounds.x = xOffset;
                    break;
View Full Code Here

            graphics.drawImage(componentImage, 0, 0, null);
        }
    }

    public Bounds getBounds(Component component) {
        return new Bounds(xOffset - blurRadius, yOffset - blurRadius,
            component.getWidth() + blurRadius * 2,
            component.getHeight() + blurRadius * 2);
    }
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.