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


Java OrientationRequested.REVERSE_LANDSCAPE属性代码示例

本文整理汇总了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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:PrinterConfiguration.java

示例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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:PSStreamPrintJob.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:UnixPrintJob.java

示例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;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:14,代码来源:WPrinterJob.java

示例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 };
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:WinPrinterFactory.java

示例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;
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:ServiceUIDialog.java


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