Java Code Examples for javax.print.DocFlavor#equals()
The following examples show how to use
javax.print.DocFlavor#equals() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Win32PrintService.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { /* To avoid a native query which may be time-consuming * do not invoke native unless postscript support is being queried. * Instead just check the ones we 'always' support */ DocFlavor[] supportedDocFlavors; if (isPostScriptFlavor(flavor)) { supportedDocFlavors = getSupportedDocFlavors(); } else { supportedDocFlavors = supportedFlavors; } for (int f=0; f<supportedDocFlavors.length; f++) { if (flavor.equals(supportedDocFlavors[f])) { return true; } } return false; }
Example 2
Source File: Win32PrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { /* To avoid a native query which may be time-consuming * do not invoke native unless postscript support is being queried. * Instead just check the ones we 'always' support */ DocFlavor[] supportedDocFlavors; if (isPostScriptFlavor(flavor)) { supportedDocFlavors = getSupportedDocFlavors(); } else { supportedDocFlavors = supportedFlavors; } for (int f=0; f<supportedDocFlavors.length; f++) { if (flavor.equals(supportedDocFlavors[f])) { return true; } } return false; }
Example 3
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private boolean isServiceFormattedFlavor(DocFlavor flavor) { return flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE) || flavor.equals(DocFlavor.BYTE_ARRAY.GIF) || flavor.equals(DocFlavor.INPUT_STREAM.GIF) || flavor.equals(DocFlavor.URL.GIF) || flavor.equals(DocFlavor.BYTE_ARRAY.JPEG) || flavor.equals(DocFlavor.INPUT_STREAM.JPEG) || flavor.equals(DocFlavor.URL.JPEG) || flavor.equals(DocFlavor.BYTE_ARRAY.PNG) || flavor.equals(DocFlavor.INPUT_STREAM.PNG) || flavor.equals(DocFlavor.URL.PNG); }
Example 4
Source File: Win32PrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private boolean isAutoSense(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) || flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) || flavor.equals(DocFlavor.URL.AUTOSENSE)) { return true; } else { return false; } }
Example 5
Source File: Win32PrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private boolean isPostScriptFlavor(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT) || flavor.equals(DocFlavor.INPUT_STREAM.POSTSCRIPT) || flavor.equals(DocFlavor.URL.POSTSCRIPT)) { return true; } else { return false; } }
Example 6
Source File: StreamPrintServiceFactory.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static boolean isMember(DocFlavor flavor, DocFlavor[] flavors) { for (int f=0; f<flavors.length; f++ ) { if (flavor.equals(flavors[f])) { return true; } } return false; }
Example 7
Source File: IPPPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private boolean isAutoSense(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) || flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) || flavor.equals(DocFlavor.URL.AUTOSENSE)) { return true; } else { return false; } }
Example 8
Source File: PSStreamPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { DocFlavor [] flavors = getSupportedDocFlavors(); for (int f=0; f<flavors.length; f++) { if (flavor.equals(flavors[f])) { return true; } } return false; }
Example 9
Source File: IPPPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private boolean isDestinationSupported(DocFlavor flavor, AttributeSet attributes) { if ((attributes != null) && (attributes.get(Destination.class) != null) && !(flavor == null || flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } return true; }
Example 10
Source File: IPPPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private boolean isAutoSense(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) || flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) || flavor.equals(DocFlavor.URL.AUTOSENSE)) { return true; } else { return false; } }
Example 11
Source File: IPPPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { if (supportedDocFlavors == null) { getSupportedDocFlavors(); } if (supportedDocFlavors != null) { for (int f=0; f<supportedDocFlavors.length; f++) { if (flavor.equals(supportedDocFlavors[f])) { return true; } } } return false; }
Example 12
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private boolean isServiceFormattedFlavor(DocFlavor flavor) { return flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE) || flavor.equals(DocFlavor.BYTE_ARRAY.GIF) || flavor.equals(DocFlavor.INPUT_STREAM.GIF) || flavor.equals(DocFlavor.URL.GIF) || flavor.equals(DocFlavor.BYTE_ARRAY.JPEG) || flavor.equals(DocFlavor.INPUT_STREAM.JPEG) || flavor.equals(DocFlavor.URL.JPEG) || flavor.equals(DocFlavor.BYTE_ARRAY.PNG) || flavor.equals(DocFlavor.INPUT_STREAM.PNG) || flavor.equals(DocFlavor.URL.PNG); }
Example 13
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private boolean isAutoSense(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) || flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) || flavor.equals(DocFlavor.URL.AUTOSENSE)) { return true; } else { return false; } }
Example 14
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { if (supportedDocFlavors == null) { initSupportedDocFlavors(); } for (int f=0; f<supportedDocFlavors.length; f++) { if (flavor.equals(supportedDocFlavors[f])) { return true; } } return false; }
Example 15
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public boolean isDocFlavorSupported(DocFlavor flavor) { if (supportedDocFlavors == null) { initSupportedDocFlavors(); } for (int f=0; f<supportedDocFlavors.length; f++) { if (flavor.equals(supportedDocFlavors[f])) { return true; } } return false; }
Example 16
Source File: Win32PrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private boolean isPostScriptFlavor(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT) || flavor.equals(DocFlavor.INPUT_STREAM.POSTSCRIPT) || flavor.equals(DocFlavor.URL.POSTSCRIPT)) { return true; } else { return false; } }
Example 17
Source File: StreamPrintServiceFactory.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static boolean isMember(DocFlavor flavor, DocFlavor[] flavors) { for (int f=0; f<flavors.length; f++ ) { if (flavor.equals(flavors[f])) { return true; } } return false; }
Example 18
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private boolean isAutoSense(DocFlavor flavor) { if (flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) || flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) || flavor.equals(DocFlavor.URL.AUTOSENSE)) { return true; } else { return false; } }
Example 19
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
public boolean isAttributeValueSupported(Attribute attr, DocFlavor flavor, AttributeSet attributes) { if (attr == null) { throw new NullPointerException("null attribute"); } if (flavor != null) { if (!isDocFlavorSupported(flavor)) { throw new IllegalArgumentException(flavor + " is an unsupported flavor"); } else if (isAutoSense(flavor)) { return false; } } Class category = attr.getCategory(); if (!isAttributeCategorySupported(category)) { return false; } else if (attr.getCategory() == Chromaticity.class) { if (flavor == null || isServiceFormattedFlavor(flavor)) { return attr == Chromaticity.COLOR; } else { return false; } } else if (attr.getCategory() == Copies.class) { return (flavor == null || !(flavor.equals(DocFlavor.INPUT_STREAM.POSTSCRIPT) || flavor.equals(DocFlavor.URL.POSTSCRIPT) || flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT))) && isSupportedCopies((Copies)attr); } else if (attr.getCategory() == Destination.class) { URI uri = ((Destination)attr).getURI(); if ("file".equals(uri.getScheme()) && !(uri.getSchemeSpecificPart().equals(""))) { return true; } else { return false; } } else if (attr.getCategory() == Media.class) { if (attr instanceof MediaSizeName) { return isSupportedMedia((MediaSizeName)attr); } else { return false; } } else if (attr.getCategory() == OrientationRequested.class) { if (attr == OrientationRequested.REVERSE_PORTRAIT || (flavor != null) && !isServiceFormattedFlavor(flavor)) { return false; } } else if (attr.getCategory() == PageRanges.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } else if (attr.getCategory() == SheetCollate.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } else if (attr.getCategory() == Sides.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } return true; }
Example 20
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public boolean isAttributeValueSupported(Attribute attr, DocFlavor flavor, AttributeSet attributes) { if (attr == null) { throw new NullPointerException("null attribute"); } if (flavor != null) { if (!isDocFlavorSupported(flavor)) { throw new IllegalArgumentException(flavor + " is an unsupported flavor"); } else if (isAutoSense(flavor)) { return false; } } Class category = attr.getCategory(); if (!isAttributeCategorySupported(category)) { return false; } else if (attr.getCategory() == Chromaticity.class) { if (flavor == null || isServiceFormattedFlavor(flavor)) { return attr == Chromaticity.COLOR; } else { return false; } } else if (attr.getCategory() == Copies.class) { return (flavor == null || !(flavor.equals(DocFlavor.INPUT_STREAM.POSTSCRIPT) || flavor.equals(DocFlavor.URL.POSTSCRIPT) || flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT))) && isSupportedCopies((Copies)attr); } else if (attr.getCategory() == Destination.class) { URI uri = ((Destination)attr).getURI(); if ("file".equals(uri.getScheme()) && !(uri.getSchemeSpecificPart().equals(""))) { return true; } else { return false; } } else if (attr.getCategory() == Media.class) { if (attr instanceof MediaSizeName) { return isSupportedMedia((MediaSizeName)attr); } else { return false; } } else if (attr.getCategory() == OrientationRequested.class) { if (attr == OrientationRequested.REVERSE_PORTRAIT || (flavor != null) && !isServiceFormattedFlavor(flavor)) { return false; } } else if (attr.getCategory() == PageRanges.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } else if (attr.getCategory() == SheetCollate.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } else if (attr.getCategory() == Sides.class) { if (flavor != null && !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) || flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) { return false; } } return true; }