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

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


        final String echoPassword = echoPassword(chars);

        // draw cursor
        if (hasFocus() && canChangeValue().isAllowed()) {
            final int pos = style.stringWidth(echoPassword) - HPADDING;
            final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_CURSOR);
            canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(), color);
        }

        // draw text
        canvas.drawText(echoPassword, HPADDING, baseline, textColor, style);
View Full Code Here


        final int xEntent = getSize().getWidth() - 1;
        final int yExtent = getSize().getHeight() - 1;

        final int arc = 9;
        canvas.drawSolidRectangle(x + 2, y + 2, xEntent - 4, yExtent - 4, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
        final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
        canvas.drawRoundedRectangle(x, y++, xEntent, yExtent, arc, arc, black);
        canvas.drawRoundedRectangle(x + 1, y++, xEntent - 2, yExtent - 2, arc, arc, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
        canvas.drawRoundedRectangle(x + 2, y++, xEntent - 4, yExtent - 4, arc, arc, black);

        x += 10;
View Full Code Here

        final int height = size.getHeight();
        final int left = 3;
        final int top = 3;

        final boolean hasFocus = containsFocus();
        final Color lightColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        clearBackground(canvas, Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW));
        canvas.drawRectangle(1, 0, width - 2, height, lightColor);
        canvas.drawRectangle(0, 1, width, height - 2, lightColor);
        for (int i = 2; i < left; i++) {
            canvas.drawRectangle(i, i, width - 2 * i, height - 2 * i, lightColor);
View Full Code Here

        @Override
        public void draw(final Canvas canvas) {
            final int x = 0;
            final int y = 0;
            final Color crossColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
            canvas.drawLine(x + 4, y + 3, x + 10, y + 9, crossColor);
            canvas.drawLine(x + 5, y + 3, x + 11, y + 9, crossColor);
            canvas.drawLine(x + 10, y + 3, x + 4, y + 9, crossColor);
            canvas.drawLine(x + 11, y + 3, x + 5, y + 9, crossColor);
        }
View Full Code Here

        @Override
        public void draw(final Canvas canvas) {
            final int x = 0;
            final int y = 0;
            final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
            canvas.drawRectangle(x + 1, y + 1, WIDTH - 1, HEIGHT - 1, black);
            canvas.drawLine(x + 2, y + 2, x + WIDTH - 2, y + 2, black);
            canvas.drawLine(x + 2, y + 3, x + WIDTH - 2, y + 3, black);
        }
View Full Code Here

        if (((CollectionContent) getContent()).getOrderByElement()) {
            drawOrderIndicator(canvas, axis, x - 10);
        }

        final Color secondary1 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
        canvas.drawLine(0, 0, getSize().getWidth() - 1, 0, secondary1);
        canvas.drawLine(0, height - 1, getSize().getWidth() - 1, height - 1, secondary1);
        canvas.drawLine(x, 0, x, getSize().getHeight() - 1, secondary1);
        x++;
        final int columns = axis.getColumnCount();
View Full Code Here

        }
    }

    @Override
    public void draw(final Canvas canvas) {
        final Color secondary1 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
        final Color secondary2 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        final Color secondary3 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
        /*
         * REVIEW if (getViewAxis(TableAxis.class) != null) { if
         * (((SelectableViewAxis)
         * getViewAxis(SelectableViewAxis.class)).isSelected(getView())) {
         * canvas.drawSolidRectangle(left, 0, getSize().getWidth() - left, top,
         * Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2)); secondary2 =
         * secondary1; } }
         */
        if (getState().isObjectIdentified()) {
            canvas.drawRectangle(left, 0, getSize().getWidth() - left, top, secondary2);

            final int xExtent = getSize().getWidth();
            canvas.drawSolidRectangle(xExtent - BORDER + 1, 1, BORDER - 2, top - 2, secondary3);
            canvas.drawLine(xExtent - BORDER, 0, xExtent - BORDER, top - 2, secondary2);
        }

        // lines
        int x = 0;
        final int y = top / 2;
        canvas.drawLine(x, y, x + left, y, secondary2);

        final boolean isOpen = getSpecification().isOpen();
        final int canOpen = canOpen();
        final boolean addBox = isOpen || canOpen != NodeSpecification.CANT_OPEN;
        if (addBox) {
            x += BOX_X_OFFSET;
            canvas.drawLine(x, y, x + BOX_SIZE - 1, y, secondary3);
            canvas.drawSolidRectangle(x, y - BOX_SIZE / 2, BOX_SIZE, BOX_SIZE, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
            canvas.drawRectangle(x, y - BOX_SIZE / 2, BOX_SIZE, BOX_SIZE, secondary1);

            if (canOpen == NodeSpecification.UNKNOWN) {

            } else {
                final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
                canvas.drawLine(x + BOX_PADDING, y, x + BOX_SIZE - 1 - BOX_PADDING, y, black);
                if (!isOpen) {
                    x += BOX_SIZE / 2;
                    canvas.drawLine(x, y - BOX_SIZE / 2 + BOX_PADDING, x, y + BOX_SIZE / 2 - BOX_PADDING, black);
                }
View Full Code Here

    public void draw(final Canvas canvas) {
        super.draw(canvas);

        final Size s = getSize();
        // Logger.getLogger(getClass()).debug("drag outline size " + s);
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2);
        for (int i = 0; i < thickness; i++) {
            canvas.drawRectangle(i, i, s.getWidth() - i * 2 - 1, s.getHeight() - i * 2 - 1, color);
        }
        canvas.drawText(label, 2, 16, color, Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
    }
View Full Code Here

            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

    public void draw(final Canvas canvas, final Size s, final boolean hasFocus, final ViewState state, final View[] controls, final String title) {
        final int x = left;
        final int width = s.getWidth();
        final int height = s.getHeight();

        final Color titleBarBackgroundColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY3) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
        final Color titleBarTextColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_BLACK) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
        final Color borderColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);

        // slightly rounded grey border
        canvas.drawRectangle(1, 0, width - 2, height, borderColor);
        canvas.drawRectangle(0, 1, width, height - 2, borderColor);

        for (int i = 2; i < left; i++) {
            canvas.drawRectangle(i, i, width - 2 * i, height - 2 * i, borderColor);
        }

        if (state.isActive()) {
            final Image busyImage = ImageFactory.getInstance().loadIcon("busy", 16, null);
            canvas.drawImage(busyImage, width - right - 16 - 4, top + 4);
        }

        // title bar
        canvas.drawSolidRectangle(left, LINE_THICKNESS, width - left - right, titlebarHeight, titleBarBackgroundColor);
        final int y = LINE_THICKNESS + titlebarHeight - 1;
        canvas.drawLine(x, y, width - right - 1, y, borderColor);

        final int controlWidth = View.HPADDING + (WindowControl.WIDTH + View.HPADDING) * controls.length;
        final String text = TextUtils.limitText(title, TITLE_STYLE, width - controlWidth - LINE_THICKNESS * 2 - 2);
        canvas.drawText(text, x + View.HPADDING, baseline, titleBarTextColor, TITLE_STYLE);

        final Color white = Toolkit.getColor(ColorsAndFonts.COLOR_WHITE);
        final int hatchX = View.HPADDING + TITLE_STYLE.stringWidth(title) + 10;
        final int hatchWidth = controls[0].getLocation().getX() - hatchX - 10;
        final int hatchY = LINE_THICKNESS + 2;
        final int hatchHeight = titlebarHeight - 6;
        DrawingUtil.drawHatching(canvas, hatchX, hatchY, hatchWidth, hatchHeight, borderColor, white);
View Full Code Here

TOP

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

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.