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

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


        final int x = 0;
        final int y = 0;

        canvas.drawRectangle(x - 1, y, width + 2, height + 1, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
        canvas.drawRectangle(x, y - 1, width + 2, height + 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1));
        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 + 3, y + 3, x + 9, 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 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

        return view;
    }

    private View addBorder(final Content parentContent, final FieldContent fieldContent, View view) {
        final Text textStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
        final Color colorStyle = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
        final TitleText titleText = new TitleText(view, textStyle, colorStyle) {
            @Override
            protected String title() {
                return parentContent.title() + "/" + fieldContent.getFieldName();
            }
View Full Code Here

    }

    @Override
    public void draw(final Canvas canvas) {
        if (getState().isViewIdentified()) {
            final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
            final Bounds bounds = getBounds();
            canvas.drawSolidRectangle(0, 0, bounds.getWidth(), bounds.getHeight(), color);
        }
        canvas.offset(ViewConstants.HPADDING, 0);
        super.draw(canvas);
View Full Code Here

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

        final Size s = getSize();
        // LoggerFactory.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

    @Override
    public void draw(final Canvas canvas) {
        // blank background
        final Bounds bounds = getBounds();
        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW + "." + getSpecification().getName());
        canvas.drawSolidRectangle(1, 1, bounds.getWidth() - 2, bounds.getHeight() - 2, color);

        final boolean hasFocus = containsFocus();
        final ViewState state = getState();
        borderRender.draw(canvas, getSize(), hasFocus, state, controls, title() + " (" + getSpecification().getName() + ")");
View Full Code Here

        canvas.drawImage(errorIcon, LEFT, TOP);

        final int x = LEFT + errorIcon.getWidth() + PADDING;
        int y = TOP + 3 + Toolkit.getText(ColorsAndFonts.TEXT_NORMAL).getAscent();
        final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
        if (!heading.equals("")) {
            final Text title = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
            canvas.drawText(heading, x, y, black, title);
            y += title.getLineHeight();
        }
View Full Code Here

        }
    }

    @Override
    protected Color textColor() {
        Color color;
        if (labelState.canDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_VALID);
        } else if (labelState.cantDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_INVALID);
        } else {
View Full Code Here

        return defaultFieldHeight;
    }

    @Override
    public Color getColor(final String name) {
        Color color = (Color) colors.get(name);
        if (color == null && name.startsWith(COLOR_WINDOW + ".")) {
            color = new AwtColor(name, (AwtColor) getColor(COLOR_WINDOW));
            colors.put(name, color);
        }
        return color;
View Full Code Here

        title.draw(subcanvas, offset, baseline, getLeft() - offset);

        final int columns = axis.getColumnCount();
        int x = -1;
        x += axis.getHeaderOffset();
        final Color secondary1 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
        canvas.drawLine(x - 1, 0, x - 1, s.getHeight() - 1, secondary1);
        canvas.drawLine(x, 0, x, s.getHeight() - 1, secondary1);
        for (int i = 0; i < columns; i++) {
            x += axis.getColumnWidth(i);
            canvas.drawLine(x, 0, x, s.getHeight() - 1, secondary1);
        }
        canvas.drawLine(0, 0, 0, s.getHeight() - 1, secondary1);

        final int y = s.getHeight() - 1;
        final Color secondary2 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        canvas.drawLine(0, y, s.getWidth(), y, secondary2);

        if (getState().isObjectIdentified()) {
            final int xExtent = width - 1;
            canvas.drawLine(xExtent - BORDER, top, xExtent - BORDER, top + s.getHeight() - 1, secondary2);
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.