Package org.apache.isis.viewer.dnd.view

Examples of org.apache.isis.viewer.dnd.view.ViewState


        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);
        }
        final ViewState state = getState();
        if (state.isActive()) {
            final int i = left;
            canvas.drawRectangle(i, top, width - 2 * i, height - 2 * i - top, Toolkit.getColor(ColorsAndFonts.COLOR_ACTIVE));
        }

        final int bw = controls[0].getLocation().getX() - 3; // controls.length
View Full Code Here


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

        final ViewState state = getState();
        if (state.isViewIdentified()) {
            final Size s = getSize();
            final int xExtent = s.getWidth();
            if (state.isViewIdentified()) {
                canvas.drawSolidRectangle(xExtent - BORDER + 1, top, BORDER - 2, s.getHeight() - 2 * top,
                    Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
            }
        }
    }
View Full Code Here

    public void draw(final Canvas canvas) {
        icon.draw(canvas, 0, getBaseline());

        final ObjectAdapter collection = getContent().getAdapter();
        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
        final ViewState state = getState();
        final Color color;
        if (state.canDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_VALID);
        } else if (state.cantDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_INVALID);
        } else {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        }
        if (collection == null || facet.size(collection) == 0) {
View Full Code Here

        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);
        }
        final ViewState state = getState();
        if (state.isActive()) {
            final int i = left;
            canvas.drawRectangle(i, top, width - 2 * i, height - 2 * i - top,
                Toolkit.getColor(ColorsAndFonts.COLOR_ACTIVE));
        }

View Full Code Here

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

        Color color = null;
        final ViewState state = getState();
        final boolean hasFocus = getViewManager().hasFocus(getView());
        if (hasFocus) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);
        } else if (state.isObjectIdentified()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        }

        final Size s = getSize();
        if (color != null) {
View Full Code Here

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

        Color color = null;
        final ViewState state = getState();
        final boolean hasFocus = getViewManager().hasFocus(getView());
        if (state.canDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_VALID);
        } else if (state.cantDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_INVALID);
        } else if (hasFocus) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);
        } else if (state.isObjectIdentified()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        }
        final Size s = getSize();

        if (getContent().isPersistable() && getContent().isTransient()) {
View Full Code Here

            throw new IllegalArgumentException("Content not specified");
        }
        assignId();
        this.content = content;
        this.specification = specification;
        state = new ViewState();
        viewRoot = this;
    }
View Full Code Here

     * @param maxWidth
     *            the maximum width to display the text within; if negative no limit is imposed
     */
    public void draw(final Canvas canvas, final int x, final int baseline, final int maxWidth) {
        Color color;
        final ViewState state = view.getState();
        if (resolveFailure) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_ERROR);
        } else if (state.canDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_VALID);
        } else if (state.cantDrop()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_INVALID);
        } else if (state.isObjectIdentified()) {
            color = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);
        } else {
            color = this.color;
        }

View Full Code Here

        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()
            + ")");
        // canvas.drawRectangle(0, 0, getSize().getWidth(), borderRender.getTop(), Toolkit.getColor(0xfff));

        // controls
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.view.ViewState

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.