< prev index next >

src/java.desktop/unix/classes/sun/print/IPPPrintService.java

Print this page




 918                     docList.addAll(Arrays.asList(imagePNG));
 919                     docList.addAll(Arrays.asList(imageGIF));
 920                 }
 921                 supportedDocFlavors = new DocFlavor[docList.size()];
 922                 docList.toArray(supportedDocFlavors);
 923                 int len = supportedDocFlavors.length;
 924                 DocFlavor[] copyflavors = new DocFlavor[len];
 925                 System.arraycopy(supportedDocFlavors, 0, copyflavors, 0, len);
 926                 return copyflavors;
 927             }
 928         }
 929         DocFlavor[] flavor = new DocFlavor[2];
 930         flavor[0] = DocFlavor.SERVICE_FORMATTED.PAGEABLE;
 931         flavor[1] = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
 932         return flavor;
 933     }
 934 
 935 
 936     public boolean isDocFlavorSupported(DocFlavor flavor) {
 937         if (supportedDocFlavors == null) {
 938             getSupportedDocFlavors();
 939         }
 940         if (supportedDocFlavors != null) {
 941             for (int f=0; f<supportedDocFlavors.length; f++) {
 942                 if (flavor.equals(supportedDocFlavors[f])) {
 943                     return true;
 944                 }
 945             }
 946         }
 947         return false;
 948     }
 949 
 950 
 951     /**
 952      * Finds matching CustomMediaSizeName of given media.
 953      */
 954     public CustomMediaSizeName findCustomMedia(MediaSizeName media) {
 955         if (customMediaSizeNames == null) {
 956             return null;
 957         }
 958         for (int i=0; i< customMediaSizeNames.length; i++) {




 918                     docList.addAll(Arrays.asList(imagePNG));
 919                     docList.addAll(Arrays.asList(imageGIF));
 920                 }
 921                 supportedDocFlavors = new DocFlavor[docList.size()];
 922                 docList.toArray(supportedDocFlavors);
 923                 int len = supportedDocFlavors.length;
 924                 DocFlavor[] copyflavors = new DocFlavor[len];
 925                 System.arraycopy(supportedDocFlavors, 0, copyflavors, 0, len);
 926                 return copyflavors;
 927             }
 928         }
 929         DocFlavor[] flavor = new DocFlavor[2];
 930         flavor[0] = DocFlavor.SERVICE_FORMATTED.PAGEABLE;
 931         flavor[1] = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
 932         return flavor;
 933     }
 934 
 935 
 936     public boolean isDocFlavorSupported(DocFlavor flavor) {
 937         if (supportedDocFlavors == null) {
 938             supportedDocFlavors = getSupportedDocFlavors();
 939         }
 940         if (supportedDocFlavors != null) {
 941             for (int f=0; f<supportedDocFlavors.length; f++) {
 942                 if (flavor.equals(supportedDocFlavors[f])) {
 943                     return true;
 944                 }
 945             }
 946         }
 947         return false;
 948     }
 949 
 950 
 951     /**
 952      * Finds matching CustomMediaSizeName of given media.
 953      */
 954     public CustomMediaSizeName findCustomMedia(MediaSizeName media) {
 955         if (customMediaSizeNames == null) {
 956             return null;
 957         }
 958         for (int i=0; i< customMediaSizeNames.length; i++) {


< prev index next >