Package org.apache.xmlgraphics.image.loader

Examples of org.apache.xmlgraphics.image.loader.ImageFlavor


                    loaders.put(mime, flavorMap);
                }

                ImageFlavor[] flavors = loaderFactory.getSupportedFlavors(mime);
                for (int j = 0, cj = flavors.length; j < cj; j++) {
                    ImageFlavor flavor = flavors[j];

                    List factoryList = (List)flavorMap.get(flavor);
                    if (factoryList == null) {
                        factoryList = new java.util.ArrayList();
                        flavorMap.put(flavor, factoryList);
View Full Code Here


        Collection matches = new java.util.TreeSet(new ImageLoaderFactoryComparator(flavor));
        Map flavorMap = (Map)loaders.get(mime);
        if (flavorMap != null) {
            Iterator flavorIter = flavorMap.keySet().iterator();
            while (flavorIter.hasNext()) {
                ImageFlavor checkFlavor = (ImageFlavor)flavorIter.next();
                if (checkFlavor.isCompatible(flavor)) {
                    List factoryList = (List)flavorMap.get(checkFlavor);
                    if (factoryList != null && factoryList.size() > 0) {
                        Iterator factoryIter = factoryList.iterator();
                        while (factoryIter.hasNext()) {
                            ImageLoaderFactory factory = (ImageLoaderFactory)factoryIter.next();
View Full Code Here

        int converterCount = converters.size();
        int startingPoint = 0;
        if (cache != null) {
            for (int i = converterCount - 1; i >= 0; i--) {
                ImageConverter converter = getConverter(i);
                ImageFlavor flavor = converter.getTargetFlavor();
                img = cache.getImage(info, flavor);
                if (img != null) {
                    startingPoint = i + 1;
                    break;
                }
            }

            if (img == null && loader != null) {
                //try target flavor of loader from cache
                ImageFlavor flavor = loader.getTargetFlavor();
                img = cache.getImage(info, flavor);
            }
        }
        if (img == null && originalImage != null) {
            img = originalImage;
View Full Code Here

                    loaders.put(mime, flavorMap);
                }
               
                ImageFlavor[] flavors = loaderFactory.getSupportedFlavors(mime);
                for (int j = 0, cj = flavors.length; j < cj; j++) {
                    ImageFlavor flavor = flavors[j];
                   
                    List factoryList = (List)flavorMap.get(flavor);
                    if (factoryList == null) {
                        factoryList = new java.util.ArrayList();
                        flavorMap.put(flavor, factoryList);
View Full Code Here

        int converterCount = converters.size();
        int startingPoint = 0;
        if (cache != null) {
            for (int i = converterCount - 1; i >= 0; i--) {
                ImageConverter converter = getConverter(i);
                ImageFlavor flavor = converter.getTargetFlavor();
                img = cache.getImage(info, flavor);
                if (img != null) {
                    startingPoint = i + 1;
                    break;
                }
            }
       
            if (img == null && loader != null) {
                //try target flavor of loader from cache
                ImageFlavor flavor = loader.getTargetFlavor();
                img = cache.getImage(info, flavor);
            }
        }
        if (img == null && originalImage != null) {
            img = originalImage;
View Full Code Here

        ImageManager manager = getUserAgent().getFactory().getImageManager();
        ImageProviderPipeline[] inlineCandidates
            = manager.getPipelineFactory().determineCandidatePipelines(
                    info, inlineFlavors);
        ImageProviderPipeline inlineChoice = manager.choosePipeline(inlineCandidates);
        ImageFlavor inlineFlavor = (inlineChoice != null ? inlineChoice.getTargetFlavor() : null);
       
        //Investigate choice for form mode
        ImageFlavor[] formFlavors = getFormFlavors();
        ImageProviderPipeline[] formCandidates
            = manager.getPipelineFactory().determineCandidatePipelines(
                    info, formFlavors);
        ImageProviderPipeline formChoice = manager.choosePipeline(formCandidates);
        ImageFlavor formFlavor = (formChoice != null ? formChoice.getTargetFlavor() : null);
       
        //Inline if form is not supported or if a better choice is available with inline mode
        return formFlavor == null || !formFlavor.equals(inlineFlavor);
    }
View Full Code Here

        int converterCount = converters.size();
        int startingPoint = 0;
        if (cache != null) {
            for (int i = converterCount - 1; i >= 0; i--) {
                ImageConverter converter = getConverter(i);
                ImageFlavor flavor = converter.getTargetFlavor();
                img = cache.getImage(info, flavor);
                if (img != null) {
                    startingPoint = i + 1;
                    break;
                }
            }

            if (img == null && loader != null) {
                //try target flavor of loader from cache
                ImageFlavor flavor = loader.getTargetFlavor();
                img = cache.getImage(info, flavor);
            }
        }
        if (img == null && originalImage != null) {
            img = originalImage;
View Full Code Here

                    loaders.put(mime, flavorMap);
                }

                ImageFlavor[] flavors = loaderFactory.getSupportedFlavors(mime);
                for (int j = 0, cj = flavors.length; j < cj; j++) {
                    ImageFlavor flavor = flavors[j];

                    List factoryList = (List)flavorMap.get(flavor);
                    if (factoryList == null) {
                        factoryList = new java.util.ArrayList();
                        flavorMap.put(flavor, factoryList);
View Full Code Here

        Collection matches = new java.util.TreeSet(new ImageLoaderFactoryComparator(flavor));
        Map flavorMap = (Map)loaders.get(mime);
        if (flavorMap != null) {
            Iterator flavorIter = flavorMap.keySet().iterator();
            while (flavorIter.hasNext()) {
                ImageFlavor checkFlavor = (ImageFlavor)flavorIter.next();
                if (checkFlavor.isCompatible(flavor)) {
                    List factoryList = (List)flavorMap.get(checkFlavor);
                    if (factoryList != null && factoryList.size() > 0) {
                        Iterator factoryIter = factoryList.iterator();
                        while (factoryIter.hasNext()) {
                            ImageLoaderFactory factory = (ImageLoaderFactory)factoryIter.next();
View Full Code Here

        ImageManager manager = renderingContext.getUserAgent().getFactory().getImageManager();
        ImageProviderPipeline[] inlineCandidates
            = manager.getPipelineFactory().determineCandidatePipelines(
                    info, inlineFlavors);
        ImageProviderPipeline inlineChoice = manager.choosePipeline(inlineCandidates);
        ImageFlavor inlineFlavor = (inlineChoice != null
                ? inlineChoice.getTargetFlavor() : null);

        //Create a rendering context for form creation
        PSRenderingContext formContext = renderingContext.toFormContext();

        //Investigate choice for form mode
        ImageFlavor[] formFlavors = determineSupportedImageFlavors(formContext);
        ImageProviderPipeline[] formCandidates
            = manager.getPipelineFactory().determineCandidatePipelines(
                    info, formFlavors);
        ImageProviderPipeline formChoice = manager.choosePipeline(formCandidates);
        ImageFlavor formFlavor = (formChoice != null ? formChoice.getTargetFlavor() : null);

        //Inline if form is not supported or if a better choice is available with inline mode
        return formFlavor == null || !formFlavor.equals(inlineFlavor);
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.image.loader.ImageFlavor

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.