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


Java PrinterResolution.getFeedResolution方法代码示例

本文整理汇总了Java中javax.print.attribute.standard.PrinterResolution.getFeedResolution方法的典型用法代码示例。如果您正苦于以下问题:Java PrinterResolution.getFeedResolution方法的具体用法?Java PrinterResolution.getFeedResolution怎么用?Java PrinterResolution.getFeedResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.print.attribute.standard.PrinterResolution的用法示例。


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

示例1: generateResolutionTitle

import javax.print.attribute.standard.PrinterResolution; //导入方法依赖的package包/类
private static String generateResolutionTitle(PrinterResolution res) {
	StringBuilder buffer = new StringBuilder();
	int x = res.getCrossFeedResolution(ResolutionSyntax.DPI);
	int y = res.getFeedResolution(ResolutionSyntax.DPI);

	buffer.append(Integer.toString(x));
	if (x != y) {
		buffer.append(" x "); //$NON-NLS-1$
		buffer.append(Integer.toString(y));
	}
	buffer.append(DPI);
	return buffer.toString();
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:14,代码来源:PageSetupPanel.java

示例2: createResolutionString

import javax.print.attribute.standard.PrinterResolution; //导入方法依赖的package包/类
private static String createResolutionString(PrinterResolution res) {
	if (res != null) {
		StringBuilder buffer = new StringBuilder();
		int x = res.getCrossFeedResolution(1);
		int y = res.getFeedResolution(1);
		buffer.append(Integer.toString(x));
		if (x != y) {
			buffer.append("x"); //$NON-NLS-1$
			buffer.append(Integer.toString(y));
		}
		return buffer.toString();
	}
	return null;
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:15,代码来源:PrintManager.java

示例3: setResolutionAttrib

import javax.print.attribute.standard.PrinterResolution; //导入方法依赖的package包/类
private void setResolutionAttrib(Attribute attr) {
    PrinterResolution pr = (PrinterResolution)attr;
    mAttXRes = pr.getCrossFeedResolution(PrinterResolution.DPI);
    mAttYRes = pr.getFeedResolution(PrinterResolution.DPI);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:WPrinterJob.java

示例4: convertAttributes

import javax.print.attribute.standard.PrinterResolution; //导入方法依赖的package包/类
int[] convertAttributes(PrintRequestAttributeSet attrs, DocFlavor flavor)
        throws PrintException {
    PrintRequestAttributeSet attributes = null;
    if (attrs == null ||
        flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) ||
        flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) ||
        flavor.equals(DocFlavor.URL.AUTOSENSE)) {
        int[] defaultValues = {-1, -1, -1, -1, -1, -1, -1, -1}; 
        return defaultValues;
    } else {
        attributes = attrs;
    }
    Attribute[] requestAttrs = attributes.toArray();
    int[] printAttributes = new int[ATTRIBUTES_ARRAY_SIZE];
    Arrays.fill(printAttributes, -1);
    for (int i = 0; i < requestAttrs.length; i++) {
        Class category = requestAttrs[i].getCategory();
        if (!isAttributeValueSupported(requestAttrs[i], flavor, attrs)) {
            // Do nothing or throw PrintException if Fidelity supported.
        } else if (category.equals(Copies.class)) {
            Copies copies = (Copies)requestAttrs[i];
            printAttributes[COPIES_INDEX] = copies.getValue();
        } else if (category.equals(Sides.class)) {
            Sides sides = (Sides)requestAttrs[i];
            printAttributes[SIDES_INDEX] = 1;
            if (sides.equals(Sides.DUPLEX) ||
                sides.equals(Sides.TWO_SIDED_LONG_EDGE)) {
                printAttributes[SIDES_INDEX] = 2;
            } else if (sides.equals(Sides.TUMBLE) ||
                       sides.equals(Sides.TWO_SIDED_SHORT_EDGE)) {
                printAttributes[SIDES_INDEX] = 3;
            }
        } else if (category.equals(Media.class)) {
            if (medias.containsKey(requestAttrs[i])) {
                Integer id = (Integer)medias.get(requestAttrs[i]);
                printAttributes[PAPER_ID_INDEX] = id.intValue();
            }
        } else if (category.equals(Chromaticity.class)) {
            if (requestAttrs[i].equals(Chromaticity.MONOCHROME)) {
                printAttributes[CHROMATICITY_INDEX] = 1;
            } else if (requestAttrs[i].equals(Chromaticity.COLOR)) {
                printAttributes[CHROMATICITY_INDEX] = 2;
            }
        } else if (category.equals(OrientationRequested.class)) {
            if (requestAttrs[i].equals(OrientationRequested.PORTRAIT)) {
                printAttributes[ORIENTATION_INDEX] = 1;
            } else
              if (requestAttrs[i].equals(OrientationRequested.LANDSCAPE)) {
                printAttributes[ORIENTATION_INDEX] = 2;
            }
        } else if (category.equals(PrinterResolution.class)) {
            PrinterResolution res = (PrinterResolution)requestAttrs[i];
            int xres = res.getCrossFeedResolution(PrinterResolution.DPI);
            int yres = res.getFeedResolution(PrinterResolution.DPI);
            printAttributes[XRESOLUTION_INDEX] = xres;
            printAttributes[YRESOLUTION_INDEX] = yres;
        } else if (category.equals(SheetCollate.class)) {
            SheetCollate collate = (SheetCollate)requestAttrs[i];
            if (collate == SheetCollate.COLLATED) {
                printAttributes[COLLATE_INDEX] = 1;
            } else if (collate == SheetCollate.UNCOLLATED) {
                printAttributes[COLLATE_INDEX] = 0;
            }
        }
    }
    return printAttributes;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:68,代码来源:GDIClient.java


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