/** * Main constructor. * @param targetFlavor the target flavor */ public ImageLoaderSVG(ImageFlavor targetFlavor) { if (!(XMLNamespaceEnabledImageFlavor.SVG_DOM.isCompatible(targetFlavor))) { throw new IllegalArgumentException("Incompatible target ImageFlavor: " + targetFlavor); } this.targetFlavor = targetFlavor; }
/** {@inheritDoc} */ public boolean isCompatible(ImageFlavor flavor) { return getParentFlavor().isCompatible(flavor) || super.isCompatible(flavor); }
/** {@inheritDoc} */ public boolean isCompatible(RenderingContext targetContext, Image image) { if (targetContext instanceof PSRenderingContext) { PSRenderingContext psContext = (PSRenderingContext)targetContext; return !psContext.isCreateForms() && (image == null || (image instanceof ImageXMLDOM && image.getFlavor().isCompatible(BatikImageFlavors.SVG_DOM))); } return false; }
Map.Entry e = (Map.Entry) i; ImageFlavor checkFlavor = (ImageFlavor) e.getKey(); if (checkFlavor.isCompatible(flavor)) { List factoryList = (List)e.getValue(); if (factoryList != null && factoryList.size() > 0) {
/** {@inheritDoc} */ public boolean isCompatible(RenderingContext targetContext, Image image) { boolean supported = (image == null || (image instanceof ImageXMLDOM && image.getFlavor().isCompatible(BatikImageFlavors.SVG_DOM))) && targetContext instanceof PDFRenderingContext; if (supported) { String mode = (String)targetContext.getHint(ImageHandlerUtil.CONVERSION_MODE); if (ImageHandlerUtil.isConversionModeBitmap(mode)) { //Disabling this image handler automatically causes a bitmap to be generated return false; } } return supported; }
/** {@inheritDoc} */ public boolean isCompatible(RenderingContext targetContext, Image image) { boolean supported = (image == null || (image instanceof ImageXMLDOM && image.getFlavor().isCompatible(BatikImageFlavors.SVG_DOM))) && targetContext instanceof AFPRenderingContext; if (supported) { AFPRenderingContext afpContext = (AFPRenderingContext)targetContext; if (!afpContext.getPaintingState().isGOCAEnabled()) { return false; } String mode = (String)targetContext.getHint(ImageHandlerUtil.CONVERSION_MODE); if (ImageHandlerUtil.isConversionModeBitmap(mode)) { //Disabling this image handler automatically causes a bitmap to be generated return false; } } return supported; }