public class MediaSize extends Size2DSyntax implements Attribute
 MediaSize is not yet used to specify media. Its current role is
 as a mapping for named media (see MediaSizeName).
 Clients can use the mapping method
 MediaSize.getMediaSizeForName(MediaSizeName)
 to find the physical dimensions of the MediaSizeName instances
 enumerated in this API. This is useful for clients which need this
 information to format & paginate printing.
 
| Modifier and Type | Class and Description | 
|---|---|
| static class  | MediaSize.EngineeringClass MediaSize.Engineering includes  MediaSizevalues
 for engineering media. | 
| static class  | MediaSize.ISOClass MediaSize.ISO includes  MediaSizevalues for ISO
 media. | 
| static class  | MediaSize.JISClass MediaSize.JIS includes  MediaSizevalues for JIS
 (Japanese) media. | 
| static class  | MediaSize.NAClass MediaSize.NA includes  MediaSizevalues for North
 American media. | 
| static class  | MediaSize.OtherClass MediaSize.Other includes  MediaSizevalues for
 miscellaneous media. | 
INCH, MM| Constructor and Description | 
|---|
| MediaSize(float x,
         float y,
         int units)Construct a new media size attribute from the given floating-point
 values. | 
| MediaSize(float x,
         float y,
         int units,
         MediaSizeName media)Construct a new media size attribute from the given floating-point
 values. | 
| MediaSize(int x,
         int y,
         int units)Construct a new media size attribute from the given integer values. | 
| MediaSize(int x,
         int y,
         int units,
         MediaSizeName media)Construct a new media size attribute from the given integer values. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object object)Returns whether this media size attribute is equivalent to the passed
 in object. | 
| static MediaSizeName | findMedia(float x,
         float y,
         int units)The specified dimensions are used to locate a matching MediaSize
 instance from amongst all the standard MediaSize instances. | 
| Class<? extends Attribute> | getCategory()Get the printing attribute class which is to be used as the "category"
 for this printing attribute value. | 
| static MediaSize | getMediaSizeForName(MediaSizeName media)Get the MediaSize for the specified named media. | 
| MediaSizeName | getMediaSizeName()Get the media name, if any, for this size. | 
| String | getName()Get the name of the category of which this attribute value is an
 instance. | 
getSize, getX, getXMicrometers, getY, getYMicrometers, hashCode, toString, toStringpublic MediaSize(float x,
                 float y,
                 int units)
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or
   units < 1 or x > y.x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
     Size2DSyntax.MM.public MediaSize(int x,
                 int y,
                 int units)
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or
   units < 1 or x > y.x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
     Size2DSyntax.MM.public MediaSize(float x,
                 float y,
                 int units,
                 MediaSizeName media)
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or
   units < 1 or x > y.x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
     Size2DSyntax.MM.media - a media name to associate with this MediaSizepublic MediaSize(int x,
                 int y,
                 int units,
                 MediaSizeName media)
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or
   units < 1 or x > y.x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
     Size2DSyntax.MM.media - a media name to associate with this MediaSizepublic MediaSizeName getMediaSizeName()
public static MediaSize getMediaSizeForName(MediaSizeName media)
media - - the name of the media for which the size is soughtpublic static MediaSizeName findMedia(float x, float y, int units)
The MediaSize is in turn used to locate the MediaSizeName object. This method may return null if the closest matching MediaSize has no corresponding Media instance.
This method is useful for clients which have only dimensions and want to find a Media which corresponds to the dimensions.
IllegalArgumentException - if x <= 0,
      y <= 0, or units < 1.x - - X dimensiony - - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
     Size2DSyntax.MMpublic boolean equals(Object object)
object is not null.
 object is an instance of class MediaSize.
 object's X dimension.
 object's Y dimension.
 equals in class Size2DSyntaxobject - Object to compare to.object is equivalent to this media size
          attribute, false otherwise.Object.hashCode(), 
HashMappublic final Class<? extends Attribute> getCategory()
For class MediaSize and any vendor-defined subclasses, the category is class MediaSize itself.
getCategory in interface Attributejava.lang.Class.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.