Java 类javax.print.attribute.standard.ColorSupported 实例源码

项目:OpenJSharp    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:OpenJSharp    文件:Win32PrintService.java   
@Override
public <T extends PrintServiceAttribute>T getAttribute(Class<T> category){
    if(category == null){
        throw new NullPointerException("category");
    }
    if(!(PrintServiceAttribute.class.isAssignableFrom(category))){
        throw new IllegalArgumentException("The categhory '" + category + "' is not a valid PrintServiceAttribute");
    }
    if(category == ColorSupported.class){
        // works better than settings.get_SupportsColor();
        if(settings.get_DefaultPageSettings().get_Color()){
            return (T)ColorSupported.SUPPORTED;
        }else{
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    }else if(category == PrinterName.class){
        return (T)getPrinterName();
    } else {
        // QueuedJobCount and PrinterIsAcceptingJobs
        return (T)peer.getPrinterStatus(printer, category);
    }
}
项目:jdk8u-jdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:openjdk-jdk10    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        @SuppressWarnings("unchecked")
        T tmp = (T)ColorSupported.SUPPORTED;
        return tmp;
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:openjdk9    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        @SuppressWarnings("unchecked")
        T tmp = (T)ColorSupported.SUPPORTED;
        return tmp;
    } else {
        return null;
    }
}
项目:openjdk9    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:jdk8u_jdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:lookaside_java-1.8.0-openjdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:infobip-open-jdk-8    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:jdk8u-dev-jdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:jdk7-jdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:openjdk-source-code-learn    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:OLD-OpenJDK8    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:cn1    文件:AttributeSetUtilitiesTest.java   
public final void testUnmodifiableView() {

        AttributeSet aset = new HashAttributeSet();
        aset = AttributeSetUtilities.unmodifiableView(aset);
        try {
            aset.add(ColorSupported.SUPPORTED);
            aset.addAll(aset);
            aset.clear();
            aset.remove(ColorSupported.NOT_SUPPORTED);
            aset.remove(ColorSupported.class);
            fail("method doesn't throw UnmodifiableSetException if someone" +
                    "try to modify attribute set");
        } catch (Exception e) {
            //System.out.println("testUnmodifiableView - " + e.toString());
        }
    }
项目:openjdk-jdk7u-jdk    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:freeVM    文件:AttributeSetUtilitiesTest.java   
public final void testUnmodifiableView() {

        AttributeSet aset = new HashAttributeSet();
        aset = AttributeSetUtilities.unmodifiableView(aset);
        try {
            aset.add(ColorSupported.SUPPORTED);
            aset.addAll(aset);
            aset.clear();
            aset.remove(ColorSupported.NOT_SUPPORTED);
            aset.remove(ColorSupported.class);
            fail("method doesn't throw UnmodifiableSetException if someone" +
                    "try to modify attribute set");
        } catch (Exception e) {
            //System.out.println("testUnmodifiableView - " + e.toString());
        }
    }
项目:freeVM    文件:AttributeSetUtilitiesTest.java   
public final void testUnmodifiableView() {

        AttributeSet aset = new HashAttributeSet();
        aset = AttributeSetUtilities.unmodifiableView(aset);
        try {
            aset.add(ColorSupported.SUPPORTED);
            aset.addAll(aset);
            aset.clear();
            aset.remove(ColorSupported.NOT_SUPPORTED);
            aset.remove(ColorSupported.class);
            fail("method doesn't throw UnmodifiableSetException if someone" +
                    "try to modify attribute set");
        } catch (Exception e) {
            //System.out.println("testUnmodifiableView - " + e.toString());
        }
    }
项目:openjdk-icedtea7    文件:Win32PrintService.java   
public PrintServiceAttributeSet getAttributes() {

        PrintServiceAttributeSet attrs = new  HashPrintServiceAttributeSet();
        attrs.add(getPrinterName());
        attrs.add(getPrinterIsAcceptingJobs());
        PrinterState prnState = getPrinterState();
        if (prnState != null) {
            attrs.add(prnState);
        }
        PrinterStateReasons prnStateReasons = getPrinterStateReasons();
        if (prnStateReasons != null) {
            attrs.add(prnStateReasons);
        }
        attrs.add(getQueuedJobCount());
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            attrs.add(ColorSupported.SUPPORTED);
        } else {
            attrs.add(ColorSupported.NOT_SUPPORTED);
        }

        return AttributeSetUtilities.unmodifiableView(attrs);
    }
项目:OpenJSharp    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:OpenJSharp    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:OpenJSharp    文件:Win32PrintService.java   
@Override
public PrintServiceAttributeSet getAttributes(){
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getPrinterName());
    PrinterIsAcceptingJobs acptJobs = getAttribute(PrinterIsAcceptingJobs.class);
    if(acptJobs != null){
        attrs.add(acptJobs);
    }
    PrinterState prnState = getAttribute(PrinterState.class);
    if(prnState != null){
        attrs.add(prnState);
    }
    PrinterStateReasons prnStateReasons = getAttribute(PrinterStateReasons.class);
    if(prnStateReasons != null){
        attrs.add(prnStateReasons);
    }
    QueuedJobCount jobCount = getAttribute(QueuedJobCount.class);
    if(jobCount != null){
        attrs.add(jobCount);
    }
    // TODO: Seems to be more accurate than settings.get_SupportsColor(), which doesn't work for CutePDF
    if(settings.get_DefaultPageSettings().get_Color()){
        attrs.add(ColorSupported.SUPPORTED);
    }else{
        attrs.add(ColorSupported.NOT_SUPPORTED);
    }

    return AttributeSetUtilities.unmodifiableView(attrs);
}
项目:jdk8u-jdk    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件:Win32PrintService.java   
@SuppressWarnings("unchecked")
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk9    文件:Win32PrintService.java   
@SuppressWarnings("unchecked")
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:infobip-open-jdk-8    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:infobip-open-jdk-8    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:jdk7-jdk    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:jdk7-jdk    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:openjdk-source-code-learn    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:openjdk-source-code-learn    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:PSStreamPrintService.java   
public <T extends PrintServiceAttribute>
    T getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        return (T)ColorSupported.SUPPORTED;
    } else {
        return null;
    }
}
项目:OLD-OpenJDK8    文件:Win32PrintService.java   
public <T extends PrintServiceAttribute> T
    getAttribute(Class<T> category)
{
    if (category == null) {
        throw new NullPointerException("category");
    }
    if (!(PrintServiceAttribute.class.isAssignableFrom(category))) {
        throw new IllegalArgumentException("Not a PrintServiceAttribute");
    }
    if (category == ColorSupported.class) {
        int caps = getPrinterCapabilities();
        if ((caps & DEVCAP_COLOR) != 0) {
            return (T)ColorSupported.SUPPORTED;
        } else {
            return (T)ColorSupported.NOT_SUPPORTED;
        }
    } else if (category == PrinterName.class) {
        return (T)getPrinterName();
    } else if (category == PrinterState.class) {
        return (T)getPrinterState();
    } else if (category == PrinterStateReasons.class) {
        return (T)getPrinterStateReasons();
    } else if (category == QueuedJobCount.class) {
        return (T)getQueuedJobCount();
    } else if (category == PrinterIsAcceptingJobs.class) {
        return (T)getPrinterIsAcceptingJobs();
    } else {
        return null;
    }
}