Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.Media


    // for now, be lazy, assume that the first page is the reference
    final PageDefinition pdef = report.getPageDefinition();
    final PageFormat format = pdef.getPageFormat(0);
    final Paper paper = format.getPaper();

    final Media media = MediaSize.findMedia((float) (paper.getWidth() / POINTS_PER_INCH),
        (float) (paper.getHeight() / POINTS_PER_INCH), Size2DSyntax.INCH);
    attributes.add(media);

    final MediaPrintableArea printableArea = new MediaPrintableArea
        ((float) (paper.getImageableX() / POINTS_PER_INCH),
View Full Code Here


    return attributes;
  }

  public static PageFormat extractPageFormat(final PrintRequestAttributeSet attributeSet)
  {
    final Media media = (Media) attributeSet.get(Media.class);
    final MediaPrintableArea printableArea =
        (MediaPrintableArea) attributeSet.get(MediaPrintableArea.class);
    final OrientationRequested orientationRequested =
        (OrientationRequested) attributeSet.get(OrientationRequested.class);
View Full Code Here

        if (service == null || attributes == null) {
            return pf;
        }

        Media media = (Media)attributes.get(Media.class);
        MediaPrintableArea mpa =
            (MediaPrintableArea)attributes.get(MediaPrintableArea.class);
        OrientationRequested orientReq =
           (OrientationRequested)attributes.get(OrientationRequested.class);
View Full Code Here

    // for now, be lazy, assume that the first page is the reference
    final PageDefinition pdef = report.getPageDefinition();
    final PageFormat format = pdef.getPageFormat(0);
    final Paper paper = format.getPaper();

    final Media media = MediaSize.findMedia((float) (paper.getWidth() / POINTS_PER_INCH),
        (float) (paper.getHeight() / POINTS_PER_INCH), Size2DSyntax.INCH);
    attributes.add(media);

    final MediaPrintableArea printableArea = new MediaPrintableArea
        ((float) (paper.getImageableX() / POINTS_PER_INCH),
View Full Code Here

    return attributes;
  }

  public static PageFormat extractPageFormat(final PrintRequestAttributeSet attributeSet)
  {
    final Media media = (Media) attributeSet.get(Media.class);
    final MediaPrintableArea printableArea =
        (MediaPrintableArea) attributeSet.get(MediaPrintableArea.class);
    final OrientationRequested orientationRequested =
        (OrientationRequested) attributeSet.get(OrientationRequested.class);
View Full Code Here

*/
void fillMediaFields() {
    if (myService.isAttributeCategorySupported(Media.class)) {
        Media [] mediaList = (Media []) myService
                .getSupportedAttributeValues(Media.class, flavor, attrs);
        Media oldMedia = (sizeBox.getItemCount() <= 0)
                ? null
                : (Media)sizeBox.getSelectedItem();

        sizeBox.removeAllItems();
        if ((mediaList != null) && (mediaList.length > 0)) {
View Full Code Here

        /* set margins at first time */
        MediaMargins margins = null;    // Margins for the dialog Margins fields

        if (isMarginsEnabled) { // Margins fields are enabled and can be edited
           
            Media selectedMedia = (Media) sizeBox.getSelectedItem();
            boolean isMediaSizeSelected = (selectedMedia == null)
                ? false :
                selectedMedia.getClass().isAssignableFrom(MediaSizeName.class);
            MediaSize selectedSize = isMediaSizeSelected
                ? MediaSize.getMediaSizeForName((MediaSizeName) selectedMedia)
                : null;
           
            if (isMediaSupported
View Full Code Here

        if (service == null || attributes == null) {
            return pf;
        }

        Media media = (Media)attributes.get(Media.class);
        MediaPrintableArea mpa =
            (MediaPrintableArea)attributes.get(MediaPrintableArea.class);
        OrientationRequested orientReq =
           (OrientationRequested)attributes.get(OrientationRequested.class);
View Full Code Here

       
        return printRequestAttributeSet;
    }
   
    private MediaTray resolveMediaTray(String tray) {
        Media medias[] = (Media[]) getPrintService().getSupportedAttributeValues(Media.class, null, null);
       
        if (medias == null) {
            return null;
        } else {
            for (Media media : medias) {
View Full Code Here

                printerJob.setJobName(jname.toString());
            }

            pageFormat = new PageFormat();

            Media media = (Media)attributes.get(Media.class);
            MediaSize mediaSize =  null;
            if (media != null  && media instanceof MediaSizeName) {
                mediaSize = MediaSize.getMediaSizeForName((MediaSizeName)media);
            }
View Full Code Here

TOP

Related Classes of javax.print.attribute.standard.Media

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.