Package org.apache.fop.afp

Examples of org.apache.fop.afp.AFPResourceInfo


        AFPRenderingContext afpContext = (AFPRenderingContext)context;
        ImageXMLDOM imageSVG = (ImageXMLDOM)image;
        FOUserAgent userAgent = afpContext.getUserAgent();

        AFPGraphicsObjectInfo graphicsObjectInfo = (AFPGraphicsObjectInfo)createDataObjectInfo();
        AFPResourceInfo resourceInfo = graphicsObjectInfo.getResourceInfo();
        setDefaultToInlineResourceLevel(graphicsObjectInfo);

        // Create a new AFPGraphics2D
        final boolean textAsShapes = false; //afpInfo.strokeText(); //TODO make configurable
        AFPGraphics2D g2d = new AFPGraphics2D(
View Full Code Here


        paintingState.restore(); // resume
    }

    private void setDefaultToInlineResourceLevel(AFPGraphicsObjectInfo graphicsObjectInfo) {
        AFPResourceInfo resourceInfo = graphicsObjectInfo.getResourceInfo();
        //level not explicitly set/changed so default to inline for GOCA graphic objects
        // (due to a bug in the IBM AFP Workbench Viewer (2.04.01.07), hard copy works just fine)
        if (!resourceInfo.levelChanged()) {
            resourceInfo.setLevel(new AFPResourceLevel(AFPResourceLevel.INLINE));
        }
    }
View Full Code Here

     * @param uri the image's URI (or null if no URI is available)
     * @param foreignAttributes a Map of foreign attributes (or null)
     */
    protected void setResourceInformation(AFPDataObjectInfo dataObjectInfo,
            String uri, Map foreignAttributes) {
        AFPResourceInfo resourceInfo
            = foreignAttributeReader.getResourceInfo(foreignAttributes);
        resourceInfo.setUri(uri);
        dataObjectInfo.setResourceInfo(resourceInfo);
    }
View Full Code Here

            boolean paintAsBitmap = ImageHandlerUtil.isConversionModeBitmap(foreignAttributes);
            info.setPaintAsBitmap(paintAsBitmap);

            AFPForeignAttributeReader foreignAttributeReader
                = new AFPForeignAttributeReader();
            AFPResourceInfo resourceInfo
                = foreignAttributeReader.getResourceInfo(foreignAttributes);
            // set default resource level if an explicit one hasn't been set
            if (!resourceInfo.levelChanged()) {
                byte resourceType = paintAsBitmap
                    ? ResourceObject.TYPE_IMAGE : ResourceObject.TYPE_GRAPHIC;
                resourceInfo.setLevel(info.getResourceManager().getResourceLevelDefaults()
                        .getDefaultResourceLevel(resourceType));
            }
            info.setResourceInfo(resourceInfo);
        }
        return info;
View Full Code Here

     *
     * @param foreignAttributes the foreign attributes
     * @return the resource information
     */
    public AFPResourceInfo getResourceInfo(Map/*<QName, String>*/ foreignAttributes) {
        AFPResourceInfo resourceInfo = new AFPResourceInfo();
        if (foreignAttributes != null && !foreignAttributes.isEmpty()) {
            String resourceName = (String)foreignAttributes.get(RESOURCE_NAME);
            if (resourceName != null) {
                resourceInfo.setName(resourceName);
            }
            AFPResourceLevel level = getResourceLevel(foreignAttributes);
            if (level != null) {
                resourceInfo.setLevel(level);
            }
        }
        return resourceInfo;
    }
View Full Code Here

        os.write(data);
    }

    /** {@inheritDoc} */
    public void setViewport(AFPDataObjectInfo dataObjectInfo) {
        AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
        AFPResourceLevel resourceLevel = resourceInfo.getLevel();

        // only need to set MCD and CDD when OC when is inlined (pre-2000 apps)
        if (resourceLevel.isInline()) {
            super.setViewport(dataObjectInfo);

View Full Code Here

     *
     * @param foreignAttributes the foreign attributes
     * @return the resource information
     */
    public AFPResourceInfo getResourceInfo(Map/*<QName, String>*/ foreignAttributes) {
        AFPResourceInfo resourceInfo = new AFPResourceInfo();
        if (foreignAttributes != null && !foreignAttributes.isEmpty()) {
            String resourceName = (String)foreignAttributes.get(RESOURCE_NAME);
            if (resourceName != null) {
                resourceInfo.setName(resourceName);
            }
            AFPResourceLevel level = getResourceLevel(foreignAttributes);
            if (level != null) {
                resourceInfo.setLevel(level);
            }
        }
        return resourceInfo;
    }
View Full Code Here

        ImageFlavor.GRAPHICS2D
    };

    private void setDefaultResourceLevel(AFPGraphicsObjectInfo graphicsObjectInfo,
            AFPResourceManager resourceManager) {
        AFPResourceInfo resourceInfo = graphicsObjectInfo.getResourceInfo();
        if (!resourceInfo.levelChanged()) {
            resourceInfo.setLevel(resourceManager.getResourceLevelDefaults()
                    .getDefaultResourceLevel(ResourceObject.TYPE_GRAPHIC));
        }
    }
View Full Code Here

        ObjectAreaDescriptor objectAreaDescriptor = factory.createObjectAreaDescriptor(width,
                height, widthRes, heightRes);
        getObjectEnvironmentGroup().setObjectAreaDescriptor(objectAreaDescriptor);

        // object area position
        AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
        AFPResourceLevel resourceLevel = resourceInfo.getLevel();
        ObjectAreaPosition objectAreaPosition = null;
        int rotation = objectAreaInfo.getRotation();
        if (resourceLevel.isInline()) {
            int x = objectAreaInfo.getX();
            int y = objectAreaInfo.getY();
View Full Code Here

        os.write(data);
    }

    /** {@inheritDoc} */
    public void setViewport(AFPDataObjectInfo dataObjectInfo) {
        AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
        AFPResourceLevel resourceLevel = resourceInfo.getLevel();

        // only need to set MCD and CDD when OC when is inlined (pre-2000 apps)
        if (resourceLevel.isInline()) {
            super.setViewport(dataObjectInfo);

View Full Code Here

TOP

Related Classes of org.apache.fop.afp.AFPResourceInfo

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.