Package org.apache.isis.viewer.dnd.drawing

Examples of org.apache.isis.viewer.dnd.drawing.Shape


        // canvas.drawRectangle(0, height, getSize().getWidth() - 1,
        // getSize().getHeight() - height - 1, secondary2);
    }

    private void drawOrderIndicator(final Canvas canvas, final TableAxis axis, final int x) {
        Shape arrow;
        arrow = new Shape();
        if (((CollectionContent) getContent()).getReverseSortOrder()) {
            arrow.addPoint(0, 7);
            arrow.addPoint(3, 0);
            arrow.addPoint(6, 7);
        } else {
            arrow.addPoint(0, 0);
            arrow.addPoint(6, 0);
            arrow.addPoint(3, 7);
        }
        // canvas.drawRectangle(x + axis.getColumnWidth(i) - 10, 3, 7, 8,
        // Toolkit.getColor("secondary3"));
        canvas.drawShape(arrow, x, 3, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
    }
View Full Code Here


            canvas.drawRectangle(x - 2, y, width + 4, height, Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BOUNDS_VIEW));
        }
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);

        final int arrowHeight = width / 2;
        final Shape upArrow = new Shape(0, arrowHeight);
        upArrow.addVector(arrowHeight, -arrowHeight);
        upArrow.addVector(arrowHeight, arrowHeight);
        if (mouseOverButton == over + 6) {
            canvas.drawSolidShape(upArrow, x, y + 2, color);
        } else {
            canvas.drawShape(upArrow, x, y + 2, color);
        }

        final Shape downArrow = new Shape(0, 0);
        downArrow.addVector(arrowHeight, arrowHeight);
        downArrow.addVector(arrowHeight, -arrowHeight);
        if (mouseOverButton == over) {
            canvas.drawSolidShape(downArrow, x, y + height - 4 - arrowHeight, color);
        } else {
            canvas.drawShape(downArrow, x, y + height - 4 - arrowHeight, color);
        }
View Full Code Here

        debug.appendln("open", isOpen);
    }

    @Override
    public void draw(final Canvas canvas) {
        Shape pointer;
        if (isOpen) {
            pointer = new Shape(0, left / 2);
            pointer.addPoint(left - 2 - 2, left / 2);
            pointer.addPoint(left / 2 - 2, left - 2);
        } else {
            pointer = new Shape(2, 2);
            pointer.addPoint(2, left - 2);
            pointer.addPoint(left / 2, 2 + (left - 2) / 2);
        }
        if (canOpen == CAN_OPEN) {
            canvas.drawSolidShape(pointer, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1));
        } else if (canOpen == UNKNOWN) {
            canvas.drawShape(pointer, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1));
View Full Code Here

        final Size size = getSize();
        final int x = size.getWidth() - right + 5 - ViewConstants.HPADDING;
        final int y = (size.getHeight() - 6) / 2;

        if (isAvailable()) {
            final Shape triangle = new Shape(0, 0);
            triangle.addPoint(6, 6);
            triangle.addPoint(12, 0);

            canvas.drawShape(triangle, x, y, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
            if (over) {
                final Color color = over ? Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1) : Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2);
                canvas.drawSolidShape(triangle, x, y, color);
View Full Code Here

    }

    @Override
    protected void drawResizeBorder(final Canvas canvas, final Size size) {
        if (resizing) {
            final Shape shape = new Shape(0, 0);
            final int resizeMarkerSize = 10;
            shape.addVector(resizeMarkerSize, 0);
            shape.addVector(0, resizeMarkerSize);
            shape.addVector(-resizeMarkerSize, -resizeMarkerSize);
            final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
            final int height = size.getHeight();
            final int width = size.getWidth();
            canvas.drawSolidShape(shape, width - resizeMarkerSize, height, color);
            canvas.drawRectangle(0, 0, width, height, color);
View Full Code Here

        junit.textui.TestRunner.run(ShapeTest.class);
    }

    @Override
    protected void setUp() throws Exception {
        shape = new Shape();
    }
View Full Code Here

    public void testCreateCopy() {
        shape.addPoint(10, 12);
        shape.addPoint(8, 5);
        shape.addPoint(0, 2);

        final Shape copy = new Shape(shape);

        assertEquals(3, copy.count());
        assertEquals(10, copy.getX()[0]);
        assertEquals(12, copy.getY()[0]);
        assertEquals(8, copy.getX()[1]);
        assertEquals(5, copy.getY()[1]);
        assertEquals(0, copy.getX()[2]);
        assertEquals(2, copy.getY()[2]);
    }
View Full Code Here

        junit.textui.TestRunner.run(ShapeTest2.class);
    }

    @Override
    protected void setUp() throws Exception {
        shape = new Shape(10, 20);
    }
View Full Code Here

                } else {
                    color = normalColor();
                }
                canvas.drawText(items[i].name, left, baseLine, color, style());
                if (items[i].action instanceof UserActionSet) {
                    Shape arrow;
                    arrow = new Shape(0, 0);
                    arrow.addVector(4, 4);
                    arrow.addVector(-4, 4);
                    canvas.drawSolidShape(arrow, width - 10, baseLine - 8, color);
                }
            }

            baseLine += itemHeight;
View Full Code Here

        graphics.drawPolygon(shape.getX(), shape.getY(), shape.count());
    }

    @Override
    public void drawShape(final Shape shape, final int x, final int y, final Color color) {
        final Shape copy = new Shape(shape);
        copy.translate(x, y);
        drawShape(copy, color);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.drawing.Shape

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.