public final class MediaPrintableArea extends Object implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
可打印区域被指定为一个矩形,在一个媒体的整体尺寸。
大多数打印机不能在媒体的整个表面上打印,由于打印机的硬件限制。这个类可以用来一个打印作业的可接受值的查询,并要求一个区域内的可打印区域的限制,可用于打印作业。
查询的可打印区域,客户必须提供一个合适的语境。没有指定最起码的媒体被用于打印区域没有有意义的值的大小可以得到。
该属性不是从纸张的边缘的距离的条款,部分强调,这个属性不是独立的一个特定的媒体,但必须描述的范围内的其他属性的选择。另外一个客户端使用的可打印区域通常更方便。
硬件的最低利润率不仅是一个属性的打印机,但可能是一个媒体的规模、功能定位、媒体类型,以及任何指定的装修。PrintService
提供的方法查询在一个合适的上下文属性支持的值:看PrintService.getSupportedAttributeValues()
矩形可打印区域是这样定义的:(x,y)的起源定位在肖像模式本文左上无论在请求上下文指明方向。例如,在纵向或横向有宽度高度> A4纸打印区域。
可打印区域属性的值存储在内部以微米为单位的整数(µm),其中1微米= 10- 6米= 1 / 1000 = 1毫米/ 25400英寸。这允许尺寸要精确的表示精度到1 / 1000毫米(= 1µm)或1 / 100英寸(= 254µm)。如果分数英寸在两负幂表示,这允许尺寸要精确的表示精度到1 / 8英寸(= 3175µ米)而不是1 / 16英寸(因为1 / 16英寸不等于µM是一个整数)。
聚丙烯的相容性: mediaprintablearea不是IPP属性。
Modifier and Type | Field and Description |
---|---|
static int |
INCH
值表示英寸单位(英寸)。
|
static int |
MM
值表示单位为毫米(毫米)。
|
Constructor and Description |
---|
MediaPrintableArea(float x, float y, float w, float h, int units)
从浮点值构造一个mediaprintablearea对象。
|
MediaPrintableArea(int x, int y, int w, int h, int units)
构建了从整数值mediaprintablearea对象。
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
返回此媒体边缘属性是否等效于对象的传递。
|
类<? extends Attribute> |
getCategory()
获取要用作该打印属性值的“类别”的打印属性类。
|
float |
getHeight(int units)
在指定的单位获得的可打印区域的高度。
|
String |
getName()
获取此属性值的类别的名称,即一个实例。
|
float[] |
getPrintableArea(int units)
得到的可打印区域作为一个数组的值为4的X,Y,W,H。
|
float |
getWidth(int units)
在指定的单位获得的可打印区域的宽度。
|
float |
getX(int units)
在指定的单位获得的可打印区域起源的X位置。
|
float |
getY(int units)
在指定的单位获得的可打印区域起源的Y位置。
|
int |
hashCode()
返回此属性的哈希代码值。
|
String |
toString()
返回这个矩形大小属性的字符串版本。
|
String |
toString(int units, String unitsName)
返回给定单位中此矩形大小属性的字符串版本。
|
public static final int INCH
public static final int MM
public MediaPrintableArea(float x, float y, float w, float h, int units)
x
-打印X
y
-打印Y
w
-打印宽度
h
可打印高度
units
-该值表示。
IllegalArgumentException
-扔如果
x < 0
或
y < 0
或
w <= 0
或
h <= 0
或
units < 1
。
public MediaPrintableArea(int x, int y, int w, int h, int units)
x
-打印X
y
-打印Y
w
-打印宽度
h
可打印高度
units
-该值表示。
IllegalArgumentException
-如果
x < 0
或
y < 0
或
w <= 0
或
h <= 0
或
units < 1
扔。
public float[] getPrintableArea(int units)
units
单位转换因子,如
INCH
或
MM
。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public float getX(int units)
units
单位转换因子,如
INCH
或
MM
。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public float getY(int units)
units
单位转换因子,如
INCH
或
MM
。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public float getWidth(int units)
units
单位转换因子,如
INCH
或
MM
。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public float getHeight(int units)
units
单位转换因子,如
INCH
或
MM
。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public boolean equals(Object object)
object
不空。object
是类mediaprintablearea实例。equals
方法重写,继承类
Object
object
对象比较。
object
相当于这个媒体空间属性真,否则为假。
Object.hashCode()
,
HashMap
public final 类<? extends Attribute> getCategory()
mediaprintablearea类,类类mediaprintablearea本身。
getCategory
接口
Attribute
java.lang.Class
类实例。
public final String getName()
mediaprintablearea类,类的名字是"media-printable-area"
。
这不是一个IPP V1.1属性。
public String toString(int units, String unitsName)
units
单位转换因子,如
INCH
或
MM
。
unitsName
单位名称的字符串,例如
"in"
或
"mm"
。如果为空,则没有单位名称追加到结果中。
IllegalArgumentException
-(unchecked异常抛出如果
units < 1
)。
public int hashCode()
hashCode
方法重写,继承类
Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.