Package megameklab.printing
Enum Class PaperSize
- All Implemented Interfaces:
Serializable,Comparable<PaperSize>,Constable
A collection of constants used for setting up print jobs
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Stringfinal Stringfinal MediaPrintableAreafinal intfinal intfinal MediaSizeName -
Method Summary
Modifier and TypeMethodDescriptionstatic PaperSizeclosestToAspect(double width, double height) Creates aPaperinstance with 1/4" marginscreatePaper(int left, int top, int right, int bottom) Creates aPaperinstance with the provided margins.static PaperSizeReturns the enum constant of this class with the specified name.static PaperSize[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
US_LETTER
-
ISO_A4
-
-
Field Details
-
sizeName
-
printableArea
-
pxWidth
public final int pxWidth -
pxHeight
public final int pxHeight -
displayName
-
dirName
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
closestToAspect
-
createPaper
Creates aPaperinstance with 1/4" margins- Returns:
- A Paper for use with a
PageFormat
-
createPaper
Creates aPaperinstance with the provided margins. Units are in 1/72 inches.- Parameters:
left- The left margintop- The top marginright- The right marginbottom- The bottom margin- Returns:
- A Paper for use with a
PageFormat
-