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


Java MultiDocPrintService类代码示例

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


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

示例1: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
/**
* All printers and printer classes of the CUPS server are checked.
* If flavors or attributes are null the constraint is not used.
*
* @param flavors the document flavors which have to be supported.
* @param attributes the attributes which have to be supported.
*
* @return The multidoc print services of the implementing lookup service
* for the given parameters, or an array of length 0 if none is available.
*/
public MultiDocPrintService[] getMultiDocPrintServices(DocFlavor[] flavors,
    AttributeSet attributes)
{
  ArrayList result = new ArrayList();
  PrintService[] services = getPrintServices();

  for (int i=0; i < services.length; i++)
    {
      if (checkMultiDocPrintService(flavors, attributes, services[i]))
        result.add(services[i]);
    }

  return (MultiDocPrintService[]) result.toArray(
    new MultiDocPrintService[result.size()]);
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:CupsPrintServiceLookup.java

示例2: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
/**
* All printers and printer classes of the CUPS server are checked.
* If flavors or attributes are null the constraint is not used.
* 
* @param flavors the document flavors which have to be supported.
* @param attributes the attributes which have to be supported.
* 
* @return The multidoc print services of the implementing lookup service
* for the given parameters, or an array of length 0 if none is available.
*/
public MultiDocPrintService[] getMultiDocPrintServices(DocFlavor[] flavors,
    AttributeSet attributes)
{
  ArrayList result = new ArrayList();
  PrintService[] services = getPrintServices();   
  
  for (int i=0; i < services.length; i++)
    {
      if (checkMultiDocPrintService(flavors, attributes, services[i]))
        result.add(services[i]);  
    }
  
  return (MultiDocPrintService[]) result.toArray(
    new MultiDocPrintService[result.size()]);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:26,代码来源:CupsPrintServiceLookup.java

示例3: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
public MultiDocPrintService[]
    getMultiDocPrintServices(DocFlavor[] flavors,
                             AttributeSet attributes) {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
      security.checkPrintJobAccess();
    }
    return new MultiDocPrintService[0];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Win32PrintServiceLookup.java

示例4: checkMultiDocPrintService

import javax.print.MultiDocPrintService; //导入依赖的package包/类
/**
 * Checks the given print service - own method so it can be used also
 * to check application registered print services from PrintServiceLookup.
 *
 * @param flavors the document flavors which have to be supported.
 * @param attributes the attributes which have to be supported.
 * @param service the service to check
 *
 * @return <code>true</code> if all constraints match, <code>false</code>
 * otherwise.
 */
public boolean checkMultiDocPrintService(DocFlavor[] flavors,
  AttributeSet attributes, PrintService service)
{
  if (service instanceof MultiDocPrintService)
    {
      boolean allFlavorsSupported = true;
      boolean allAttributesSupported = true;

      if (flavors == null || flavors.length != 0)
        allFlavorsSupported = true;
      else
        {
          for (int k = 0; k < flavors.length; k++)
            {
              if (! service.isDocFlavorSupported(flavors[k]))
                {
                  allFlavorsSupported = false;
                  break;
                }
            }
        }

      if (attributes == null || attributes.size() == 0)
        allAttributesSupported = true;
      else
        {
          Attribute[] atts = attributes.toArray();
          for (int j = 0; j < atts.length; j++)
            {
              if (! service.isAttributeCategorySupported(
                  atts[j].getCategory()))
                {
                  allAttributesSupported = false;
                  break;
                }
            }
        }

      if (allAttributesSupported && allFlavorsSupported)
        return true;
    }

  return false;
}
 
开发者ID:vilie,项目名称:javify,代码行数:56,代码来源:CupsPrintServiceLookup.java

示例5: checkMultiDocPrintService

import javax.print.MultiDocPrintService; //导入依赖的package包/类
/**
 * Checks the given print service - own method so it can be used also
 * to check application registered print services from PrintServiceLookup.
 * 
 * @param flavors the document flavors which have to be supported.
 * @param attributes the attributes which have to be supported.
 * @param service the service to check
 * 
 * @return <code>true</code> if all constraints match, <code>false</code> 
 * otherwise.
 */
public boolean checkMultiDocPrintService(DocFlavor[] flavors, 
  AttributeSet attributes, PrintService service)
{    
  if (service instanceof MultiDocPrintService)
    { 
      boolean allFlavorsSupported = true;
      boolean allAttributesSupported = true;
      
      if (flavors == null || flavors.length != 0)
        allFlavorsSupported = true;
      else
        {
          for (int k = 0; k < flavors.length; k++)
            {
              if (! service.isDocFlavorSupported(flavors[k]))
                {
                  allFlavorsSupported = false;
                  break;
                }
            }
        }
      
      if (attributes == null || attributes.size() == 0)
        allAttributesSupported = true;
      else
        {
          Attribute[] atts = attributes.toArray();
          for (int j = 0; j < atts.length; j++)
            {
              if (! service.isAttributeCategorySupported(
                  atts[j].getCategory()))
                {
                  allAttributesSupported = false;
                  break;
                }
            }
        }
      
      if (allAttributesSupported && allFlavorsSupported)
        return true;
    }     
  
  return false;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:56,代码来源:CupsPrintServiceLookup.java

示例6: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
@Override
public MultiDocPrintService[] getMultiDocPrintServices(
                final DocFlavor[] flavors, final AttributeSet attributes) {
    return new MultiDocPrintService[0];
}
 
开发者ID:shannah,项目名称:cn1,代码行数:6,代码来源:WinPrintServiceLookup.java

示例7: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
public MultiDocPrintService[] getMultiDocPrintServices(DocFlavor[] flavors,
        AttributeSet attributes) {
    // No multidoc print services available.
    return new MultiDocPrintService[0];
}
 
开发者ID:shannah,项目名称:cn1,代码行数:6,代码来源:Win32PrintServiceProvider.java

示例8: getMultiDocPrintServices

import javax.print.MultiDocPrintService; //导入依赖的package包/类
public MultiDocPrintService[] getMultiDocPrintServices(DocFlavor[] flavors,
        AttributeSet attributes) {
    // No multidoc print services available, yet.
    return new MultiDocPrintService[0];
}
 
开发者ID:shannah,项目名称:cn1,代码行数:6,代码来源:CUPSPrintServiceProvider.java


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