Mercurial > hg > openjdk > icedtea > jdk7 > jdk
changeset 5201:df5bcdff3def
Merge
author | mfang |
---|---|
date | Mon, 02 Apr 2012 16:08:09 -0700 |
parents | 3dd51e801d02 (current diff) 043ff369ad32 (diff) |
children | 0f9aacb27534 |
files | |
diffstat | 13 files changed, 465 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/make/common/Defs-linux.gmk Mon Apr 02 14:15:38 2012 -0700 +++ b/make/common/Defs-linux.gmk Mon Apr 02 16:08:09 2012 -0700 @@ -53,6 +53,11 @@ PLATFORM_SRC = $(BUILDDIR)/../src/solaris endif # PLATFORM_SRC +# Location of the various .properties files specific to Linux platform +ifndef PLATFORM_PROPERTIES + PLATFORM_PROPERTIES = $(BUILDDIR)/../src/solaris/lib +endif # PLATFORM_SRC + # Platform specific closed sources ifndef OPENJDK ifndef CLOSED_PLATFORM_SRC
--- a/make/common/Defs-macosx.gmk Mon Apr 02 14:15:38 2012 -0700 +++ b/make/common/Defs-macosx.gmk Mon Apr 02 16:08:09 2012 -0700 @@ -53,6 +53,11 @@ PLATFORM_SRC = $(BUILDDIR)/../src/solaris endif # PLATFORM_SRC +# Location of the various .properties files specific to MacOS X platform +ifndef PLATFORM_PROPERTIES + PLATFORM_PROPERTIES = $(BUILDDIR)/../src/macosx/lib +endif # PLATFORM_SRC + PLATFORM_SRC_MACOS = $(BUILDDIR)/../src/macosx # BSD build pulls its platform sources from the solaris tree.
--- a/make/common/Defs-solaris.gmk Mon Apr 02 14:15:38 2012 -0700 +++ b/make/common/Defs-solaris.gmk Mon Apr 02 16:08:09 2012 -0700 @@ -51,6 +51,11 @@ PLATFORM_SRC = $(BUILDDIR)/../src/solaris endif # PLATFORM_SRC +# Location of the various .properties files specific to Solaris platform +ifndef PLATFORM_PROPERTIES + PLATFORM_PROPERTIES = $(BUILDDIR)/../src/solaris/lib +endif # PLATFORM_SRC + # Platform specific closed sources ifndef OPENJDK ifndef CLOSED_PLATFORM_SRC
--- a/make/common/Defs-windows.gmk Mon Apr 02 14:15:38 2012 -0700 +++ b/make/common/Defs-windows.gmk Mon Apr 02 16:08:09 2012 -0700 @@ -53,6 +53,11 @@ PLATFORM_SRC = $(BUILDDIR)/../src/windows endif # PLATFORM_SRC +# Location of the various .properties files specific to Windows platform +ifndef PLATFORM_PROPERTIES + PLATFORM_PROPERTIES = $(BUILDDIR)/../src/windows/lib +endif # PLATFORM_SRC + # Platform specific closed sources ifndef OPENJDK ifndef CLOSED_PLATFORM_SRC
--- a/make/common/Release.gmk Mon Apr 02 14:15:38 2012 -0700 +++ b/make/common/Release.gmk Mon Apr 02 16:08:09 2012 -0700 @@ -146,6 +146,7 @@ javadoc.1 \ javah.1 \ javap.1 \ + jcmd.1 \ jconsole.1 \ jdb.1 \ jhat.1 \ @@ -615,10 +616,6 @@ $(ECHO) "oracle/jrockit/jfr/parser/" >> $@ $(ECHO) "oracle/jrockit/jfr/settings/" >> $@ $(ECHO) "oracle/jrockit/jfr/tools/" >> $@ - $(ECHO) "oracle/jrockit/jfr/util/" >> $@ - $(ECHO) "oracle/jrockit/jfr/util/log/" >> $@ - $(ECHO) "oracle/jrockit/jfr/util/os/" >> $@ - $(ECHO) "oracle/jrockit/jfr/util/text/" >> $@ endif endif @@ -645,7 +642,7 @@ $(MV) $@.temp $@ @($(CD) $(CLASSBINDIR) && $(java-vm-cleanup)) -# Create the jfr.jar containing Java Flight Recorder implementation +# Create jfr.jar JFR_JAR= ifndef OPENJDK ifndef JAVASE_EMBEDDED
--- a/make/java/awt/Makefile Mon Apr 02 14:15:38 2012 -0700 +++ b/make/java/awt/Makefile Mon Apr 02 16:08:09 2012 -0700 @@ -57,7 +57,7 @@ properties: $(LIBDIR) $(LIBPROPS) -$(LIBDIR)/%.properties: $(PLATFORM_SRC)/lib/%.properties +$(LIBDIR)/%.properties: $(PLATFORM_PROPERTIES)/%.properties $(install-file) properties.clean :
--- a/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java Mon Apr 02 14:15:38 2012 -0700 +++ b/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java Mon Apr 02 16:08:09 2012 -0700 @@ -26,6 +26,7 @@ package sun.lwawt.macosx; import java.awt.*; +import java.awt.image.BufferedImage; public class CCustomCursor extends Cursor { static Dimension sMaxCursorSize; @@ -36,7 +37,6 @@ } Image fImage; - private boolean isImageOk = false; Point fHotspot; public CCustomCursor(final Image cursor, final Point hotSpot, final String name) throws IndexOutOfBoundsException, HeadlessException { @@ -61,21 +61,19 @@ // Fix for bug 4212593 The Toolkit.createCustomCursor does not // check absence of the image of cursor // If the image is invalid, the cursor will be hidden (made completely - // transparent). In this case, getBestCursorSize() will adjust negative w and h, - // but we need to set the hotspot inside the image here. + // transparent). if (tracker.isErrorAny() || width < 0 || height < 0) { fHotspot.x = fHotspot.y = 0; - isImageOk = false; + width = height = 1; + fImage = createTransparentImage(width, height); } else { - isImageOk = true; - } - - // Scale image to nearest supported size - final Dimension nativeSize = toolkit.getBestCursorSize(width, height); - if (nativeSize.width != width || nativeSize.height != height) { - fImage = fImage.getScaledInstance(nativeSize.width, nativeSize.height, Image.SCALE_DEFAULT); - width = nativeSize.width; - height = nativeSize.height; + // Scale image to nearest supported size + final Dimension nativeSize = toolkit.getBestCursorSize(width, height); + if (nativeSize.width != width || nativeSize.height != height) { + fImage = fImage.getScaledInstance(nativeSize.width, nativeSize.height, Image.SCALE_DEFAULT); + width = nativeSize.width; + height = nativeSize.height; + } } // NOTE: this was removed for 3169146, but in 1.5 the JCK tests for an exception and fails if one isn't thrown. @@ -98,6 +96,21 @@ } } + private static BufferedImage createTransparentImage(int w, int h) { + GraphicsEnvironment ge = + GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice gs = ge.getDefaultScreenDevice(); + GraphicsConfiguration gc = gs.getDefaultConfiguration(); + + BufferedImage img = gc.createCompatibleImage(w, h, Transparency.BITMASK); + Graphics2D g = (Graphics2D)img.getGraphics(); + g.setBackground(new Color(0, 0, 0, 0)); + g.clearRect(0, 0, w, h); + g.dispose(); + + return img; + } + public static Dimension getBestCursorSize(final int preferredWidth, final int preferredHeight) { // With Panther, cursors have no limit on their size. So give the client their // preferred size, but no larger than half the dimensions of the main screen @@ -111,31 +124,26 @@ } // Called from native when the cursor is set - // Returns long array of [NSImage ptr, x hotspot, y hotspot] CImage fCImage; long getImageData() { if (fCImage != null) { return fCImage.ptr; } - if (isImageOk) { - try { - fCImage = CImage.getCreator().createFromImage(fImage); - - if (fCImage == null) { - isImageOk = false; - return 0L; - } else { - return fCImage.ptr; - } - } catch (IllegalArgumentException iae) { - // Silently return null - we want to hide cursor by providing an empty - // ByteArray or just null + try { + fCImage = CImage.getCreator().createFromImage(fImage); + if (fCImage == null) { + // Something unexpected happened: CCustomCursor constructor + // takes care of invalid cursor images, yet createFromImage() + // failed to do its job. Return null to keep the cursor unchanged. return 0L; + } else { + return fCImage.ptr; } + } catch (IllegalArgumentException iae) { + // see comment above + return 0L; } - - return 0L; } Point getHotSpot() {
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Mon Apr 02 14:15:38 2012 -0700 +++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Mon Apr 02 16:08:09 2012 -0700 @@ -33,6 +33,7 @@ import javax.print.*; import javax.print.attribute.PrintRequestAttributeSet; +import javax.print.attribute.standard.PageRanges; import sun.java2d.*; import sun.print.*; @@ -145,6 +146,17 @@ } protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException { + if (attributes != null) { + PageRanges pageRangesAttr = + (PageRanges)attributes.get(PageRanges.class); + if (pageRangesAttr != null) { + SunPageSelection psel = (SunPageSelection)attributes.get(SunPageSelection.class); + if (psel == null) { + attributes.add(SunPageSelection.RANGE); + } + } + } + super.setAttributes(attributes); if (attributes == null) {
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Mon Apr 02 14:15:38 2012 -0700 +++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Mon Apr 02 16:08:09 2012 -0700 @@ -656,6 +656,14 @@ return ((mods & (InputEvent.META_MASK | InputEvent.CTRL_MASK)) == 0); } + /** + * Returns whether popup is allowed to be shown above the task bar. + */ + @Override + public boolean canPopupOverlapTaskBar() { + return false; + } + // Extends PeerEvent because we want to pass long an ObjC mediator object and because we want these events to be posted early // Typically, rather than relying on the notifier to call notifyAll(), we use the mediator to stop the runloop public static class CPeerEvent extends PeerEvent {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/macosx/lib/content-types.properties Mon Apr 02 16:08:09 2012 -0700 @@ -0,0 +1,276 @@ +#sun.net.www MIME content-types table +# +# Property fields: +# +# <description> ::= 'description' '=' <descriptive string> +# <extensions> ::= 'file_extensions' '=' <comma-delimited list, include '.'> +# <image> ::= 'icon' '=' <filename of icon image> +# <action> ::= 'browser' | 'application' | 'save' | 'unknown' +# <application> ::= 'application' '=' <command line template> +# + +# +# The "we don't know anything about this data" type(s). +# Used internally to mark unrecognized types. +# +content/unknown: description=Unknown Content +unknown/unknown: description=Unknown Data Type + +# +# The template we should use for temporary files when launching an application +# to view a document of given type. +# +temp.file.template: /tmp/%s + +# +# The "real" types. +# +application/octet-stream: \ + description=Generic Binary Stream;\ + file_extensions=.saveme,.dump,.hqx,.arc,.o,.a,.bin,.exe,.z,.gz + +application/oda: \ + description=ODA Document;\ + file_extensions=.oda + +application/pdf: \ + description=Adobe PDF Format;\ + file_extensions=.pdf + +application/postscript: \ + description=Postscript File;\ + file_extensions=.eps,.ai,.ps;\ + icon=ps;\ + action=application;\ + application=imagetool %s + +application/x-dvi: \ + description=TeX DVI File;\ + file_extensions=.dvi;\ + action=application;\ + application=xdvi %s + +application/x-hdf: \ + description=Hierarchical Data Format;\ + file_extensions=.hdf;\ + action=save + +application/x-latex: \ + description=LaTeX Source;\ + file_extensions=.latex + +application/x-netcdf: \ + description=Unidata netCDF Data Format;\ + file_extensions=.nc,.cdf;\ + action=save + +application/x-tex: \ + description=TeX Source;\ + file_extensions=.tex + +application/x-texinfo: \ + description=Gnu Texinfo;\ + file_extensions=.texinfo,.texi + +application/x-troff: \ + description=Troff Source;\ + file_extensions=.t,.tr,.roff;\ + action=application;\ + application=xterm -title troff -e sh -c \"nroff %s | col | more -w\" + +application/x-troff-man: \ + description=Troff Manpage Source;\ + file_extensions=.man;\ + action=application;\ + application=xterm -title troff -e sh -c \"nroff -man %s | col | more -w\" + +application/x-troff-me: \ + description=Troff ME Macros;\ + file_extensions=.me;\ + action=application;\ + application=xterm -title troff -e sh -c \"nroff -me %s | col | more -w\" + +application/x-troff-ms: \ + description=Troff MS Macros;\ + file_extensions=.ms;\ + action=application;\ + application=xterm -title troff -e sh -c \"nroff -ms %s | col | more -w\" + +application/x-wais-source: \ + description=Wais Source;\ + file_extensions=.src,.wsrc + +application/zip: \ + description=Zip File;\ + file_extensions=.zip;\ + icon=zip;\ + action=save + +application/x-bcpio: \ + description=Old Binary CPIO Archive;\ + file_extensions=.bcpio; action=save + +application/x-cpio: \ + description=Unix CPIO Archive;\ + file_extensions=.cpio; action=save + +application/x-gtar: \ + description=Gnu Tar Archive;\ + file_extensions=.gtar;\ + icon=tar;\ + action=save + +application/x-shar: \ + description=Shell Archive;\ + file_extensions=.sh,.shar;\ + action=save + +application/x-sv4cpio: \ + description=SVR4 CPIO Archive;\ + file_extensions=.sv4cpio; action=save + +application/x-sv4crc: \ + description=SVR4 CPIO with CRC;\ + file_extensions=.sv4crc; action=save + +application/x-tar: \ + description=Tar Archive;\ + file_extensions=.tar;\ + icon=tar;\ + action=save + +application/x-ustar: \ + description=US Tar Archive;\ + file_extensions=.ustar;\ + action=save + +audio/basic: \ + description=Basic Audio;\ + file_extensions=.snd,.au;\ + icon=audio;\ + action=application;\ + application=audiotool %s + +audio/x-aiff: \ + description=Audio Interchange Format File;\ + file_extensions=.aifc,.aif,.aiff;\ + icon=aiff + +audio/x-wav: \ + description=Wav Audio;\ + file_extensions=.wav;\ + icon=wav + +image/gif: \ + description=GIF Image;\ + file_extensions=.gif;\ + icon=gif;\ + action=browser + +image/ief: \ + description=Image Exchange Format;\ + file_extensions=.ief + +image/jpeg: \ + description=JPEG Image;\ + file_extensions=.jfif,.jfif-tbnl,.jpe,.jpg,.jpeg;\ + icon=jpeg;\ + action=browser;\ + application=imagetool %s + +image/tiff: \ + description=TIFF Image;\ + file_extensions=.tif,.tiff;\ + icon=tiff + +image/vnd.fpx: \ + description=FlashPix Image;\ + file_extensions=.fpx,.fpix + +image/x-cmu-rast: \ + description=CMU Raster Image;\ + file_extensions=.ras + +image/x-portable-anymap: \ + description=PBM Anymap Format;\ + file_extensions=.pnm + +image/x-portable-bitmap: \ + description=PBM Bitmap Format;\ + file_extensions=.pbm + +image/x-portable-graymap: \ + description=PBM Graymap Format;\ + file_extensions=.pgm + +image/x-portable-pixmap: \ + description=PBM Pixmap Format;\ + file_extensions=.ppm + +image/x-rgb: \ + description=RGB Image;\ + file_extensions=.rgb + +image/x-xbitmap: \ + description=X Bitmap Image;\ + file_extensions=.xbm,.xpm + +image/x-xwindowdump: \ + description=X Window Dump Image;\ + file_extensions=.xwd + +image/png: \ + description=PNG Image;\ + file_extensions=.png;\ + icon=png;\ + action=browser + +text/html: \ + description=HTML Document;\ + file_extensions=.htm,.html;\ + icon=html + +text/plain: \ + description=Plain Text;\ + file_extensions=.text,.c,.cc,.c++,.h,.pl,.txt,.java,.el;\ + icon=text;\ + action=browser + +text/tab-separated-values: \ + description=Tab Separated Values Text;\ + file_extensions=.tsv + +text/x-setext: \ + description=Structure Enhanced Text;\ + file_extensions=.etx + +video/mpeg: \ + description=MPEG Video Clip;\ + file_extensions=.mpg,.mpe,.mpeg;\ + icon=mpeg;\ + action=application;\ + application=mpeg_play %s + +video/quicktime: \ + description=QuickTime Video Clip;\ + file_extensions=.mov,.qt + +application/x-troff-msvideo: \ + description=AVI Video;\ + file_extensions=.avi;\ + icon=avi + +video/x-sgi-movie: \ + description=SGI Movie;\ + file_extensions=.movie,.mv + +message/rfc822: \ + description=Internet Email Message;\ + file_extensions=.mime + +application/xml: \ + description=XML document;\ + file_extensions=.xml + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/macosx/lib/flavormap.properties Mon Apr 02 16:08:09 2012 -0700 @@ -0,0 +1,78 @@ +# +# This properties file is used to initialize the default +# java.awt.datatransfer.SystemFlavorMap. It contains the X11 platform-specific, +# default mappings between common X11 selection atoms and platform-independent +# MIME type strings, which will be converted into +# java.awt.datatransfer.DataFlavors. +# +# These default mappings may be augmented by specifying the +# +# AWT.DnD.flavorMapFileURL +# +# property in the appropriate awt.properties file. The specified properties URL +# will be loaded into the SystemFlavorMap. +# +# The standard format is: +# +# <native>=<MIME type> +# +# <native> should be a string identifier that the native platform will +# recognize as a valid data format. <MIME type> should specify both a MIME +# primary type and a MIME subtype separated by a '/'. The MIME type may include +# parameters, where each parameter is a key/value pair separated by '=', and +# where each parameter to the MIME type is separated by a ';'. +# +# Because SystemFlavorMap implements FlavorTable, developers are free to +# duplicate both native keys and DataFlavor values. If a mapping contains a +# duplicate key or value, earlier mappings which included this key or value +# will be preferred. +# +# Mappings whose values specify DataFlavors with primary MIME types of +# "text", and which support the charset parameter, should specify the exact +# format in which the native platform expects the data. The "charset" +# parameter specifies the char to byte encoding, the "eoln" parameter +# specifies the end-of-line marker, and the "terminators" parameter specifies +# the number of terminating NUL bytes. Note that "eoln" and "terminators" +# are not standardized MIME type parameters. They are specific to this file +# format ONLY. They will not appear in any of the DataFlavors returned by the +# SystemFlavorMap at the Java level. +# +# If the "charset" parameter is omitted, or has zero length, the platform +# default encoding is assumed. If the "eoln" parameter is omitted, or has +# zero length, "\n" is assumed. If the "terminators" parameter is omitted, +# or has a value less than zero, zero is assumed. +# +# Upon initialization, the data transfer subsystem will record the specified +# details of the native text format, but the default SystemFlavorMap will +# present a large set of synthesized DataFlavors which map, in both +# directions, to the native. After receiving data from the application in one +# of the synthetic DataFlavors, the data transfer subsystem will transform +# the data stream into the format specified in this file before passing the +# transformed stream to the native system. +# +# Mappings whose values specify DataFlavors with primary MIME types of +# "text", but which do not support the charset parameter, will be treated as +# opaque, 8-bit data. They will not undergo any transformation process, and +# any "charset", "eoln", or "terminators" parameters specified in this file +# will be ignored. +# +# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of +# text flavors which support the charset parameter. + +UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0 + +# The COMPOUND_TEXT support for inter-client text transfer is disabled by +# default. The reason is that many native applications prefer this format over +# other native text formats, but are unable to decode the textual data in this +# format properly. This results in java-to-native text transfer failures. +# To enable the COMPOUND_TEXT support for this JRE installation uncomment +# the line below. + +# COMPOUND_TEXT=text/plain;charset=x-compound-text;eoln="\n";terminators=0 + +TEXT=text/plain;eoln="\n";terminators=0 +STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0 +FILE_NAME=application/x-java-file-list;class=java.util.List +text/uri-list=application/x-java-file-list;class=java.util.List +PNG=image/x-java-image;class=java.awt.Image +JFIF=image/x-java-image;class=java.awt.Image
--- a/src/share/classes/javax/swing/JPopupMenu.java Mon Apr 02 14:15:38 2012 -0700 +++ b/src/share/classes/javax/swing/JPopupMenu.java Mon Apr 02 16:08:09 2012 -0700 @@ -41,6 +41,8 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.event.*; + +import sun.awt.SunToolkit; import sun.security.util.SecurityConstants; import java.applet.Applet; @@ -346,6 +348,7 @@ long popupBottomY = (long)popupLocation.y + (long)popupSize.height; int scrWidth = scrBounds.width; int scrHeight = scrBounds.height; + if (!canPopupOverlapTaskBar()) { // Insets include the task bar. Take them into account. Insets scrInsets = toolkit.getScreenInsets(gc); @@ -403,25 +406,19 @@ } /** - * Checks that there are enough security permissions - * to make popup "always on top", which allows to show it above the task bar. + * Returns whether popup is allowed to be shown above the task bar. */ static boolean canPopupOverlapTaskBar() { boolean result = true; - try { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission( - SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION); - } - } catch (SecurityException se) { - // There is no permission to show popups over the task bar - result = false; + + Toolkit tk = Toolkit.getDefaultToolkit(); + if (tk instanceof SunToolkit) { + result = ((SunToolkit)tk).canPopupOverlapTaskBar(); } + return result; } - /** * Factory method which creates the <code>JMenuItem</code> for * <code>Actions</code> added to the <code>JPopupMenu</code>.
--- a/src/share/classes/sun/awt/SunToolkit.java Mon Apr 02 14:15:38 2012 -0700 +++ b/src/share/classes/sun/awt/SunToolkit.java Mon Apr 02 16:08:09 2012 -0700 @@ -42,6 +42,8 @@ import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; + +import sun.security.util.SecurityConstants; import sun.util.logging.PlatformLogger; import sun.misc.SoftCache; import sun.font.FontDesignMetrics; @@ -1094,6 +1096,26 @@ } /** + * Returns whether popup is allowed to be shown above the task bar. + * This is a default implementation of this method, which checks + * corresponding security permission. + */ + public boolean canPopupOverlapTaskBar() { + boolean result = true; + try { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission( + SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION); + } + } catch (SecurityException se) { + // There is no permission to show popups over the task bar + result = false; + } + return result; + } + + /** * Returns a new input method window, with behavior as specified in * {@link java.awt.im.spi.InputMethodContext#createInputMethodWindow}. * If the inputContext is not null, the window should return it from its