本文整理汇总了Java中javax.print.attribute.standard.Sides.TUMBLE属性的典型用法代码示例。如果您正苦于以下问题:Java Sides.TUMBLE属性的具体用法?Java Sides.TUMBLE怎么用?Java Sides.TUMBLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.print.attribute.standard.Sides
的用法示例。
在下文中一共展示了Sides.TUMBLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assignSides
public Sides assignSides(String sidesString) {
Sides answer;
if (sidesString == null) {
// default to one side if no slides configured
answer = Sides.ONE_SIDED;
} else if (sidesString.equalsIgnoreCase("one-sided")) {
answer = Sides.ONE_SIDED;
} else if (sidesString.equalsIgnoreCase("duplex")) {
answer = Sides.DUPLEX;
} else if (sidesString.equalsIgnoreCase("tumble")) {
answer = Sides.TUMBLE;
} else if (sidesString.equalsIgnoreCase("two-sided-short-edge")) {
answer = Sides.TWO_SIDED_SHORT_EDGE;
} else if (sidesString.equalsIgnoreCase("two-sided-long-edge")) {
answer = Sides.TWO_SIDED_LONG_EDGE;
} else {
answer = Sides.ONE_SIDED;
}
return answer;
}
示例2: getSelectedSide
private Sides getSelectedSide() {
if (oneSideBtn.isSelected()) {
return Sides.ONE_SIDED;
} else if (duplexBtn.isSelected()) {
return Sides.DUPLEX;
} else if (tumbleBtn.isSelected()) {
return Sides.TUMBLE;
} else {
return null;
}
}
示例3: getSupportedAttributeValues
public Object getSupportedAttributeValues(Class category, DocFlavor flavor,
AttributeSet attributes) {
if (flavor != null &&
(flavor.equals(DocFlavor.INPUT_STREAM.AUTOSENSE) ||
flavor.equals(DocFlavor.BYTE_ARRAY.AUTOSENSE) ||
flavor.equals(DocFlavor.URL.AUTOSENSE) ||
flavor.equals(DocFlavor.INPUT_STREAM.POSTSCRIPT) ||
flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT) ||
flavor.equals(DocFlavor.URL.POSTSCRIPT))) {
return null;
}
if (category.equals(Copies.class)) {
int copies = getCopiesSupported(serviceName);
if (copies == 1) {
return new CopiesSupported(1);
} else if (copies > 1) {
return new CopiesSupported(1, copies);
}
} else if (category.equals(Sides.class)) {
if (getSidesSupported(serviceName)) {
return new Sides[] {Sides.ONE_SIDED,
Sides.TWO_SIDED_SHORT_EDGE,
Sides.TWO_SIDED_LONG_EDGE,
Sides.DUPLEX,
Sides.TUMBLE};
}
} else if (category.equals(Media.class)) {
return getSupportedMediaSizeNames();
} else if (category.equals(MediaSizeName.class)) {
return getSupportedMediaSizeNames();
} else if (category.equals(Chromaticity.class)) {
if (getColorSupported(serviceName)) {
return new Chromaticity[] { Chromaticity.MONOCHROME,
Chromaticity.COLOR };
} else {
return new Chromaticity[] { Chromaticity.MONOCHROME };
}
} else if (category.equals(OrientationRequested.class)) {
if (getOrientationSupported(serviceName)) {
return new OrientationRequested[]
{ OrientationRequested.PORTRAIT,
OrientationRequested.LANDSCAPE };
}
} else if (category.equals(PrinterResolution.class)) {
int[] resolutions = getResolutionsSupported(serviceName);
if (resolutions != null && resolutions.length > 1) {
PrinterResolution[] res =
new PrinterResolution[resolutions.length / 2];
for (int i = 0; i < resolutions.length / 2; i++) {
res[i] = new PrinterResolution(resolutions[i * 2],
resolutions[i * 2 + 1], PrinterResolution.DPI);
}
return res;
}
} else if (category.equals(SheetCollate.class)) {
if (getCollateSupported(serviceName)) {
return new SheetCollate[] { SheetCollate.COLLATED,
SheetCollate.UNCOLLATED };
}
}
return null;
}