当前位置: 首页>>代码示例>>Java>>正文


Java DocFlavor.equals方法代码示例

本文整理汇总了Java中javax.print.DocFlavor.equals方法的典型用法代码示例。如果您正苦于以下问题:Java DocFlavor.equals方法的具体用法?Java DocFlavor.equals怎么用?Java DocFlavor.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.print.DocFlavor的用法示例。


在下文中一共展示了DocFlavor.equals方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isDocFlavorSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Win32PrintService.java

示例2: isPostScriptFlavor

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:Win32PrintService.java

示例3: isMember

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:StreamPrintServiceFactory.java

示例4: isDocFlavorSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:PSStreamPrintService.java

示例5: isAutoSense

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:Win32PrintService.java

示例6: isServiceFormattedFlavor

import javax.print.DocFlavor; //导入方法依赖的package包/类
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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:UnixPrintService.java

示例7: isDocFlavorSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:IPPPrintService.java

示例8: isDocFlavorSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
@Override
public boolean isDocFlavorSupported(DocFlavor flavor){
    for (int f=0; f<supportedFlavors.length; f++) {
        if (flavor.equals(supportedFlavors[f])) {
            return true;
        }
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Win32PrintService.java

示例9: isDocFlavorSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:UnixPrintService.java

示例10: isDestinationSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:IPPPrintService.java

示例11: isAttributeValueSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
public boolean isAttributeValueSupported(Attribute attr,
                                         DocFlavor flavor,
                                         AttributeSet attributes) {
    if (attr == null) {
        throw new NullPointerException("null attribute");
    }
    if (flavor != null && !isDocFlavorSupported(flavor)) {
        throw new IllegalArgumentException(flavor +
                                           " is an unsupported flavor");
    }
    Class<? extends Attribute> category = attr.getCategory();
    if (!isAttributeCategorySupported(category)) {
        return false;
    }
    else if (attr.getCategory() == Chromaticity.class) {
        return attr == Chromaticity.COLOR;
    }
    else if (attr.getCategory() == Copies.class) {
        return isSupportedCopies((Copies)attr);
    } else if (attr.getCategory() == Media.class &&
               attr instanceof MediaSizeName) {
        return isSupportedMedia((MediaSizeName)attr);
    } else if (attr.getCategory() == OrientationRequested.class) {
        if (attr == OrientationRequested.REVERSE_PORTRAIT ||
            (flavor != null) &&
            !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
            flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) {
            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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:51,代码来源:PSStreamPrintService.java

示例12: isAttributeValueSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
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<? extends Attribute> 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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:73,代码来源:UnixPrintService.java

示例13: isAttributeValueSupported

import javax.print.DocFlavor; //导入方法依赖的package包/类
public boolean isAttributeValueSupported(Attribute attr,
                                         DocFlavor flavor,
                                         AttributeSet attributes) {
    if (attr == null) {
        throw new NullPointerException("null attribute");
    }
    if (flavor != null && !isDocFlavorSupported(flavor)) {
        throw new IllegalArgumentException(flavor +
                                           " is an unsupported flavor");
    }
    Class category = attr.getCategory();
    if (!isAttributeCategorySupported(category)) {
        return false;
    }
    else if (attr.getCategory() == Chromaticity.class) {
        return attr == Chromaticity.COLOR;
    }
    else if (attr.getCategory() == Copies.class) {
        return isSupportedCopies((Copies)attr);
    } else if (attr.getCategory() == Media.class &&
               attr instanceof MediaSizeName) {
        return isSupportedMedia((MediaSizeName)attr);
    } else if (attr.getCategory() == OrientationRequested.class) {
        if (attr == OrientationRequested.REVERSE_PORTRAIT ||
            (flavor != null) &&
            !(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
            flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) {
            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;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:51,代码来源:PSStreamPrintService.java


注:本文中的javax.print.DocFlavor.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。