java.lang.Objectjavax.print.attribute.Size2DSyntax
javax.print.attribute.standard.MediaSize
public class MediaSize
Class MediaSize is a two-dimensional size valued printing attribute class that indicates the dimensions of the medium in a portrait orientation, with the X dimension running along the bottom edge and the Y dimension running along the left edge. Thus, the Y dimension must be greater than or equal to the X dimension. Class MediaSize declares many standard media size values, organized into nested classes for ISO, JIS, North American, engineering, and other media.
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.
| Nested Class Summary | |
|---|---|
static class |
MediaSize.Engineering
Class MediaSize.Engineering includes MediaSize values
for engineering media. |
static class |
MediaSize.ISO
Class MediaSize.ISO includes MediaSize values for ISO
media. |
static class |
MediaSize.JIS
Class MediaSize.JIS includes MediaSize values for JIS
(Japanese) media. |
static class |
MediaSize.NA
Class MediaSize.NA includes MediaSize values for North
American media. |
static class |
MediaSize.Other
Class MediaSize.Other includes MediaSize values for
miscellaneous media. |
| Field Summary |
|---|
| Fields inherited from class javax.print.attribute.Size2DSyntax |
|---|
INCH, MM |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class javax.print.attribute.Size2DSyntax |
|---|
getSize, getX, getXMicrometers, getY, getYMicrometers, hashCode, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MediaSize(float x,
float y,
int units)
x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
Size2DSyntax.MM.
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y
< 0 or units < 1 or x > y.
public MediaSize(int x,
int y,
int units)
x - X dimension.y - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
Size2DSyntax.MM.
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y
< 0 or units < 1 or x > y.
public MediaSize(float x,
float y,
int units,
MediaSizeName media)
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 MediaSize
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y
< 0 or units < 1 or x > y.
public MediaSize(int x,
int y,
int units,
MediaSizeName media)
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 MediaSize
IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y
< 0 or units < 1 or x > y.| Method Detail |
|---|
public MediaSizeName getMediaSizeName()
public static MediaSize getMediaSizeForName(MediaSizeName media)
media - - the name of the media for which the size is sought
public 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.
x - - X dimensiony - - Y dimension.units - Unit conversion factor, e.g. Size2DSyntax.INCH or
Size2DSyntax.MM
IllegalArgumentException - if x <= 0, y <= 0, or units < 1public 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(),
Hashtablepublic 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.public final String getName()
For class MediaSize and any vendor-defined subclasses, the category
name is "media-size".
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
8 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)