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


Java MediaPrintableArea.INCH属性代码示例

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


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

示例1: getDefaultPrintableArea

protected MediaPrintableArea getDefaultPrintableArea(PageFormat page,
        double w, double h) {
    double ix, iw, iy, ih;
        if (w >= 72.0 * 6.0) {
            ix = 72.0;
            iw = w - 2 * 72.0;
        } else {
            ix = w / 6.0;
            iw = w * 0.75;
        }
        if (h >= 72.0 * 6.0) {
            iy = 72.0;
            ih = h - 2 * 72.0;
        } else {
            iy = h / 6.0;
            ih = h * 0.75;
        }

    return new MediaPrintableArea((float) (ix / DPI), (float) (iy / DPI),
            (float) (iw / DPI), (float) (ih / DPI), MediaPrintableArea.INCH);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:RasterPrinterJob.java

示例2: getDefaultPrintableArea

protected MediaPrintableArea getDefaultPrintableArea(PageFormat page,
        double w, double h) {
    double ix, iw, iy, ih;
    if (w >= 72.0 * 6.0) {
        ix = 72.0;
        iw = w - 2 * 72.0;
    } else {
        ix = w / 6.0;
        iw = w * 0.75;
    }
    if (h >= 72.0 * 6.0) {
        iy = 72.0;
        ih = h - 2 * 72.0;
    } else {
        iy = h / 6.0;
        ih = h * 0.75;
    }

    return new MediaPrintableArea((float) (ix / DPI), (float) (iy / DPI),
            (float) (iw / DPI), (float) (ih / DPI), MediaPrintableArea.INCH);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:RasterPrinterJob.java

示例3: isSupportedMediaPrintableArea

private boolean isSupportedMediaPrintableArea(MediaPrintableArea mpa) {

        getMediaPrintables(null);
        int units = MediaPrintableArea.INCH;

        if (mediaPrintables != null) {
            for (int i=0; i<mediaPrintables.length; i++) {
                if ((mpa.getX(units) >= mediaPrintables[i].getX(units)) &&
                    (mpa.getY(units) >= mediaPrintables[i].getY(units)) &&
                    (mpa.getX(units) + mpa.getWidth(units) <=
                            mediaPrintables[i].getX(units) +
                            mediaPrintables[i].getWidth(units)) &&
                    (mpa.getY(units) + mpa.getHeight(units) <=
                            mediaPrintables[i].getY(units) +
                            mediaPrintables[i].getHeight(units))) {
                    return true;
                }
            }
        }
        return false;
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:Win32PrintService.java

示例4: getDefaultPrintableArea

@Override
protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w, double h) {
    final float dpi = 72.0f;
    Paper paper = page.getPaper();
    return new MediaPrintableArea(
            (float) (paper.getImageableX() / dpi),
            (float) (paper.getImageableY() / dpi),
            (float) (paper.getImageableWidth() / dpi),
            (float) (paper.getImageableHeight() / dpi),
            MediaPrintableArea.INCH);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:CPrinterJob.java

示例5: getMediaPrintableArea

/**
 * 	Get Printable Media Area
 * 	@return Printable Area
 */
public MediaPrintableArea getMediaPrintableArea()
{
	MediaPrintableArea area = new MediaPrintableArea ((float)getImageableX()/72, (float)getImageableY()/72,
		(float)getImageableWidth()/72, (float)getImageableHeight()/72, MediaPrintableArea.INCH);
//	log.debug( "CPaper.getMediaPrintableArea", area.toString(MediaPrintableArea.INCH, "\""));
	return area;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:11,代码来源:CPaper.java

示例6: setMediaPrintableArea

/**
 * 	Get Printable Media Area
 * 	@param area Printable Area
 */
public void setMediaPrintableArea (MediaPrintableArea area)
{
	int inch = MediaPrintableArea.INCH;
	log.debug(area.toString(inch, "\""));
	setImageableArea(area.getX(inch)*72, area.getY(inch)*72,
		area.getWidth(inch)*72, area.getHeight(inch)*72);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:11,代码来源:CPaper.java


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