本文整理汇总了Java中javax.print.attribute.AttributeSet.size方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeSet.size方法的具体用法?Java AttributeSet.size怎么用?Java AttributeSet.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.print.attribute.AttributeSet
的用法示例。
在下文中一共展示了AttributeSet.size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPrintService
import javax.print.attribute.AttributeSet; //导入方法依赖的package包/类
/**
* Checks the given print service - own method so it can be used also
* to check application registered print services from PrintServiceLookup.
*
* @param flavor the document flavor which has 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 checkPrintService(DocFlavor flavor, AttributeSet attributes,
PrintService service)
{
boolean allAttributesSupported = true;
if (flavor == null || service.isDocFlavorSupported(flavor))
{
if (attributes == null || attributes.size() == 0)
return allAttributesSupported;
Attribute[] atts = attributes.toArray();
for (int i = 0; i < atts.length; i++)
{
if (! service.isAttributeCategorySupported(atts[i].getCategory()))
{
allAttributesSupported = false;
break;
}
}
return allAttributesSupported;
}
return false;
}
示例2: checkPrintService
import javax.print.attribute.AttributeSet; //导入方法依赖的package包/类
/**
* Checks the given print service - own method so it can be used also
* to check application registered print services from PrintServiceLookup.
*
* @param flavor the document flavor which has 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 checkPrintService(DocFlavor flavor, AttributeSet attributes,
PrintService service)
{
boolean allAttributesSupported = true;
if (flavor == null || service.isDocFlavorSupported(flavor))
{
if (attributes == null || attributes.size() == 0)
return allAttributesSupported;
Attribute[] atts = attributes.toArray();
for (int i = 0; i < atts.length; i++)
{
if (! service.isAttributeCategorySupported(atts[i].getCategory()))
{
allAttributesSupported = false;
break;
}
}
return allAttributesSupported;
}
return false;
}
示例3: getUnsupportedAttributes
import javax.print.attribute.AttributeSet; //导入方法依赖的package包/类
public AttributeSet getUnsupportedAttributes(final DocFlavor flavor,
final AttributeSet attributes) {
checkFlavor(flavor);
if (attributes == null) {
return null;
}
final AttributeSet result = new HashAttributeSet();
for (Attribute attr : attributes.toArray()) {
if (!isAttributeValueSupported(attr, flavor, attributes)) {
result.add(attr);
}
}
return result.size() > 0 ? result : null;
}
示例4: checkMultiDocPrintService
import javax.print.attribute.AttributeSet; //导入方法依赖的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;
}
示例5: checkMultiDocPrintService
import javax.print.attribute.AttributeSet; //导入方法依赖的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;
}