Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.print.attribute.standard

Class MediaSize

  • All Implemented Interfaces:
    Serializable, Cloneable, Attribute

    public class MediaSize
    extends Size2DSyntax
    implements Attribute
    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.

    See Also:
    Serialized Form
    • Constructor Detail

      • MediaSize

        public MediaSize(float x,
                 float y,
                 int units)
        Construct a new media size attribute from the given floating-point values.
        Parameters:
        x - X dimension.
        y - Y dimension.
        units - Unit conversion factor, e.g. Size2DSyntax.INCH or Size2DSyntax.MM.
        Throws:
        IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or units < 1 or x > y.
      • MediaSize

        public MediaSize(int x,
                 int y,
                 int units)
        Construct a new media size attribute from the given integer values.
        Parameters:
        x - X dimension.
        y - Y dimension.
        units - Unit conversion factor, e.g. Size2DSyntax.INCH or Size2DSyntax.MM.
        Throws:
        IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or units < 1 or x > y.
      • MediaSize

        public MediaSize(float x,
                 float y,
                 int units,
                 MediaSizeName media)
        Construct a new media size attribute from the given floating-point values.
        Parameters:
        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
        Throws:
        IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or units < 1 or x > y.
      • MediaSize

        public MediaSize(int x,
                 int y,
                 int units,
                 MediaSizeName media)
        Construct a new media size attribute from the given integer values.
        Parameters:
        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
        Throws:
        IllegalArgumentException - (Unchecked exception) Thrown if x < 0 or y < 0 or units < 1 or x > y.
    • Method Detail

      • getMediaSizeName

        public MediaSizeName getMediaSizeName()
        Get the media name, if any, for this size.
        Returns:
        the name for this media size, or null if no name was associated with this size (an anonymous size).
      • getMediaSizeForName

        public static MediaSize getMediaSizeForName(MediaSizeName media)
        Get the MediaSize for the specified named media.
        Parameters:
        media - - the name of the media for which the size is sought
        Returns:
        size of the media, or null if this media is not associated with any size.
      • findMedia

        public 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. If there is no exact match, the closest match is used.

        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.

        Parameters:
        x - - X dimension
        y - - Y dimension.
        units - Unit conversion factor, e.g. Size2DSyntax.INCH or Size2DSyntax.MM
        Returns:
        MediaSizeName matching these dimensions, or null.
        Throws:
        IllegalArgumentException - if x <= 0, y <= 0, or units < 1
      • equals

        public boolean equals(Object object)
        Returns whether this media size attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:
        1. object is not null.
        2. object is an instance of class MediaSize.
        3. This media size attribute's X dimension is equal to object's X dimension.
        4. This media size attribute's Y dimension is equal to object's Y dimension.
        Overrides:
        equals in class Size2DSyntax
        Parameters:
        object - Object to compare to.
        Returns:
        True if object is equivalent to this media size attribute, false otherwise.
        See Also:
        Object.hashCode(), HashMap
      • getCategory

        public final Class<? extends Attribute> getCategory()
        Get the printing attribute class which is to be used as the "category" for this printing attribute value.

        For class MediaSize and any vendor-defined subclasses, the category is class MediaSize itself.

        Specified by:
        getCategory in interface Attribute
        Returns:
        Printing attribute class (category), an instance of class java.lang.Class.
      • getName

        public final String getName()
        Get the name of the category of which this attribute value is an instance.

        For class MediaSize and any vendor-defined subclasses, the category name is "media-size".

        Specified by:
        getName in interface Attribute
        Returns:
        Attribute category name.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/print/attribute/standard/mediasize.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut