本文整理汇总了Java中javax.print.attribute.standard.OrientationRequested.REVERSE_LANDSCAPE属性的典型用法代码示例。如果您正苦于以下问题:Java OrientationRequested.REVERSE_LANDSCAPE属性的具体用法?Java OrientationRequested.REVERSE_LANDSCAPE怎么用?Java OrientationRequested.REVERSE_LANDSCAPE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.print.attribute.standard.OrientationRequested
的用法示例。
在下文中一共展示了OrientationRequested.REVERSE_LANDSCAPE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assignOrientation
public OrientationRequested assignOrientation(final String orientation) {
OrientationRequested answer;
if (orientation == null) {
// default to portrait
answer = OrientationRequested.PORTRAIT;
} else if (orientation.equalsIgnoreCase("portrait")) {
answer = OrientationRequested.PORTRAIT;
} else if (orientation.equalsIgnoreCase("landscape")) {
answer = OrientationRequested.LANDSCAPE;
} else if (orientation.equalsIgnoreCase("reverse-portrait")) {
answer = OrientationRequested.REVERSE_PORTRAIT;
} else if (orientation.equalsIgnoreCase("reverse-landscape")) {
answer = OrientationRequested.REVERSE_LANDSCAPE;
} else {
answer = OrientationRequested.PORTRAIT;
}
return answer;
}
示例2: printableJob
public void printableJob(Printable printable,
PrintRequestAttributeSet attributes)
throws PrintException {
try {
synchronized(this) {
if (job != null) { // shouldn't happen
throw new PrintException("already printing");
} else {
job = new PSPrinterJob();
}
}
job.setPrintService(getPrintService());
PageFormat pf = new PageFormat();
if (mediaSize != null) {
Paper p = new Paper();
p.setSize(mediaSize.getX(MediaSize.INCH)*72.0,
mediaSize.getY(MediaSize.INCH)*72.0);
p.setImageableArea(72.0, 72.0, p.getWidth()-144.0,
p.getHeight()-144.0);
pf.setPaper(p);
}
if (orient == OrientationRequested.REVERSE_LANDSCAPE) {
pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
} else if (orient == OrientationRequested.LANDSCAPE) {
pf.setOrientation(PageFormat.LANDSCAPE);
}
job.setPrintable(printable, pf);
job.print(attributes);
notifyEvent(PrintJobEvent.JOB_COMPLETE);
return;
} catch (PrinterException pe) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintException(pe);
} finally {
printReturned = true;
}
}
示例3: printableJob
public void printableJob(Printable printable) throws PrintException {
try {
synchronized(this) {
if (job != null) { // shouldn't happen
throw new PrintException("already printing");
} else {
job = new PSPrinterJob();
}
}
job.setPrintService(getPrintService());
job.setCopies(copies);
job.setJobName(jobName);
PageFormat pf = new PageFormat();
if (mediaSize != null) {
Paper p = new Paper();
p.setSize(mediaSize.getX(MediaSize.INCH)*72.0,
mediaSize.getY(MediaSize.INCH)*72.0);
p.setImageableArea(72.0, 72.0, p.getWidth()-144.0,
p.getHeight()-144.0);
pf.setPaper(p);
}
if (orient == OrientationRequested.REVERSE_LANDSCAPE) {
pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
} else if (orient == OrientationRequested.LANDSCAPE) {
pf.setOrientation(PageFormat.LANDSCAPE);
}
job.setPrintable(printable, pf);
job.print(reqAttrSet);
notifyEvent(PrintJobEvent.DATA_TRANSFER_COMPLETE);
return;
} catch (PrinterException pe) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintException(pe);
} finally {
printReturned = true;
notifyEvent(PrintJobEvent.NO_MORE_EVENTS);
}
}
示例4: getOrientAttrib
private final int getOrientAttrib() {
int orient = PageFormat.PORTRAIT;
OrientationRequested orientReq = (attributes == null) ? null :
(OrientationRequested)attributes.get(OrientationRequested.class);
if (orientReq != null) {
if (orientReq == OrientationRequested.REVERSE_LANDSCAPE) {
orient = PageFormat.REVERSE_LANDSCAPE;
} else if (orientReq == OrientationRequested.LANDSCAPE) {
orient = PageFormat.LANDSCAPE;
}
}
return orient;
}
示例5: getSupportedOrientations
public static OrientationRequested[] getSupportedOrientations(
final long handle) throws PrintException {
if (getLandscapeOrientationDegree(handle) == 270) {
return new OrientationRequested[] { OrientationRequested.PORTRAIT,
OrientationRequested.REVERSE_LANDSCAPE };
}
return new OrientationRequested[] { OrientationRequested.PORTRAIT,
OrientationRequested.LANDSCAPE };
}
示例6: getOrient
OrientationRequested getOrient() {
if (portraitBtn.isSelected()) {
return OrientationRequested.PORTRAIT;
} else if (landscapeBtn.isSelected()) {
return OrientationRequested.LANDSCAPE;
} else if (rvportraitBtn.isSelected()) {
return OrientationRequested.REVERSE_PORTRAIT;
} else if (rvlandscapeBtn.isSelected()) {
return OrientationRequested.REVERSE_LANDSCAPE;
} else {
return null;
}
}