Java Code Examples for javax.print.attribute.standard.MediaSize#INCH
The following examples show how to use
javax.print.attribute.standard.MediaSize#INCH .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnixPrintService.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 2
Source File: UnixPrintService.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 3
Source File: UnixPrintService.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 4
Source File: UnixPrintService.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 5
Source File: UnixPrintService.java From hottub with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 6
Source File: UnixPrintService.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 7
Source File: UnixPrintService.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 8
Source File: UnixPrintService.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 9
Source File: UnixPrintService.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 10
Source File: UnixPrintService.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 11
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 12
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private MediaPrintableArea[] getAllPrintableAreas() { if (mpas == null) { Media[] media = (Media[])getSupportedAttributeValues(Media.class, null, null); mpas = new MediaPrintableArea[media.length]; for (int i=0; i< mpas.length; i++) { if (media[i] instanceof MediaSizeName) { MediaSizeName msn = (MediaSizeName)media[i]; MediaSize mediaSize = MediaSize.getMediaSizeForName(msn); if (mediaSize == null) { mpas[i] = (MediaPrintableArea) getDefaultAttributeValue(MediaPrintableArea.class); } else { mpas[i] = new MediaPrintableArea(0.25f, 0.25f, mediaSize.getX(MediaSize.INCH)-0.5f, mediaSize.getY(MediaSize.INCH)-0.5f, MediaSize.INCH); } } } } MediaPrintableArea[] mpasCopy = new MediaPrintableArea[mpas.length]; System.arraycopy(mpas, 0, mpasCopy, 0, mpas.length); return mpasCopy; }
Example 13
Source File: CPrinterJob.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 14
Source File: CPrinterJob.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 15
Source File: CPrinterJob.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 16
Source File: CPrinterJob.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 17
Source File: CPrinterJob.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 18
Source File: CPrinterJob.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 19
Source File: CPrinterJob.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }
Example 20
Source File: CPrinterJob.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private MediaSize getDefaultMediaSize(PageFormat page){ final int inch = 72; Paper paper = page.getPaper(); float width = (float) (paper.getWidth() / inch); float height = (float) (paper.getHeight() / inch); return new MediaSize(width, height, MediaSize.INCH); }