|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--java.awt.PageAttributes
印刷したページの出力を制御する属性セットです。
このクラスのインスタンスは、色の状態、用紙サイズ (メディアの種類)、用紙方向、論理的な原点、印刷品質、およびインスタンスを使用する各ページの解像度を制御します。属性名は Internet Printing Protocol (IPP) 1.1 に準拠し、属性値は一部が準拠しています。
内部クラス型をとるメソッドを使用するには、その内部クラスの定数フィールドに対する参照を渡します。クライアントコードは、このクラスが public コンストラクタを持たないため、内部クラス型の新規インスタンスを作成できません。色の状態をモノクロに設定するには、次のコードを使用します。
import java.awt.PageAttributes;
public class MonochromeExample {
public void setMonochrome(PageAttributes pageAttributes) {
pageAttributes.setColor(PageAttributes.ColorType.MONOCHROME);
}
}
attributeName のデフォルトの値をサポートするすべての IPP 属性は、対応する setattributeNameToDefault メソッドを持っています。デフォルトの値フィールドは提供されていません。
| 内部クラスの概要 | |
static class |
PageAttributes.ColorType
使用可能なカラー状態の型保証された列挙 |
static class |
PageAttributes.MediaType
使用可能な用紙サイズの型保証された列挙です。 |
static class |
PageAttributes.OrientationRequestedType
使用可能な用紙方向の型保証された列挙です。 |
static class |
PageAttributes.OriginType
使用可能な原点の型保証された列挙です。 |
static class |
PageAttributes.PrintQualityType
使用可能な印刷品質の型保証された列挙です。 |
| コンストラクタの概要 | |
PageAttributes()
各属性にデフォルトの値を持つ PageAttributes インスタンスを生成します。 |
|
PageAttributes(PageAttributes.ColorType color,
PageAttributes.MediaType media,
PageAttributes.OrientationRequestedType orientationRequested,
PageAttributes.OriginType origin,
PageAttributes.PrintQualityType printQuality,
int[] printerResolution)
各属性に指定された値を持つ PageAttributes インスタンスを生成します。 |
|
PageAttributes(PageAttributes obj)
指定された PageAttributes のコピーである PageAttributes インスタンスを生成します。 |
|
| メソッドの概要 | |
Object |
clone()
PageAttributes のコピーを作成して、返します。 |
boolean |
equals(Object obj)
2 つの PageAttributes が同じであるかどうかを判定します。 |
PageAttributes.ColorType |
getColor()
これらの属性を使用するページをカラーで描画するかモノクロで描画するかを返します。 |
PageAttributes.MediaType |
getMedia()
これらの属性を使用するページの用紙サイズを返します。 |
PageAttributes.OrientationRequestedType |
getOrientationRequested()
これらの属性を使用するページの用紙方向を返します。 |
PageAttributes.OriginType |
getOrigin()
これらの属性を使用するページの (0, 0) 描画を物理ページの左上隅にするか、印刷範囲の左上隅にするかを返します。 |
int[] |
getPrinterResolution()
これらの属性を使用するページの印刷解像度を返します。 |
PageAttributes.PrintQualityType |
getPrintQuality()
これらの属性を使用するページの印刷品質を返します。 |
int |
hashCode()
この PageAttributes のハッシュコード値を返します。 |
void |
set(PageAttributes obj)
PageAttributes のすべての属性を obj の属性と同じ値に設定します。 |
void |
setColor(PageAttributes.ColorType color)
これらの属性を使用するページをカラーで描画するかモノクロで描画するかを指定します。 |
void |
setMedia(PageAttributes.MediaType media)
これらの属性を使用するページの用紙サイズを指定します。 |
void |
setMediaToDefault()
これらの属性を使用するページの用紙サイズをデフォルトロケールのデフォルトサイズに指定します。 |
void |
setOrientationRequested(int orientationRequested)
これらの属性を使って、ページの用紙方向を指定します。 |
void |
setOrientationRequested(PageAttributes.OrientationRequestedType orientationRequested)
これらの属性を使用するページの用紙方向を指定します。 |
void |
setOrientationRequestedToDefault()
これらの属性を使用するページの用紙方向をデフォルトに設定します。 |
void |
setOrigin(PageAttributes.OriginType origin)
これらの属性を使用するページの (0, 0) 描画を物理ページの左上隅にするか、印刷範囲の左上隅にするかを指定します。 |
void |
setPrinterResolution(int printerResolution)
これらの属性を使用するページの前後送りまたは送りの印刷解像度を 1 インチ当たりのドット数で指定します。 |
void |
setPrinterResolution(int[] printerResolution)
これらの属性を使用するページの印刷解像度を指定します。 |
void |
setPrinterResolutionToDefault()
これらの属性を使用するページのプリンタ解像度をデフォルトに設定します。 |
void |
setPrintQuality(int printQuality)
これらの属性を使用するページの印刷品質を指定します。 |
void |
setPrintQuality(PageAttributes.PrintQualityType printQuality)
これらの属性を使用するページの印刷品質を指定します。 |
void |
setPrintQualityToDefault()
これらの属性を使用するページの印刷品質をデフォルトに設定します。 |
String |
toString()
この PageAttributes の文字列表現を返します。 |
| クラス java.lang.Object から継承したメソッド |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| コンストラクタの詳細 |
public PageAttributes()
public PageAttributes(PageAttributes obj)
obj - コピー対象の PageAttributes
public PageAttributes(PageAttributes.ColorType color,
PageAttributes.MediaType media,
PageAttributes.OrientationRequestedType orientationRequested,
PageAttributes.OriginType origin,
PageAttributes.PrintQualityType printQuality,
int[] printerResolution)
color - ColorType.COLOR または ColorType.MONOCHROMEmedia - MediaType クラスの一つの定数フィールドorientationRequested - OrientationRequestedType.PORTRAIT または OrientationRequestedType.LANDSCAPEorigin - OriginType.PHYSICAL または OriginType.PRINTABLEprintQuality - PrintQualityType.DRAFT、PrintQualityType.NORMAL、または PrintQualityType.HIGHprinterResolution - 3 要素の整数型配列。最初の要素と 2 番目の要素は 0 より大きい値、3 番目の要素は 3 または 4 でなければなりません。IllegalArgumentException - 上記の条件の 1 つ以上に違反した場合| メソッドの詳細 |
public Object clone()
Object 内の clonepublic void set(PageAttributes obj)
obj - コピー対象の PageAttributespublic PageAttributes.ColorType getColor()
public void setColor(PageAttributes.ColorType color)
color - ColorType.COLOR または ColorType.MONOCHROMEIllegalArgumentException - color が null の場合public PageAttributes.MediaType getMedia()
public void setMedia(PageAttributes.MediaType media)
media - MediaType クラスの一つの定数フィールドIllegalArgumentException - media が null の場合public void setMediaToDefault()
public PageAttributes.OrientationRequestedType getOrientationRequested()
public void setOrientationRequested(PageAttributes.OrientationRequestedType orientationRequested)
orientationRequested - OrientationRequestedType.PORTRAIT または OrientationRequestedType.LANDSCAPEIllegalArgumentException - orientationRequested が null の場合public void setOrientationRequested(int orientationRequested)
3 を指定すると縦方向、4 を指定すると横方向になります。他の値を指定すると IllegalArgumentException がスローされます。プロパティで指定しない場合は、setOrientationRequested(OrientationRequestedType.PORTRAIT) が呼び出されます。orientationRequested - 3 または 4IllegalArgumentException - orientationRequested が 3 または 4 ではない場合public void setOrientationRequestedToDefault()
public PageAttributes.OriginType getOrigin()
public void setOrigin(PageAttributes.OriginType origin)
origin - OriginType.PHYSICAL または OriginType.PRINTABLEIllegalArgumentException - origin が null の場合public PageAttributes.PrintQualityType getPrintQuality()
public void setPrintQuality(PageAttributes.PrintQualityType printQuality)
printQuality - PrintQualityType.DRAFT、PrintQualityType.NORMAL、または PrintQualityType.HIGHIllegalArgumentException - printQuality が null の場合public void setPrintQuality(int printQuality)
3 を指定するとドラフト、4 を指定すると通常、5 を指定すると高品質になります。他の値を指定すると IllegalArgumentException がスローされます。プロパティで指定しない場合は、setPrintQuality(PrintQualityType.NORMAL) が呼び出されます。printQuality - 3、4 または 5IllegalArgumentException - printQuality が 3、4 または 5 ではない場合public void setPrintQualityToDefault()
public int[] getPrinterResolution()
3 は 1 インチ当たりのドット数、4 は 1 センチ当たりのドット数となります。3 または 4 でなければなりません。public void setPrinterResolution(int[] printerResolution)
3 は 1 インチ当たりのドット数、4 は 1 センチ当たりのドット数となります。1.1 印刷実装 (Toolkit.getPrintJob) では、送り方向の解像度と前後送りの解像度は同じである必要があります。プロパティで指定しない場合は、setPrinterResolution(72) が呼び出されます。printerResolution - 3 要素の整数型配列。最初の要素と 2 番目の要素は 0 より大きい値、3 番目の要素は 3 または 4 でなければなりません。IllegalArgumentException - 上記の条件の 1 つ以上に違反した場合public void setPrinterResolution(int printerResolution)
72 が指定されます。printerResolution - 0 よりも大きい整数値IllegalArgumentException - printerResolution が 0 以下の場合public void setPrinterResolutionToDefault()
public boolean equals(Object obj)
お互いの属性がすべて同じである場合にだけ、2 つの PageAttributes は等しくなります。フィールドが一意の同じ列挙オブジェクトを参照している場合にだけ、列挙型の属性が等しくなります。つまり、別名のメディアは、元になる一意のメディアと同じであるということです。送り解像度、前後送り解像度および単位が同じである場合にだけ、プリンタの解像度が等しくなります。
Object 内の equalsobj - 同じであるかどうかが判定されるオブジェクトpublic int hashCode()
Object 内の hashCodepublic String toString()
Object 内の toString
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.