Package pivot.wtk

Examples of pivot.wtk.Bounds


        }

        graphics.setFont(font);
        graphics.setPaint(getFill());

        Bounds bounds = getBounds();

        float y = 0;
        for (TextLayout line : lines) {
            Rectangle2D lineBounds = line.getBounds();
View Full Code Here


    public void setStrokeThickness(int strokeThickness) {
        throw new UnsupportedOperationException();
    }

    public void draw(Graphics2D graphics) {
        Bounds clipBounds = new Bounds(graphics.getClipBounds());

        // Draw each sub-shape
        for (Shape shape : shapes) {
            if (shape.isVisible()) {
                int x = shape.getX();
                int y = shape.getY();

                Bounds transformedBounds = shape.getTransformedBounds();
                transformedBounds = transformedBounds.translate(x, y);

                if (transformedBounds.intersects(clipBounds)) {
                    Graphics2D shapeGraphics = (Graphics2D)graphics.create();
                    shapeGraphics.translate(x, y);
                    shapeGraphics.transform(shape.getTransforms().getAffineTransform());
                    shape.draw(shapeGraphics);
                    shapeGraphics.dispose();
View Full Code Here

                Shape shape = shapes.get(i);
                if (shape.isVisible()) {
                    shape.validate();
                    int x = shape.getX();
                    int y = shape.getY();
                    Bounds transformedBounds = shape.getTransformedBounds();

                    if (i == 0) {
                        top = y + transformedBounds.y;
                        left = x + transformedBounds.x;
                        bottom = y + transformedBounds.y
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 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

        // Draw the border
        graphics.setPaint(titleBarBorderColor);
        GraphicsUtilities.drawRect(graphics, 0, 0, width, titleBarHeight + 2);

        // Draw the content area
        Bounds contentAreaRectangle = new Bounds(0, titleBarHeight + 2,
            width, height - (titleBarHeight + 2));
        graphics.setPaint(contentBorderColor);
        GraphicsUtilities.drawRect(graphics, 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);
            } else {
                Bounds resizeHandleBounds = resizeHandle.getBounds();

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

        return columnIndex;
    }

    public Bounds getRowBounds(int rowIndex) {
        int rowHeight = getRowHeight();
        return new Bounds(0, rowIndex * rowHeight, getWidth(), rowHeight);
    }
View Full Code Here

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

        return new Bounds(columnX, 0, columnWidths.get(columnIndex), getHeight());
    }
View Full Code Here

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

        return new Bounds(cellX, rowIndex * rowHeight,
            columnWidths.get(columnIndex), rowHeight);
    }
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.