本文整理匯總了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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}