src/share/classes/javax/print/attribute/standard/MediaSize.java

Print this page

        

*** 54,66 **** private static final long serialVersionUID = -1967958664615414771L; private MediaSizeName mediaName; ! private static HashMap mediaMap = new HashMap(100, 10); ! private static Vector sizeVector = new Vector(100, 10); /** * Construct a new media size attribute from the given floating-point * values. * --- 54,66 ---- private static final long serialVersionUID = -1967958664615414771L; private MediaSizeName mediaName; ! private static HashMap<MediaSizeName, MediaSize> mediaMap = new HashMap<>(100, 10); ! private static Vector<MediaSize> sizeVector = new Vector<>(100, 10); /** * Construct a new media size attribute from the given floating-point * values. *
*** 172,182 **** * @param media - the name of the media for which the size is sought * @return size of the media, or null if this media is not associated * with any size. */ public static MediaSize getMediaSizeForName(MediaSizeName media) { ! return (MediaSize)mediaMap.get(media); } /** * The specified dimensions are used to locate a matching MediaSize * instance from amongst all the standard MediaSize instances. --- 172,182 ---- * @param media - the name of the media for which the size is sought * @return size of the media, or null if this media is not associated * with any size. */ public static MediaSize getMediaSizeForName(MediaSizeName media) { ! return mediaMap.get(media); } /** * The specified dimensions are used to locate a matching MediaSize * instance from amongst all the standard MediaSize instances.
*** 211,221 **** float []dim; float diffx = x; float diffy = y; for (int i=0; i < sizeVector.size() ; i++) { ! MediaSize mediaSize = (MediaSize)sizeVector.elementAt(i); dim = mediaSize.getSize(units); if (x == dim[0] && y == dim[1]) { match = mediaSize; break; } else { --- 211,221 ---- float []dim; float diffx = x; float diffy = y; for (int i=0; i < sizeVector.size() ; i++) { ! MediaSize mediaSize = sizeVector.elementAt(i); dim = mediaSize.getSize(units); if (x == dim[0] && y == dim[1]) { match = mediaSize; break; } else {