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


Java PageFormat.getOrientation方法代码示例

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


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

示例1: setPageFormat

import java.awt.print.PageFormat; //导入方法依赖的package包/类
public void setPageFormat(PageFormat pageFormat) {
	this.pageFormat = pageFormat;
	remove(landscapePanel);
	remove(portraitPanel);
	add(landscapePanel, Orientation.LANDSCAPE.toString());
	add(portraitPanel, Orientation.PORTRAIT.toString());
	if (pageFormat.getOrientation() == PageFormat.LANDSCAPE) {
		cardLayout.show(this, Orientation.LANDSCAPE.toString());
	} else {
		cardLayout.show(this, Orientation.PORTRAIT.toString());
	}
	repaint();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:PrintPreviewPanel.java

示例2: setPageFormat

import java.awt.print.PageFormat; //导入方法依赖的package包/类
public static void setPageFormat(String name, PageFormat pageFormat) {
    Properties properties = getProperties(name);
    switch (pageFormat.getOrientation()) {
        case PageFormat.LANDSCAPE:
            properties.setProperty(ORIENTATION, LANDSCAPE);
            break;
        case PageFormat.PORTRAIT:
            properties.setProperty(ORIENTATION, PORTRAIT);
            break;
        case PageFormat.REVERSE_LANDSCAPE:
            properties.setProperty(ORIENTATION, REVERSE_LANDSCAPE);
            break;
        default:
            properties.setProperty(ORIENTATION, "EMPTY");
    }
    ;
    final Paper paper = pageFormat.getPaper();
    properties.setProperty(PAPER_IMAGEABLE_HEIGHT, Double.toString(paper
            .getImageableHeight()));
    properties.setProperty(PAPER_IMAGEABLE_WIDTH, Double.toString(paper
            .getImageableWidth()));
    properties.setProperty(PAPER_IMAGEABLE_X, Double.toString(paper
            .getImageableX()));
    properties.setProperty(PAPER_IMAGEABLE_Y, Double.toString(paper
            .getImageableY()));
    properties
            .setProperty(PAPER_HEIGHT, Double.toString(paper.getHeight()));
    properties.setProperty(PAPER_WIDTH, Double.toString(paper.getWidth()));
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:30,代码来源:Options.java

示例3: setSize

import java.awt.print.PageFormat; //导入方法依赖的package包/类
private void setSize() {
     int pageCount = printable.getPageCount();
     rowCount = (pageCount - 1) / columnCount + 1;
     pageWidth = 0;
     pageHeight = 0;
     pages = new Page[pageCount];
     PageFormat pageFormat = printable.getPageFormat();
     for (int i = 0; i < pageCount; i++) {
         pageFormat = printable.getPageFormat(pageFormat, i);
         double w = pageFormat.getWidth() + 1;
         double h = pageFormat.getHeight() + 1;
         double iW = pageFormat.getImageableWidth();
         double iH = pageFormat.getImageableHeight();
         double x = pageFormat.getImageableX();
         double y = pageFormat.getImageableY();

         reverce = (pageFormat.getOrientation() == PageFormat.REVERSE_LANDSCAPE);

/*
          * if (pageFormat.getOrientation() == PageFormat.LANDSCAPE) { double
 * t;
 * 
 * t = w; w = h; h = t;
 * 
 * t = iW; iW = iH; iH = t;
 * 
 * t = x; x = y; y = t; }
 */

         Page page = new Page(w, h, x, y, iW, iH);

         if (pageWidth < w)
             pageWidth = w;
         if (pageHeight < h)
             pageHeight = h;
         pages[i] = page;
     }
     width = (columnCount - 1) * (pageWidth + W_SPACE / zoom) + pageWidth;
     height = rowCount * (pageHeight + W_SPACE / zoom);
     Dimension size = new Dimension((int) (width * getZoom()),
             (int) (height * getZoom()));
     this.setSize(size);
     this.setPreferredSize(size);
 }
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:45,代码来源:PrintPreviewComponent.java


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