Package org.apache.isis.core.progmodel.facets.value.image

Examples of org.apache.isis.core.progmodel.facets.value.image.ImageValueFacet


    public Size getRequiredSize(final Size availableSpace) {
        final ObjectAdapter value = getContent().getAdapter();
        if (value == null) {
            return super.getRequiredSize(availableSpace);
        } else {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final int width = Math.min(120, Math.max(32, facet.getWidth(value)));
            final int height = Math.min(120, Math.max(32, facet.getHeight(value)));
            return new Size(width, height);
        }
    }
View Full Code Here


        } catch (final InterruptedException e) {
            throw new IsisException(e);
        }

        // final ObjectAdapter value = getContent().getAdapter();
        final ImageValueFacet facet = ((FieldContent) getContent()).getSpecification().getFacet(ImageValueFacet.class);
        final ObjectAdapter object = facet.createValue(image);
        ((OneToOneField) getContent()).setObject(object);
        // ((TextParseableField) getContent()).entryComplete();
        invalidateLayout();
    }
View Full Code Here

        w -= 1;
        h -= 1;

        final ObjectAdapter value = getContent().getAdapter();
        if (value != null) {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final java.awt.Image image = facet.getImage(value);
            if (image != null) {
                final Size imageSize = new Size(facet.getWidth(value), facet.getHeight(value));
                if (imageSize.getWidth() <= w && imageSize.getHeight() <= h) {
                    canvas.drawImage(new AwtImage(image), left, top);
                } else {
                    canvas.drawImage(new AwtImage(image), left, top, w, h);
                }
View Full Code Here

    private void buildGui() {
        final String name = getModel().getName();
        final Label scalarName = new Label(ID_SCALAR_NAME, name);
        addOrReplace(scalarName);

        final ImageValueFacet imageValueFacet = getModel().getTypeOfSpecification().getFacet(ImageValueFacet.class);
        final ObjectAdapter adapter = getModel().getObject();
        if (adapter != null) {
            final java.awt.Image imageValue = imageValueFacet.getImage(adapter);
            final RenderedDynamicImageResource imageResource = new RenderedDynamicImageResource(
                    imageValue.getWidth(null), imageValue.getHeight(null)) {

                private static final long serialVersionUID = 1L;
View Full Code Here

    private void buildGui() {
        final String name = getModel().getName();
        final Label scalarName = new Label(ID_SCALAR_NAME, name);
        addOrReplace(scalarName);

        final ImageValueFacet imageValueFacet = getModel().getTypeOfSpecification().getFacet(ImageValueFacet.class);
        final ObjectAdapter adapter = getModel().getObject();
        if (adapter != null) {
            final java.awt.Image imageValue = imageValueFacet.getImage(adapter);
            final RenderedDynamicImageResource imageResource = new RenderedDynamicImageResource(imageValue.getWidth(null), imageValue.getHeight(null)) {

                private static final long serialVersionUID = 1L;

                @Override
View Full Code Here

        w -= 1;
        h -= 1;

        final ObjectAdapter value = getContent().getAdapter();
        if (value != null) {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final java.awt.Image image = facet.getImage(value);
            if (image != null) {
                final Size imageSize = new Size(facet.getWidth(value), facet.getHeight(value));
                if (imageSize.getWidth() <= w && imageSize.getHeight() <= h) {
                    canvas.drawImage(new AwtImage(image), left, top);
                } else {
                    canvas.drawImage(new AwtImage(image), left, top, w, h);
                }
View Full Code Here

    public Size getRequiredSize(final Size availableSpace) {
        final ObjectAdapter value = getContent().getAdapter();
        if (value == null) {
            return super.getRequiredSize(availableSpace);
        } else {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final int width = Math.min(120, Math.max(32, facet.getWidth(value)));
            final int height = Math.min(120, Math.max(32, facet.getHeight(value)));
            return new Size(width, height);
        }
    }
View Full Code Here

        } catch (final InterruptedException e) {
            throw new IsisException(e);
        }

        // final ObjectAdapter value = getContent().getAdapter();
        final ImageValueFacet facet = ((FieldContent) getContent()).getSpecification().getFacet(ImageValueFacet.class);
        final ObjectAdapter object = facet.createValue(image);
        ((OneToOneField) getContent()).setObject(object);
        // ((TextParseableField) getContent()).entryComplete();
        invalidateLayout();
    }
View Full Code Here

        w -= 1;
        h -= 1;

        final ObjectAdapter value = getContent().getAdapter();
        if (value != null) {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final java.awt.Image image = facet.getImage(value);
            if (image != null) {
                final Size imageSize = new Size(facet.getWidth(value), facet.getHeight(value));
                if (imageSize.getWidth() <= w && imageSize.getHeight() <= h) {
                    canvas.drawImage(new AwtImage(image), left, top);
                } else {
                    canvas.drawImage(new AwtImage(image), left, top, w, h);
                }
View Full Code Here

    public Size getRequiredSize(final Size availableSpace) {
        final ObjectAdapter value = getContent().getAdapter();
        if (value == null) {
            return super.getRequiredSize(availableSpace);
        } else {
            final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
            final int width = Math.min(120, Math.max(32, facet.getWidth(value)));
            final int height = Math.min(120, Math.max(32, facet.getHeight(value)));
            return new Size(width, height);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.progmodel.facets.value.image.ImageValueFacet

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.