提交 3304a305 编写于 作者: L lana

Merge

...@@ -224,3 +224,5 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98 ...@@ -224,3 +224,5 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100 5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101 6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101
8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102 8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102
e0f6039c0290b7381042a6fec3100a69a5a67e37 jdk8-b103
f1d8d15bfcb5ada858a942f8a31f6598f23214d1 jdk8-b104
...@@ -296,7 +296,7 @@ static unichar AWTKeyToMacShortcut(jint awtKey, BOOL doShift) { ...@@ -296,7 +296,7 @@ static unichar AWTKeyToMacShortcut(jint awtKey, BOOL doShift) {
case java_awt_event_KeyEvent_VK_HELP : macKey = NSHelpFunctionKey; break; case java_awt_event_KeyEvent_VK_HELP : macKey = NSHelpFunctionKey; break;
case java_awt_event_KeyEvent_VK_TAB : macKey = NSTabCharacter; break; case java_awt_event_KeyEvent_VK_TAB : macKey = NSTabCharacter; break;
case java_awt_event_KeyEvent_VK_ENTER : macKey = NSCarriageReturnCharacter; break; case java_awt_event_KeyEvent_VK_ENTER : macKey = NSNewlineCharacter; break;
case java_awt_event_KeyEvent_VK_BACK_SPACE : macKey = NSBackspaceCharacter; break; case java_awt_event_KeyEvent_VK_BACK_SPACE : macKey = NSBackspaceCharacter; break;
case java_awt_event_KeyEvent_VK_DELETE : macKey = NSDeleteCharacter; break; case java_awt_event_KeyEvent_VK_DELETE : macKey = NSDeleteCharacter; break;
case java_awt_event_KeyEvent_VK_CLEAR : macKey = NSClearDisplayFunctionKey; break; case java_awt_event_KeyEvent_VK_CLEAR : macKey = NSClearDisplayFunctionKey; break;
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
package com.sun.media.sound; package com.sun.media.sound;
import java.util.Arrays;
import javax.sound.sampled.*; import javax.sound.sampled.*;
/** /**
...@@ -46,11 +48,11 @@ public final class DataPusher implements Runnable { ...@@ -46,11 +48,11 @@ public final class DataPusher implements Runnable {
private final AudioFormat format; private final AudioFormat format;
// stream as source data // stream as source data
private AudioInputStream ais = null; private final AudioInputStream ais;
// byte array as source data // byte array as source data
private byte[] audioData = null; private final byte[] audioData;
private int audioDataByteLength = 0; private final int audioDataByteLength;
private int pos; private int pos;
private int newPos = -1; private int newPos = -1;
private boolean looping; private boolean looping;
...@@ -67,16 +69,22 @@ public final class DataPusher implements Runnable { ...@@ -67,16 +69,22 @@ public final class DataPusher implements Runnable {
private final int BUFFER_SIZE = 16384; private final int BUFFER_SIZE = 16384;
public DataPusher(SourceDataLine sourceLine, AudioFormat format, byte[] audioData, int byteLength) { public DataPusher(SourceDataLine sourceLine, AudioFormat format, byte[] audioData, int byteLength) {
this.audioData = audioData; this(sourceLine, format, null, audioData, byteLength);
this.audioDataByteLength = byteLength;
this.format = format;
this.source = sourceLine;
} }
public DataPusher(SourceDataLine sourceLine, AudioInputStream ais) { public DataPusher(SourceDataLine sourceLine, AudioInputStream ais) {
this(sourceLine, ais.getFormat(), ais, null, 0);
}
private DataPusher(final SourceDataLine source, final AudioFormat format,
final AudioInputStream ais, final byte[] audioData,
final int audioDataByteLength) {
this.source = source;
this.format = format;
this.ais = ais; this.ais = ais;
this.format = ais.getFormat(); this.audioDataByteLength = audioDataByteLength;
this.source = sourceLine; this.audioData = audioData == null ? null : Arrays.copyOf(audioData,
audioData.length);
} }
public synchronized void start() { public synchronized void start() {
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
package com.sun.media.sound; package com.sun.media.sound;
import java.util.Arrays;
/** /**
* A standard director who chooses performers * A standard director who chooses performers
* by there keyfrom,keyto,velfrom,velto properties. * by there keyfrom,keyto,velfrom,velto properties.
...@@ -32,17 +34,16 @@ package com.sun.media.sound; ...@@ -32,17 +34,16 @@ package com.sun.media.sound;
*/ */
public final class ModelStandardDirector implements ModelDirector { public final class ModelStandardDirector implements ModelDirector {
ModelPerformer[] performers; private final ModelPerformer[] performers;
ModelDirectedPlayer player; private final ModelDirectedPlayer player;
boolean noteOnUsed = false; private boolean noteOnUsed = false;
boolean noteOffUsed = false; private boolean noteOffUsed = false;
public ModelStandardDirector(ModelPerformer[] performers, public ModelStandardDirector(final ModelPerformer[] performers,
ModelDirectedPlayer player) { final ModelDirectedPlayer player) {
this.performers = performers; this.performers = Arrays.copyOf(performers, performers.length);
this.player = player; this.player = player;
for (int i = 0; i < performers.length; i++) { for (final ModelPerformer p : this.performers) {
ModelPerformer p = performers[i];
if (p.isReleaseTriggered()) { if (p.isReleaseTriggered()) {
noteOffUsed = true; noteOffUsed = true;
} else { } else {
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
package com.sun.media.sound; package com.sun.media.sound;
import java.util.Arrays;
/** /**
* A standard indexed director who chooses performers * A standard indexed director who chooses performers
* by there keyfrom,keyto,velfrom,velto properties. * by there keyfrom,keyto,velfrom,velto properties.
...@@ -32,22 +34,21 @@ package com.sun.media.sound; ...@@ -32,22 +34,21 @@ package com.sun.media.sound;
*/ */
public final class ModelStandardIndexedDirector implements ModelDirector { public final class ModelStandardIndexedDirector implements ModelDirector {
ModelPerformer[] performers; private final ModelPerformer[] performers;
ModelDirectedPlayer player; private final ModelDirectedPlayer player;
boolean noteOnUsed = false; private boolean noteOnUsed = false;
boolean noteOffUsed = false; private boolean noteOffUsed = false;
// Variables needed for index // Variables needed for index
byte[][] trantables; private byte[][] trantables;
int[] counters; private int[] counters;
int[][] mat; private int[][] mat;
public ModelStandardIndexedDirector(ModelPerformer[] performers, public ModelStandardIndexedDirector(final ModelPerformer[] performers,
ModelDirectedPlayer player) { final ModelDirectedPlayer player) {
this.performers = performers; this.performers = Arrays.copyOf(performers, performers.length);
this.player = player; this.player = player;
for (int i = 0; i < performers.length; i++) { for (final ModelPerformer p : this.performers) {
ModelPerformer p = performers[i];
if (p.isReleaseTriggered()) { if (p.isReleaseTriggered()) {
noteOffUsed = true; noteOffUsed = true;
} else { } else {
......
...@@ -38,7 +38,7 @@ import javax.sound.sampled.LineEvent; ...@@ -38,7 +38,7 @@ import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.LineUnavailableException;
/** /**
* Clip implemention for the SoftMixingMixer. * Clip implementation for the SoftMixingMixer.
* *
* @author Karl Helgason * @author Karl Helgason
*/ */
...@@ -357,7 +357,9 @@ public final class SoftMixingClip extends SoftMixingDataLine implements Clip { ...@@ -357,7 +357,9 @@ public final class SoftMixingClip extends SoftMixingDataLine implements Clip {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Buffer size does not represent an integral number of sample frames!"); "Buffer size does not represent an integral number of sample frames!");
this.data = data; if (data != null) {
this.data = Arrays.copyOf(data, data.length);
}
this.offset = offset; this.offset = offset;
this.bufferSize = bufferSize; this.bufferSize = bufferSize;
this.format = format; this.format = format;
......
...@@ -2426,7 +2426,8 @@ public abstract class KeyboardFocusManager ...@@ -2426,7 +2426,8 @@ public abstract class KeyboardFocusManager
focusLog.finest("Request {0}", String.valueOf(hwFocusRequest)); focusLog.finest("Request {0}", String.valueOf(hwFocusRequest));
} }
if (hwFocusRequest == null && if (hwFocusRequest == null &&
heavyweight == nativeFocusOwner) heavyweight == nativeFocusOwner &&
heavyweight.getContainingWindow() == nativeFocusedWindow)
{ {
if (descendant == currentFocusOwner) { if (descendant == currentFocusOwner) {
// Redundant request. // Redundant request.
......
...@@ -62,18 +62,18 @@ import sun.security.util.SecurityConstants; ...@@ -62,18 +62,18 @@ import sun.security.util.SecurityConstants;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
/** /**
* A <code>Window</code> object is a top-level window with no borders and no * A {@code Window} object is a top-level window with no borders and no
* menubar. * menubar.
* The default layout for a window is <code>BorderLayout</code>. * The default layout for a window is {@code BorderLayout}.
* <p> * <p>
* A window must have either a frame, dialog, or another window defined as its * A window must have either a frame, dialog, or another window defined as its
* owner when it's constructed. * owner when it's constructed.
* <p> * <p>
* In a multi-screen environment, you can create a <code>Window</code> * In a multi-screen environment, you can create a {@code Window}
* on a different screen device by constructing the <code>Window</code> * on a different screen device by constructing the {@code Window}
* with {@link #Window(Window, GraphicsConfiguration)}. The * with {@link #Window(Window, GraphicsConfiguration)}. The
* <code>GraphicsConfiguration</code> object is one of the * {@code GraphicsConfiguration} object is one of the
* <code>GraphicsConfiguration</code> objects of the target screen device. * {@code GraphicsConfiguration} objects of the target screen device.
* <p> * <p>
* In a virtual device multi-screen environment in which the desktop * In a virtual device multi-screen environment in which the desktop
* area could span multiple physical screen devices, the bounds of all * area could span multiple physical screen devices, the bounds of all
...@@ -87,21 +87,21 @@ import sun.util.logging.PlatformLogger; ...@@ -87,21 +87,21 @@ import sun.util.logging.PlatformLogger;
* alt="Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100)." * alt="Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100)."
* ALIGN=center HSPACE=10 VSPACE=7> * ALIGN=center HSPACE=10 VSPACE=7>
* <p> * <p>
* In such an environment, when calling <code>setLocation</code>, * In such an environment, when calling {@code setLocation},
* you must pass a virtual coordinate to this method. Similarly, * you must pass a virtual coordinate to this method. Similarly,
* calling <code>getLocationOnScreen</code> on a <code>Window</code> returns * calling {@code getLocationOnScreen} on a {@code Window} returns
* virtual device coordinates. Call the <code>getBounds</code> method * virtual device coordinates. Call the {@code getBounds} method
* of a <code>GraphicsConfiguration</code> to find its origin in the virtual * of a {@code GraphicsConfiguration} to find its origin in the virtual
* coordinate system. * coordinate system.
* <p> * <p>
* The following code sets the location of a <code>Window</code> * The following code sets the location of a {@code Window}
* at (10, 10) relative to the origin of the physical screen * at (10, 10) relative to the origin of the physical screen
* of the corresponding <code>GraphicsConfiguration</code>. If the * of the corresponding {@code GraphicsConfiguration}. If the
* bounds of the <code>GraphicsConfiguration</code> is not taken * bounds of the {@code GraphicsConfiguration} is not taken
* into account, the <code>Window</code> location would be set * into account, the {@code Window} location would be set
* at (10, 10) relative to the virtual-coordinate system and would appear * at (10, 10) relative to the virtual-coordinate system and would appear
* on the primary physical screen, which might be different from the * on the primary physical screen, which might be different from the
* physical screen of the specified <code>GraphicsConfiguration</code>. * physical screen of the specified {@code GraphicsConfiguration}.
* *
* <pre> * <pre>
* Window w = new Window(Window owner, GraphicsConfiguration gc); * Window w = new Window(Window owner, GraphicsConfiguration gc);
...@@ -111,19 +111,19 @@ import sun.util.logging.PlatformLogger; ...@@ -111,19 +111,19 @@ import sun.util.logging.PlatformLogger;
* *
* <p> * <p>
* Note: the location and size of top-level windows (including * Note: the location and size of top-level windows (including
* <code>Window</code>s, <code>Frame</code>s, and <code>Dialog</code>s) * {@code Window}s, {@code Frame}s, and {@code Dialog}s)
* are under the control of the desktop's window management system. * are under the control of the desktop's window management system.
* Calls to <code>setLocation</code>, <code>setSize</code>, and * Calls to {@code setLocation}, {@code setSize}, and
* <code>setBounds</code> are requests (not directives) which are * {@code setBounds} are requests (not directives) which are
* forwarded to the window management system. Every effort will be * forwarded to the window management system. Every effort will be
* made to honor such requests. However, in some cases the window * made to honor such requests. However, in some cases the window
* management system may ignore such requests, or modify the requested * management system may ignore such requests, or modify the requested
* geometry in order to place and size the <code>Window</code> in a way * geometry in order to place and size the {@code Window} in a way
* that more closely matches the desktop settings. * that more closely matches the desktop settings.
* <p> * <p>
* Due to the asynchronous nature of native event handling, the results * Due to the asynchronous nature of native event handling, the results
* returned by <code>getBounds</code>, <code>getLocation</code>, * returned by {@code getBounds}, {@code getLocation},
* <code>getLocationOnScreen</code>, and <code>getSize</code> might not * {@code getLocationOnScreen}, and {@code getSize} might not
* reflect the actual geometry of the Window on screen until the last * reflect the actual geometry of the Window on screen until the last
* request has been processed. During the processing of subsequent * request has been processed. During the processing of subsequent
* requests these values might change accordingly while the window * requests these values might change accordingly while the window
...@@ -340,7 +340,7 @@ public class Window extends Container implements Accessible { ...@@ -340,7 +340,7 @@ public class Window extends Container implements Accessible {
*/ */
transient boolean isInShow = false; transient boolean isInShow = false;
/* /**
* The opacity level of the window * The opacity level of the window
* *
* @serial * @serial
...@@ -350,7 +350,7 @@ public class Window extends Container implements Accessible { ...@@ -350,7 +350,7 @@ public class Window extends Container implements Accessible {
*/ */
private float opacity = 1.0f; private float opacity = 1.0f;
/* /**
* The shape assigned to this window. This field is set to {@code null} if * The shape assigned to this window. This field is set to {@code null} if
* no shape is set (rectangular window). * no shape is set (rectangular window).
* *
...@@ -415,21 +415,21 @@ public class Window extends Container implements Accessible { ...@@ -415,21 +415,21 @@ public class Window extends Container implements Accessible {
/** /**
* Constructs a new, initially invisible window in default size with the * Constructs a new, initially invisible window in default size with the
* specified <code>GraphicsConfiguration</code>. * specified {@code GraphicsConfiguration}.
* <p> * <p>
* If there is a security manager, this method first calls * If there is a security manager, this method first calls
* the security manager's <code>checkTopLevelWindow</code> * the security manager's {@code checkTopLevelWindow}
* method with <code>this</code> * method with {@code this}
* as its argument to determine whether or not the window * as its argument to determine whether or not the window
* must be displayed with a warning banner. * must be displayed with a warning banner.
* *
* @param gc the <code>GraphicsConfiguration</code> of the target screen * @param gc the {@code GraphicsConfiguration} of the target screen
* device. If <code>gc</code> is <code>null</code>, the system default * device. If {@code gc} is {@code null}, the system default
* <code>GraphicsConfiguration</code> is assumed * {@code GraphicsConfiguration} is assumed
* @exception IllegalArgumentException if <code>gc</code> * @exception IllegalArgumentException if {@code gc}
* is not from a screen device * is not from a screen device
* @exception HeadlessException when * @exception HeadlessException when
* <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * {@code GraphicsEnvironment.isHeadless()} returns {@code true}
* *
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see java.lang.SecurityManager#checkTopLevelWindow * @see java.lang.SecurityManager#checkTopLevelWindow
...@@ -513,20 +513,20 @@ public class Window extends Container implements Accessible { ...@@ -513,20 +513,20 @@ public class Window extends Container implements Accessible {
* Constructs a new, initially invisible window in the default size. * Constructs a new, initially invisible window in the default size.
* *
* <p>First, if there is a security manager, its * <p>First, if there is a security manager, its
* <code>checkTopLevelWindow</code> * {@code checkTopLevelWindow}
* method is called with <code>this</code> * method is called with {@code this}
* as its argument * as its argument
* to see if it's ok to display the window without a warning banner. * to see if it's ok to display the window without a warning banner.
* If the default implementation of <code>checkTopLevelWindow</code> * If the default implementation of {@code checkTopLevelWindow}
* is used (that is, that method is not overriden), then this results in * is used (that is, that method is not overriden), then this results in
* a call to the security manager's <code>checkPermission</code> method * a call to the security manager's {@code checkPermission} method
* with an <code>AWTPermission("showWindowWithoutWarningBanner")</code> * with an {@code AWTPermission("showWindowWithoutWarningBanner")}
* permission. It that method raises a SecurityException, * permission. It that method raises a SecurityException,
* <code>checkTopLevelWindow</code> returns false, otherwise it * {@code checkTopLevelWindow} returns false, otherwise it
* returns true. If it returns false, a warning banner is created. * returns true. If it returns false, a warning banner is created.
* *
* @exception HeadlessException when * @exception HeadlessException when
* <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * {@code GraphicsEnvironment.isHeadless()} returns {@code true}
* *
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see java.lang.SecurityManager#checkTopLevelWindow * @see java.lang.SecurityManager#checkTopLevelWindow
...@@ -538,21 +538,21 @@ public class Window extends Container implements Accessible { ...@@ -538,21 +538,21 @@ public class Window extends Container implements Accessible {
/** /**
* Constructs a new, initially invisible window with the specified * Constructs a new, initially invisible window with the specified
* <code>Frame</code> as its owner. The window will not be focusable * {@code Frame} as its owner. The window will not be focusable
* unless its owner is showing on the screen. * unless its owner is showing on the screen.
* <p> * <p>
* If there is a security manager, this method first calls * If there is a security manager, this method first calls
* the security manager's <code>checkTopLevelWindow</code> * the security manager's {@code checkTopLevelWindow}
* method with <code>this</code> * method with {@code this}
* as its argument to determine whether or not the window * as its argument to determine whether or not the window
* must be displayed with a warning banner. * must be displayed with a warning banner.
* *
* @param owner the <code>Frame</code> to act as owner or <code>null</code> * @param owner the {@code Frame} to act as owner or {@code null}
* if this window has no owner * if this window has no owner
* @exception IllegalArgumentException if the <code>owner</code>'s * @exception IllegalArgumentException if the {@code owner}'s
* <code>GraphicsConfiguration</code> is not from a screen device * {@code GraphicsConfiguration} is not from a screen device
* @exception HeadlessException when * @exception HeadlessException when
* <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> * {@code GraphicsEnvironment.isHeadless} returns {@code true}
* *
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see java.lang.SecurityManager#checkTopLevelWindow * @see java.lang.SecurityManager#checkTopLevelWindow
...@@ -566,23 +566,23 @@ public class Window extends Container implements Accessible { ...@@ -566,23 +566,23 @@ public class Window extends Container implements Accessible {
/** /**
* Constructs a new, initially invisible window with the specified * Constructs a new, initially invisible window with the specified
* <code>Window</code> as its owner. This window will not be focusable * {@code Window} as its owner. This window will not be focusable
* unless its nearest owning <code>Frame</code> or <code>Dialog</code> * unless its nearest owning {@code Frame} or {@code Dialog}
* is showing on the screen. * is showing on the screen.
* <p> * <p>
* If there is a security manager, this method first calls * If there is a security manager, this method first calls
* the security manager's <code>checkTopLevelWindow</code> * the security manager's {@code checkTopLevelWindow}
* method with <code>this</code> * method with {@code this}
* as its argument to determine whether or not the window * as its argument to determine whether or not the window
* must be displayed with a warning banner. * must be displayed with a warning banner.
* *
* @param owner the <code>Window</code> to act as owner or * @param owner the {@code Window} to act as owner or
* <code>null</code> if this window has no owner * {@code null} if this window has no owner
* @exception IllegalArgumentException if the <code>owner</code>'s * @exception IllegalArgumentException if the {@code owner}'s
* <code>GraphicsConfiguration</code> is not from a screen device * {@code GraphicsConfiguration} is not from a screen device
* @exception HeadlessException when * @exception HeadlessException when
* <code>GraphicsEnvironment.isHeadless()</code> returns * {@code GraphicsEnvironment.isHeadless()} returns
* <code>true</code> * {@code true}
* *
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see java.lang.SecurityManager#checkTopLevelWindow * @see java.lang.SecurityManager#checkTopLevelWindow
...@@ -598,27 +598,27 @@ public class Window extends Container implements Accessible { ...@@ -598,27 +598,27 @@ public class Window extends Container implements Accessible {
/** /**
* Constructs a new, initially invisible window with the specified owner * Constructs a new, initially invisible window with the specified owner
* <code>Window</code> and a <code>GraphicsConfiguration</code> * {@code Window} and a {@code GraphicsConfiguration}
* of a screen device. The Window will not be focusable unless * of a screen device. The Window will not be focusable unless
* its nearest owning <code>Frame</code> or <code>Dialog</code> * its nearest owning {@code Frame} or {@code Dialog}
* is showing on the screen. * is showing on the screen.
* <p> * <p>
* If there is a security manager, this method first calls * If there is a security manager, this method first calls
* the security manager's <code>checkTopLevelWindow</code> * the security manager's {@code checkTopLevelWindow}
* method with <code>this</code> * method with {@code this}
* as its argument to determine whether or not the window * as its argument to determine whether or not the window
* must be displayed with a warning banner. * must be displayed with a warning banner.
* *
* @param owner the window to act as owner or <code>null</code> * @param owner the window to act as owner or {@code null}
* if this window has no owner * if this window has no owner
* @param gc the <code>GraphicsConfiguration</code> of the target * @param gc the {@code GraphicsConfiguration} of the target
* screen device; if <code>gc</code> is <code>null</code>, * screen device; if {@code gc} is {@code null},
* the system default <code>GraphicsConfiguration</code> is assumed * the system default {@code GraphicsConfiguration} is assumed
* @exception IllegalArgumentException if <code>gc</code> * @exception IllegalArgumentException if {@code gc}
* is not from a screen device * is not from a screen device
* @exception HeadlessException when * @exception HeadlessException when
* <code>GraphicsEnvironment.isHeadless()</code> returns * {@code GraphicsEnvironment.isHeadless()} returns
* <code>true</code> * {@code true}
* *
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see java.lang.SecurityManager#checkTopLevelWindow * @see java.lang.SecurityManager#checkTopLevelWindow
...@@ -936,7 +936,7 @@ public class Window extends Container implements Accessible { ...@@ -936,7 +936,7 @@ public class Window extends Container implements Accessible {
/** /**
* @deprecated As of JDK version 1.1, * @deprecated As of JDK version 1.1,
* replaced by <code>setBounds(int, int, int, int)</code>. * replaced by {@code setBounds(int, int, int, int)}.
*/ */
@Deprecated @Deprecated
public void reshape(int x, int y, int width, int height) { public void reshape(int x, int y, int width, int height) {
...@@ -1122,16 +1122,16 @@ public class Window extends Container implements Accessible { ...@@ -1122,16 +1122,16 @@ public class Window extends Container implements Accessible {
/** /**
* Releases all of the native screen resources used by this * Releases all of the native screen resources used by this
* <code>Window</code>, its subcomponents, and all of its owned * {@code Window}, its subcomponents, and all of its owned
* children. That is, the resources for these <code>Component</code>s * children. That is, the resources for these {@code Component}s
* will be destroyed, any memory they consume will be returned to the * will be destroyed, any memory they consume will be returned to the
* OS, and they will be marked as undisplayable. * OS, and they will be marked as undisplayable.
* <p> * <p>
* The <code>Window</code> and its subcomponents can be made displayable * The {@code Window} and its subcomponents can be made displayable
* again by rebuilding the native resources with a subsequent call to * again by rebuilding the native resources with a subsequent call to
* <code>pack</code> or <code>show</code>. The states of the recreated * {@code pack} or {@code show}. The states of the recreated
* <code>Window</code> and its subcomponents will be identical to the * {@code Window} and its subcomponents will be identical to the
* states of these objects at the point where the <code>Window</code> * states of these objects at the point where the {@code Window}
* was disposed (not accounting for additional modifications between * was disposed (not accounting for additional modifications between
* those actions). * those actions).
* <p> * <p>
...@@ -1363,14 +1363,14 @@ public class Window extends Container implements Accessible { ...@@ -1363,14 +1363,14 @@ public class Window extends Container implements Accessible {
* If this window is insecure, the warning string is displayed * If this window is insecure, the warning string is displayed
* somewhere in the visible area of the window. A window is * somewhere in the visible area of the window. A window is
* insecure if there is a security manager, and the security * insecure if there is a security manager, and the security
* manager's <code>checkTopLevelWindow</code> method returns * manager's {@code checkTopLevelWindow} method returns
* <code>false</code> when this window is passed to it as an * {@code false} when this window is passed to it as an
* argument. * argument.
* <p> * <p>
* If the window is secure, then <code>getWarningString</code> * If the window is secure, then {@code getWarningString}
* returns <code>null</code>. If the window is insecure, this * returns {@code null}. If the window is insecure, this
* method checks for the system property * method checks for the system property
* <code>awt.appletWarning</code> * {@code awt.appletWarning}
* and returns the string value of that property. * and returns the string value of that property.
* @return the warning string for this window. * @return the warning string for this window.
* @see java.lang.SecurityManager#checkTopLevelWindow(java.lang.Object) * @see java.lang.SecurityManager#checkTopLevelWindow(java.lang.Object)
...@@ -1395,7 +1395,7 @@ public class Window extends Container implements Accessible { ...@@ -1395,7 +1395,7 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Gets the <code>Locale</code> object that is associated * Gets the {@code Locale} object that is associated
* with this window, if the locale has been set. * with this window, if the locale has been set.
* If no locale has been set, then the default locale * If no locale has been set, then the default locale
* is returned. * is returned.
...@@ -1432,7 +1432,7 @@ public class Window extends Container implements Accessible { ...@@ -1432,7 +1432,7 @@ public class Window extends Container implements Accessible {
* implementation and/or the native system do not support * implementation and/or the native system do not support
* changing the mouse cursor shape. * changing the mouse cursor shape.
* @param cursor One of the constants defined * @param cursor One of the constants defined
* by the <code>Cursor</code> class. If this parameter is null * by the {@code Cursor} class. If this parameter is null
* then the cursor for this window will be set to the type * then the cursor for this window will be set to the type
* Cursor.DEFAULT_CURSOR. * Cursor.DEFAULT_CURSOR.
* @see Component#getCursor * @see Component#getCursor
...@@ -1579,7 +1579,7 @@ public class Window extends Container implements Accessible { ...@@ -1579,7 +1579,7 @@ public class Window extends Container implements Accessible {
* <b>Warning:</b> this method may return system created windows, such * <b>Warning:</b> this method may return system created windows, such
* as a print dialog. Applications should not assume the existence of * as a print dialog. Applications should not assume the existence of
* these dialogs, nor should an application assume anything about these * these dialogs, nor should an application assume anything about these
* dialogs such as component positions, <code>LayoutManager</code>s * dialogs such as component positions, {@code LayoutManager}s
* or serialization. * or serialization.
* *
* @see Frame#getFrames * @see Frame#getFrames
...@@ -1601,7 +1601,7 @@ public class Window extends Container implements Accessible { ...@@ -1601,7 +1601,7 @@ public class Window extends Container implements Accessible {
* <b>Warning:</b> this method may return system created windows, such * <b>Warning:</b> this method may return system created windows, such
* as a print dialog. Applications should not assume the existence of * as a print dialog. Applications should not assume the existence of
* these dialogs, nor should an application assume anything about these * these dialogs, nor should an application assume anything about these
* dialogs such as component positions, <code>LayoutManager</code>s * dialogs such as component positions, {@code LayoutManager}s
* or serialization. * or serialization.
* *
* @see Frame#getFrames * @see Frame#getFrames
...@@ -1646,17 +1646,17 @@ public class Window extends Container implements Accessible { ...@@ -1646,17 +1646,17 @@ public class Window extends Container implements Accessible {
* java.awt.Dialog.ModalExclusionType Dialog.ModalExclusionType} for * java.awt.Dialog.ModalExclusionType Dialog.ModalExclusionType} for
* possible modal exclusion types. * possible modal exclusion types.
* <p> * <p>
* If the given type is not supported, <code>NO_EXCLUDE</code> is used. * If the given type is not supported, {@code NO_EXCLUDE} is used.
* <p> * <p>
* Note: changing the modal exclusion type for a visible window may have no * Note: changing the modal exclusion type for a visible window may have no
* effect until it is hidden and then shown again. * effect until it is hidden and then shown again.
* *
* @param exclusionType the modal exclusion type for this window; a <code>null</code> * @param exclusionType the modal exclusion type for this window; a {@code null}
* value is equivivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE * value is equivivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE
* NO_EXCLUDE} * NO_EXCLUDE}
* @throws SecurityException if the calling thread does not have permission * @throws SecurityException if the calling thread does not have permission
* to set the modal exclusion property to the window with the given * to set the modal exclusion property to the window with the given
* <code>exclusionType</code> * {@code exclusionType}
* @see java.awt.Dialog.ModalExclusionType * @see java.awt.Dialog.ModalExclusionType
* @see java.awt.Window#getModalExclusionType * @see java.awt.Window#getModalExclusionType
* @see java.awt.Toolkit#isModalExclusionTypeSupported * @see java.awt.Toolkit#isModalExclusionTypeSupported
...@@ -1762,7 +1762,7 @@ public class Window extends Container implements Accessible { ...@@ -1762,7 +1762,7 @@ public class Window extends Container implements Accessible {
/** /**
* Adds the specified window state listener to receive window * Adds the specified window state listener to receive window
* events from this window. If <code>l</code> is <code>null</code>, * events from this window. If {@code l} is {@code null},
* no exception is thrown and no action is performed. * no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model. * >AWT Threading Issues</a> for details on AWT's threading model.
...@@ -1821,7 +1821,7 @@ public class Window extends Container implements Accessible { ...@@ -1821,7 +1821,7 @@ public class Window extends Container implements Accessible {
/** /**
* Removes the specified window state listener so that it no * Removes the specified window state listener so that it no
* longer receives window events from this window. If * longer receives window events from this window. If
* <code>l</code> is <code>null</code>, no exception is thrown and * {@code l} is {@code null}, no exception is thrown and
* no action is performed. * no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model. * >AWT Threading Issues</a> for details on AWT's threading model.
...@@ -1861,7 +1861,7 @@ public class Window extends Container implements Accessible { ...@@ -1861,7 +1861,7 @@ public class Window extends Container implements Accessible {
* Returns an array of all the window listeners * Returns an array of all the window listeners
* registered on this window. * registered on this window.
* *
* @return all of this window's <code>WindowListener</code>s * @return all of this window's {@code WindowListener}s
* or an empty array if no window * or an empty array if no window
* listeners are currently registered * listeners are currently registered
* *
...@@ -1877,7 +1877,7 @@ public class Window extends Container implements Accessible { ...@@ -1877,7 +1877,7 @@ public class Window extends Container implements Accessible {
* Returns an array of all the window focus listeners * Returns an array of all the window focus listeners
* registered on this window. * registered on this window.
* *
* @return all of this window's <code>WindowFocusListener</code>s * @return all of this window's {@code WindowFocusListener}s
* or an empty array if no window focus * or an empty array if no window focus
* listeners are currently registered * listeners are currently registered
* *
...@@ -1893,7 +1893,7 @@ public class Window extends Container implements Accessible { ...@@ -1893,7 +1893,7 @@ public class Window extends Container implements Accessible {
* Returns an array of all the window state listeners * Returns an array of all the window state listeners
* registered on this window. * registered on this window.
* *
* @return all of this window's <code>WindowStateListener</code>s * @return all of this window's {@code WindowStateListener}s
* or an empty array if no window state * or an empty array if no window state
* listeners are currently registered * listeners are currently registered
* *
...@@ -1909,17 +1909,17 @@ public class Window extends Container implements Accessible { ...@@ -1909,17 +1909,17 @@ public class Window extends Container implements Accessible {
/** /**
* Returns an array of all the objects currently registered * Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s * as <code><em>Foo</em>Listener</code>s
* upon this <code>Window</code>. * upon this {@code Window}.
* <code><em>Foo</em>Listener</code>s are registered using the * <code><em>Foo</em>Listener</code>s are registered using the
* <code>add<em>Foo</em>Listener</code> method. * <code>add<em>Foo</em>Listener</code> method.
* *
* <p> * <p>
* *
* You can specify the <code>listenerType</code> argument * You can specify the {@code listenerType} argument
* with a class literal, such as * with a class literal, such as
* <code><em>Foo</em>Listener.class</code>. * <code><em>Foo</em>Listener.class</code>.
* For example, you can query a * For example, you can query a
* <code>Window</code> <code>w</code> * {@code Window} {@code w}
* for its window listeners with the following code: * for its window listeners with the following code:
* *
* <pre>WindowListener[] wls = (WindowListener[])(w.getListeners(WindowListener.class));</pre> * <pre>WindowListener[] wls = (WindowListener[])(w.getListeners(WindowListener.class));</pre>
...@@ -1928,14 +1928,14 @@ public class Window extends Container implements Accessible { ...@@ -1928,14 +1928,14 @@ public class Window extends Container implements Accessible {
* *
* @param listenerType the type of listeners requested; this parameter * @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from * should specify an interface that descends from
* <code>java.util.EventListener</code> * {@code java.util.EventListener}
* @return an array of all objects registered as * @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this window, * <code><em>Foo</em>Listener</code>s on this window,
* or an empty array if no such * or an empty array if no such
* listeners have been added * listeners have been added
* @exception ClassCastException if <code>listenerType</code> * @exception ClassCastException if {@code listenerType}
* doesn't specify a class or interface that implements * doesn't specify a class or interface that implements
* <code>java.util.EventListener</code> * {@code java.util.EventListener}
* @exception NullPointerException if {@code listenerType} is {@code null} * @exception NullPointerException if {@code listenerType} is {@code null}
* *
* @see #getWindowListeners * @see #getWindowListeners
...@@ -1991,10 +1991,10 @@ public class Window extends Container implements Accessible { ...@@ -1991,10 +1991,10 @@ public class Window extends Container implements Accessible {
/** /**
* Processes events on this window. If the event is an * Processes events on this window. If the event is an
* <code>WindowEvent</code>, it invokes the * {@code WindowEvent}, it invokes the
* <code>processWindowEvent</code> method, else it invokes its * {@code processWindowEvent} method, else it invokes its
* superclass's <code>processEvent</code>. * superclass's {@code processEvent}.
* <p>Note that if the event parameter is <code>null</code> * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an * the behavior is unspecified and may result in an
* exception. * exception.
* *
...@@ -2033,10 +2033,10 @@ public class Window extends Container implements Accessible { ...@@ -2033,10 +2033,10 @@ public class Window extends Container implements Accessible {
* following occurs: * following occurs:
* <ul> * <ul>
* <li>A WindowListener object is registered via * <li>A WindowListener object is registered via
* <code>addWindowListener</code> * {@code addWindowListener}
* <li>Window events are enabled via <code>enableEvents</code> * <li>Window events are enabled via {@code enableEvents}
* </ul> * </ul>
* <p>Note that if the event parameter is <code>null</code> * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an * the behavior is unspecified and may result in an
* exception. * exception.
* *
...@@ -2082,10 +2082,10 @@ public class Window extends Container implements Accessible { ...@@ -2082,10 +2082,10 @@ public class Window extends Container implements Accessible {
* following occurs: * following occurs:
* <ul> * <ul>
* <li>a WindowFocusListener is registered via * <li>a WindowFocusListener is registered via
* <code>addWindowFocusListener</code> * {@code addWindowFocusListener}
* <li>Window focus events are enabled via <code>enableEvents</code> * <li>Window focus events are enabled via {@code enableEvents}
* </ul> * </ul>
* <p>Note that if the event parameter is <code>null</code> * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an * the behavior is unspecified and may result in an
* exception. * exception.
* *
...@@ -2111,17 +2111,17 @@ public class Window extends Container implements Accessible { ...@@ -2111,17 +2111,17 @@ public class Window extends Container implements Accessible {
/** /**
* Processes window state event occuring on this window by * Processes window state event occuring on this window by
* dispatching them to any registered <code>WindowStateListener</code> * dispatching them to any registered {@code WindowStateListener}
* objects. * objects.
* NOTE: this method will not be called unless window state events * NOTE: this method will not be called unless window state events
* are enabled for this window. This happens when one of the * are enabled for this window. This happens when one of the
* following occurs: * following occurs:
* <ul> * <ul>
* <li>a <code>WindowStateListener</code> is registered via * <li>a {@code WindowStateListener} is registered via
* <code>addWindowStateListener</code> * {@code addWindowStateListener}
* <li>window state events are enabled via <code>enableEvents</code> * <li>window state events are enabled via {@code enableEvents}
* </ul> * </ul>
* <p>Note that if the event parameter is <code>null</code> * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an * the behavior is unspecified and may result in an
* exception. * exception.
* *
...@@ -2145,7 +2145,7 @@ public class Window extends Container implements Accessible { ...@@ -2145,7 +2145,7 @@ public class Window extends Container implements Accessible {
/** /**
* Implements a debugging hook -- checks to see if * Implements a debugging hook -- checks to see if
* the user has typed <i>control-shift-F1</i>. If so, * the user has typed <i>control-shift-F1</i>. If so,
* the list of child windows is dumped to <code>System.out</code>. * the list of child windows is dumped to {@code System.out}.
* @param e the keyboard event * @param e the keyboard event
*/ */
void preProcessKeyEvent(KeyEvent e) { void preProcessKeyEvent(KeyEvent e) {
...@@ -2176,21 +2176,21 @@ public class Window extends Container implements Accessible { ...@@ -2176,21 +2176,21 @@ public class Window extends Container implements Accessible {
* automatically become always-on-top. If a window ceases to be * automatically become always-on-top. If a window ceases to be
* always-on-top, the windows that it owns will no longer be * always-on-top, the windows that it owns will no longer be
* always-on-top. When an always-on-top window is sent {@link #toBack * always-on-top. When an always-on-top window is sent {@link #toBack
* toBack}, its always-on-top state is set to <code>false</code>. * toBack}, its always-on-top state is set to {@code false}.
* *
* <p> When this method is called on a window with a value of * <p> When this method is called on a window with a value of
* <code>true</code>, and the window is visible and the platform * {@code true}, and the window is visible and the platform
* supports always-on-top for this window, the window is immediately * supports always-on-top for this window, the window is immediately
* brought forward, "sticking" it in the top-most position. If the * brought forward, "sticking" it in the top-most position. If the
* window isn`t currently visible, this method sets the always-on-top * window isn`t currently visible, this method sets the always-on-top
* state to <code>true</code> but does not bring the window forward. * state to {@code true} but does not bring the window forward.
* When the window is later shown, it will be always-on-top. * When the window is later shown, it will be always-on-top.
* *
* <p> When this method is called on a window with a value of * <p> When this method is called on a window with a value of
* <code>false</code> the always-on-top state is set to normal. The * {@code false} the always-on-top state is set to normal. The
* window remains in the top-most position but it`s z-order can be * window remains in the top-most position but it`s z-order can be
* changed as for any other window. Calling this method with a value * changed as for any other window. Calling this method with a value
* of <code>false</code> on a window that has a normal state has no * of {@code false} on a window that has a normal state has no
* effect. Setting the always-on-top state to false has no effect on * effect. Setting the always-on-top state to false has no effect on
* the relative z-order of the windows if there are no other * the relative z-order of the windows if there are no other
* always-on-top windows. * always-on-top windows.
...@@ -2250,9 +2250,9 @@ public class Window extends Container implements Accessible { ...@@ -2250,9 +2250,9 @@ public class Window extends Container implements Accessible {
* window. Some platforms may not support always-on-top windows, some * window. Some platforms may not support always-on-top windows, some
* may support only some kinds of top-level windows; for example, * may support only some kinds of top-level windows; for example,
* a platform may not support always-on-top modal dialogs. * a platform may not support always-on-top modal dialogs.
* @return <code>true</code>, if the always-on-top mode is * @return {@code true}, if the always-on-top mode is
* supported by the toolkit and for this window, * supported by the toolkit and for this window,
* <code>false</code>, if always-on-top mode is not supported * {@code false}, if always-on-top mode is not supported
* for this window or toolkit doesn't support always-on-top windows. * for this window or toolkit doesn't support always-on-top windows.
* @see #setAlwaysOnTop(boolean) * @see #setAlwaysOnTop(boolean)
* @see Toolkit#isAlwaysOnTopSupported * @see Toolkit#isAlwaysOnTopSupported
...@@ -2265,8 +2265,8 @@ public class Window extends Container implements Accessible { ...@@ -2265,8 +2265,8 @@ public class Window extends Container implements Accessible {
/** /**
* Returns whether this window is an always-on-top window. * Returns whether this window is an always-on-top window.
* @return <code>true</code>, if the window is in always-on-top state, * @return {@code true}, if the window is in always-on-top state,
* <code>false</code> otherwise * {@code false} otherwise
* @see #setAlwaysOnTop * @see #setAlwaysOnTop
* @since 1.5 * @since 1.5
*/ */
...@@ -2294,7 +2294,7 @@ public class Window extends Container implements Accessible { ...@@ -2294,7 +2294,7 @@ public class Window extends Container implements Accessible {
/** /**
* Returns the child Component of this Window that will receive the focus * Returns the child Component of this Window that will receive the focus
* when this Window is focused. If this Window is currently focused, this * when this Window is focused. If this Window is currently focused, this
* method returns the same Component as <code>getFocusOwner()</code>. If * method returns the same Component as {@code getFocusOwner()}. If
* this Window is not focused, then the child Component that most recently * this Window is not focused, then the child Component that most recently
* requested focus will be returned. If no child Component has ever * requested focus will be returned. If no child Component has ever
* requested focus, and this is a focusable Window, then this Window's * requested focus, and this is a focusable Window, then this Window's
...@@ -2359,8 +2359,8 @@ public class Window extends Container implements Accessible { ...@@ -2359,8 +2359,8 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Gets a focus traversal key for this Window. (See <code> * Gets a focus traversal key for this Window. (See {@code
* setFocusTraversalKeys</code> for a full description of each key.) * setFocusTraversalKeys} for a full description of each key.)
* <p> * <p>
* If the traversal key has not been explicitly set for this Window, * If the traversal key has not been explicitly set for this Window,
* then this Window's parent's traversal key is returned. If the * then this Window's parent's traversal key is returned. If the
...@@ -2419,10 +2419,10 @@ public class Window extends Container implements Accessible { ...@@ -2419,10 +2419,10 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Always returns <code>true</code> because all Windows must be roots of a * Always returns {@code true} because all Windows must be roots of a
* focus traversal cycle. * focus traversal cycle.
* *
* @return <code>true</code> * @return {@code true}
* @see #setFocusCycleRoot * @see #setFocusCycleRoot
* @see Container#setFocusTraversalPolicy * @see Container#setFocusTraversalPolicy
* @see Container#getFocusTraversalPolicy * @see Container#getFocusTraversalPolicy
...@@ -2433,10 +2433,10 @@ public class Window extends Container implements Accessible { ...@@ -2433,10 +2433,10 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Always returns <code>null</code> because Windows have no ancestors; they * Always returns {@code null} because Windows have no ancestors; they
* represent the top of the Component hierarchy. * represent the top of the Component hierarchy.
* *
* @return <code>null</code> * @return {@code null}
* @see Container#isFocusCycleRoot() * @see Container#isFocusCycleRoot()
* @since 1.4 * @since 1.4
*/ */
...@@ -2448,16 +2448,16 @@ public class Window extends Container implements Accessible { ...@@ -2448,16 +2448,16 @@ public class Window extends Container implements Accessible {
* Returns whether this Window can become the focused Window, that is, * Returns whether this Window can become the focused Window, that is,
* whether this Window or any of its subcomponents can become the focus * whether this Window or any of its subcomponents can become the focus
* owner. For a Frame or Dialog to be focusable, its focusable Window state * owner. For a Frame or Dialog to be focusable, its focusable Window state
* must be set to <code>true</code>. For a Window which is not a Frame or * must be set to {@code true}. For a Window which is not a Frame or
* Dialog to be focusable, its focusable Window state must be set to * Dialog to be focusable, its focusable Window state must be set to
* <code>true</code>, its nearest owning Frame or Dialog must be * {@code true}, its nearest owning Frame or Dialog must be
* showing on the screen, and it must contain at least one Component in * showing on the screen, and it must contain at least one Component in
* its focus traversal cycle. If any of these conditions is not met, then * its focus traversal cycle. If any of these conditions is not met, then
* neither this Window nor any of its subcomponents can become the focus * neither this Window nor any of its subcomponents can become the focus
* owner. * owner.
* *
* @return <code>true</code> if this Window can be the focused Window; * @return {@code true} if this Window can be the focused Window;
* <code>false</code> otherwise * {@code false} otherwise
* @see #getFocusableWindowState * @see #getFocusableWindowState
* @see #setFocusableWindowState * @see #setFocusableWindowState
* @see #isShowing * @see #isShowing
...@@ -2497,16 +2497,16 @@ public class Window extends Container implements Accessible { ...@@ -2497,16 +2497,16 @@ public class Window extends Container implements Accessible {
/** /**
* Returns whether this Window can become the focused Window if it meets * Returns whether this Window can become the focused Window if it meets
* the other requirements outlined in <code>isFocusableWindow</code>. If * the other requirements outlined in {@code isFocusableWindow}. If
* this method returns <code>false</code>, then * this method returns {@code false}, then
* <code>isFocusableWindow</code> will return <code>false</code> as well. * {@code isFocusableWindow} will return {@code false} as well.
* If this method returns <code>true</code>, then * If this method returns {@code true}, then
* <code>isFocusableWindow</code> may return <code>true</code> or * {@code isFocusableWindow} may return {@code true} or
* <code>false</code> depending upon the other requirements which must be * {@code false} depending upon the other requirements which must be
* met in order for a Window to be focusable. * met in order for a Window to be focusable.
* <p> * <p>
* By default, all Windows have a focusable Window state of * By default, all Windows have a focusable Window state of
* <code>true</code>. * {@code true}.
* *
* @return whether this Window can be the focused Window * @return whether this Window can be the focused Window
* @see #isFocusableWindow * @see #isFocusableWindow
...@@ -2521,25 +2521,25 @@ public class Window extends Container implements Accessible { ...@@ -2521,25 +2521,25 @@ public class Window extends Container implements Accessible {
/** /**
* Sets whether this Window can become the focused Window if it meets * Sets whether this Window can become the focused Window if it meets
* the other requirements outlined in <code>isFocusableWindow</code>. If * the other requirements outlined in {@code isFocusableWindow}. If
* this Window's focusable Window state is set to <code>false</code>, then * this Window's focusable Window state is set to {@code false}, then
* <code>isFocusableWindow</code> will return <code>false</code>. If this * {@code isFocusableWindow} will return {@code false}. If this
* Window's focusable Window state is set to <code>true</code>, then * Window's focusable Window state is set to {@code true}, then
* <code>isFocusableWindow</code> may return <code>true</code> or * {@code isFocusableWindow} may return {@code true} or
* <code>false</code> depending upon the other requirements which must be * {@code false} depending upon the other requirements which must be
* met in order for a Window to be focusable. * met in order for a Window to be focusable.
* <p> * <p>
* Setting a Window's focusability state to <code>false</code> is the * Setting a Window's focusability state to {@code false} is the
* standard mechanism for an application to identify to the AWT a Window * standard mechanism for an application to identify to the AWT a Window
* which will be used as a floating palette or toolbar, and thus should be * which will be used as a floating palette or toolbar, and thus should be
* a non-focusable Window. * a non-focusable Window.
* *
* Setting the focusability state on a visible <code>Window</code> * Setting the focusability state on a visible {@code Window}
* can have a delayed effect on some platforms &#151; the actual * can have a delayed effect on some platforms &#151; the actual
* change may happen only when the <code>Window</code> becomes * change may happen only when the {@code Window} becomes
* hidden and then visible again. To ensure consistent behavior * hidden and then visible again. To ensure consistent behavior
* across platforms, set the <code>Window</code>'s focusable state * across platforms, set the {@code Window}'s focusable state
* when the <code>Window</code> is invisible and then show it. * when the {@code Window} is invisible and then show it.
* *
* @param focusableWindowState whether this Window can be the focused * @param focusableWindowState whether this Window can be the focused
* Window * Window
...@@ -2726,7 +2726,7 @@ public class Window extends Container implements Accessible { ...@@ -2726,7 +2726,7 @@ public class Window extends Container implements Accessible {
/** /**
* @deprecated As of JDK version 1.1 * @deprecated As of JDK version 1.1
* replaced by <code>dispatchEvent(AWTEvent)</code>. * replaced by {@code dispatchEvent(AWTEvent)}.
*/ */
@Deprecated @Deprecated
public boolean postEvent(Event e) { public boolean postEvent(Event e) {
...@@ -2876,22 +2876,22 @@ public class Window extends Container implements Accessible { ...@@ -2876,22 +2876,22 @@ public class Window extends Container implements Accessible {
/** /**
* Writes default serializable fields to stream. Writes * Writes default serializable fields to stream. Writes
* a list of serializable <code>WindowListener</code>s and * a list of serializable {@code WindowListener}s and
* <code>WindowFocusListener</code>s as optional data. * {@code WindowFocusListener}s as optional data.
* Writes a list of child windows as optional data. * Writes a list of child windows as optional data.
* Writes a list of icon images as optional data * Writes a list of icon images as optional data
* *
* @param s the <code>ObjectOutputStream</code> to write * @param s the {@code ObjectOutputStream} to write
* @serialData <code>null</code> terminated sequence of * @serialData {@code null} terminated sequence of
* 0 or more pairs; the pair consists of a <code>String</code> * 0 or more pairs; the pair consists of a {@code String}
* and and <code>Object</code>; the <code>String</code> * and {@code Object}; the {@code String}
* indicates the type of object and is one of the following: * indicates the type of object and is one of the following:
* <code>windowListenerK</code> indicating a * {@code windowListenerK} indicating a
* <code>WindowListener</code> object; * {@code WindowListener} object;
* <code>windowFocusWindowK</code> indicating a * {@code windowFocusWindowK} indicating a
* <code>WindowFocusListener</code> object; * {@code WindowFocusListener} object;
* <code>ownedWindowK</code> indicating a child * {@code ownedWindowK} indicating a child
* <code>Window</code> object * {@code Window} object
* *
* @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener)
* @see Component#windowListenerK * @see Component#windowListenerK
...@@ -3029,16 +3029,16 @@ public class Window extends Container implements Accessible { ...@@ -3029,16 +3029,16 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Reads the <code>ObjectInputStream</code> and an optional * Reads the {@code ObjectInputStream} and an optional
* list of listeners to receive various events fired by * list of listeners to receive various events fired by
* the component; also reads a list of * the component; also reads a list of
* (possibly <code>null</code>) child windows. * (possibly {@code null}) child windows.
* Unrecognized keys or values will be ignored. * Unrecognized keys or values will be ignored.
* *
* @param s the <code>ObjectInputStream</code> to read * @param s the {@code ObjectInputStream} to read
* @exception HeadlessException if * @exception HeadlessException if
* <code>GraphicsEnvironment.isHeadless</code> returns * {@code GraphicsEnvironment.isHeadless} returns
* <code>true</code> * {@code true}
* @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.GraphicsEnvironment#isHeadless
* @see #writeObject * @see #writeObject
*/ */
...@@ -3100,7 +3100,7 @@ public class Window extends Container implements Accessible { ...@@ -3100,7 +3100,7 @@ public class Window extends Container implements Accessible {
/** /**
* This class implements accessibility support for the * This class implements accessibility support for the
* <code>Window</code> class. It provides an implementation of the * {@code Window} class. It provides an implementation of the
* Java Accessibility API appropriate to window user-interface elements. * Java Accessibility API appropriate to window user-interface elements.
* @since 1.3 * @since 1.3
*/ */
...@@ -3186,7 +3186,7 @@ public class Window extends Container implements Accessible { ...@@ -3186,7 +3186,7 @@ public class Window extends Container implements Accessible {
* not changed. * not changed.
* <p> * <p>
* <b>Note</b>: If the lower edge of the window is out of the screen, * <b>Note</b>: If the lower edge of the window is out of the screen,
* then the window is placed to the side of the <code>Component</code> * then the window is placed to the side of the {@code Component}
* that is closest to the center of the screen. So if the * that is closest to the center of the screen. So if the
* component is on the right part of the screen, the window * component is on the right part of the screen, the window
* is placed to its left, and vice versa. * is placed to its left, and vice versa.
...@@ -3289,7 +3289,7 @@ public class Window extends Container implements Accessible { ...@@ -3289,7 +3289,7 @@ public class Window extends Container implements Accessible {
* Creates a new strategy for multi-buffering on this component. * Creates a new strategy for multi-buffering on this component.
* Multi-buffering is useful for rendering performance. This method * Multi-buffering is useful for rendering performance. This method
* attempts to create the best strategy available with the number of * attempts to create the best strategy available with the number of
* buffers supplied. It will always create a <code>BufferStrategy</code> * buffers supplied. It will always create a {@code BufferStrategy}
* with that number of buffers. * with that number of buffers.
* A page-flipping strategy is attempted first, then a blitting strategy * A page-flipping strategy is attempted first, then a blitting strategy
* using accelerated buffers. Finally, an unaccelerated blitting * using accelerated buffers. Finally, an unaccelerated blitting
...@@ -3318,13 +3318,13 @@ public class Window extends Container implements Accessible { ...@@ -3318,13 +3318,13 @@ public class Window extends Container implements Accessible {
* is called, the existing buffer strategy for this component is discarded. * is called, the existing buffer strategy for this component is discarded.
* @param numBuffers number of buffers to create, including the front buffer * @param numBuffers number of buffers to create, including the front buffer
* @param caps the required capabilities for creating the buffer strategy; * @param caps the required capabilities for creating the buffer strategy;
* cannot be <code>null</code> * cannot be {@code null}
* @exception AWTException if the capabilities supplied could not be * @exception AWTException if the capabilities supplied could not be
* supported or met; this may happen, for example, if there is not enough * supported or met; this may happen, for example, if there is not enough
* accelerated memory currently available, or if page flipping is specified * accelerated memory currently available, or if page flipping is specified
* but not possible. * but not possible.
* @exception IllegalArgumentException if numBuffers is less than 1, or if * @exception IllegalArgumentException if numBuffers is less than 1, or if
* caps is <code>null</code> * caps is {@code null}
* @see #getBufferStrategy * @see #getBufferStrategy
* @since 1.4 * @since 1.4
*/ */
...@@ -3334,8 +3334,8 @@ public class Window extends Container implements Accessible { ...@@ -3334,8 +3334,8 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Returns the <code>BufferStrategy</code> used by this component. This * Returns the {@code BufferStrategy} used by this component. This
* method will return null if a <code>BufferStrategy</code> has not yet * method will return null if a {@code BufferStrategy} has not yet
* been created or has been disposed. * been created or has been disposed.
* *
* @return the buffer strategy used by this component * @return the buffer strategy used by this component
...@@ -3376,7 +3376,7 @@ public class Window extends Container implements Accessible { ...@@ -3376,7 +3376,7 @@ public class Window extends Container implements Accessible {
/** /**
* Sets whether this Window should appear at the default location for the * Sets whether this Window should appear at the default location for the
* native windowing system or at the current location (returned by * native windowing system or at the current location (returned by
* <code>getLocation</code>) the next time the Window is made visible. * {@code getLocation}) the next time the Window is made visible.
* This behavior resembles a native window shown without programmatically * This behavior resembles a native window shown without programmatically
* setting its location. Most windowing systems cascade windows if their * setting its location. Most windowing systems cascade windows if their
* locations are not explicitly set. The actual location is determined once the * locations are not explicitly set. The actual location is determined once the
...@@ -3386,8 +3386,8 @@ public class Window extends Container implements Accessible { ...@@ -3386,8 +3386,8 @@ public class Window extends Container implements Accessible {
* "java.awt.Window.locationByPlatform" to "true", though calls to this method * "java.awt.Window.locationByPlatform" to "true", though calls to this method
* take precedence. * take precedence.
* <p> * <p>
* Calls to <code>setVisible</code>, <code>setLocation</code> and * Calls to {@code setVisible}, {@code setLocation} and
* <code>setBounds</code> after calling <code>setLocationByPlatform</code> clear * {@code setBounds} after calling {@code setLocationByPlatform} clear
* this property of the Window. * this property of the Window.
* <p> * <p>
* For example, after the following code is executed: * For example, after the following code is executed:
...@@ -3397,7 +3397,7 @@ public class Window extends Container implements Accessible { ...@@ -3397,7 +3397,7 @@ public class Window extends Container implements Accessible {
* boolean flag = isLocationByPlatform(); * boolean flag = isLocationByPlatform();
* </blockquote></pre> * </blockquote></pre>
* The window will be shown at platform's default location and * The window will be shown at platform's default location and
* <code>flag</code> will be <code>false</code>. * {@code flag} will be {@code false}.
* <p> * <p>
* In the following sample: * In the following sample:
* <pre><blockquote> * <pre><blockquote>
...@@ -3406,13 +3406,13 @@ public class Window extends Container implements Accessible { ...@@ -3406,13 +3406,13 @@ public class Window extends Container implements Accessible {
* boolean flag = isLocationByPlatform(); * boolean flag = isLocationByPlatform();
* setVisible(true); * setVisible(true);
* </blockquote></pre> * </blockquote></pre>
* The window will be shown at (10, 10) and <code>flag</code> will be * The window will be shown at (10, 10) and {@code flag} will be
* <code>false</code>. * {@code false}.
* *
* @param locationByPlatform <code>true</code> if this Window should appear * @param locationByPlatform {@code true} if this Window should appear
* at the default location, <code>false</code> if at the current location * at the default location, {@code false} if at the current location
* @throws <code>IllegalComponentStateException</code> if the window * @throws {@code IllegalComponentStateException} if the window
* is showing on screen and locationByPlatform is <code>true</code>. * is showing on screen and locationByPlatform is {@code true}.
* @see #setLocation * @see #setLocation
* @see #isShowing * @see #isShowing
* @see #setVisible * @see #setVisible
...@@ -3430,9 +3430,9 @@ public class Window extends Container implements Accessible { ...@@ -3430,9 +3430,9 @@ public class Window extends Container implements Accessible {
} }
/** /**
* Returns <code>true</code> if this Window will appear at the default location * Returns {@code true} if this Window will appear at the default location
* for the native windowing system the next time this Window is made visible. * for the native windowing system the next time this Window is made visible.
* This method always returns <code>false</code> if the Window is showing on the * This method always returns {@code false} if the Window is showing on the
* screen. * screen.
* *
* @return whether this Window will appear at the default location * @return whether this Window will appear at the default location
...@@ -3509,8 +3509,8 @@ public class Window extends Container implements Accessible { ...@@ -3509,8 +3509,8 @@ public class Window extends Container implements Accessible {
/** /**
* Determines whether this component will be displayed on the screen. * Determines whether this component will be displayed on the screen.
* @return <code>true</code> if the component and all of its ancestors * @return {@code true} if the component and all of its ancestors
* until a toplevel window are visible, <code>false</code> otherwise * until a toplevel window are visible, {@code false} otherwise
*/ */
boolean isRecursivelyVisible() { boolean isRecursivelyVisible() {
// 5079694 fix: for a toplevel to be displayed, its parent doesn't have to be visible. // 5079694 fix: for a toplevel to be displayed, its parent doesn't have to be visible.
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
package javax.sound.sampled; package javax.sound.sampled;
import java.util.Arrays;
/** /**
* <code>DataLine</code> adds media-related functionality to its * <code>DataLine</code> adds media-related functionality to its
* superinterface, <code>{@link Line}</code>. This functionality includes * superinterface, <code>{@link Line}</code>. This functionality includes
...@@ -282,9 +284,9 @@ public interface DataLine extends Line { ...@@ -282,9 +284,9 @@ public interface DataLine extends Line {
*/ */
public static class Info extends Line.Info { public static class Info extends Line.Info {
private AudioFormat[] formats; private final AudioFormat[] formats;
private int minBufferSize; private final int minBufferSize;
private int maxBufferSize; private final int maxBufferSize;
/** /**
* Constructs a data line's info object from the specified information, * Constructs a data line's info object from the specified information,
...@@ -304,7 +306,7 @@ public interface DataLine extends Line { ...@@ -304,7 +306,7 @@ public interface DataLine extends Line {
if (formats == null) { if (formats == null) {
this.formats = new AudioFormat[0]; this.formats = new AudioFormat[0];
} else { } else {
this.formats = formats; this.formats = Arrays.copyOf(formats, formats.length);
} }
this.minBufferSize = minBufferSize; this.minBufferSize = minBufferSize;
...@@ -329,8 +331,7 @@ public interface DataLine extends Line { ...@@ -329,8 +331,7 @@ public interface DataLine extends Line {
if (format == null) { if (format == null) {
this.formats = new AudioFormat[0]; this.formats = new AudioFormat[0];
} else { } else {
AudioFormat[] formats = { format }; this.formats = new AudioFormat[]{format};
this.formats = formats;
} }
this.minBufferSize = bufferSize; this.minBufferSize = bufferSize;
...@@ -373,10 +374,7 @@ public interface DataLine extends Line { ...@@ -373,10 +374,7 @@ public interface DataLine extends Line {
* @see #isFormatSupported(AudioFormat) * @see #isFormatSupported(AudioFormat)
*/ */
public AudioFormat[] getFormats() { public AudioFormat[] getFormats() {
return Arrays.copyOf(formats, formats.length);
AudioFormat[] returnedArray = new AudioFormat[formats.length];
System.arraycopy(formats, 0, returnedArray, 0, formats.length);
return returnedArray;
} }
/** /**
......
...@@ -1185,14 +1185,13 @@ public class JLabel extends JComponent implements SwingConstants, Accessible ...@@ -1185,14 +1185,13 @@ public class JLabel extends JComponent implements SwingConstants, Accessible
} }
/** /**
* Determine the bounding box of the character at the given * Returns the bounding box of the character at the given
* index into the string. The bounds are returned in local * index in the string. The bounds are returned in local
* coordinates. If the index is invalid an empty rectangle is * coordinates. If the index is invalid, <code>null</code> is returned.
* returned.
* *
* @param i the index into the String * @param i the index into the String
* @return the screen coordinates of the character's the bounding box, * @return the screen coordinates of the character's bounding box.
* if index is invalid returns an empty rectangle. * If the index is invalid, <code>null</code> is returned.
* @since 1.3 * @since 1.3
*/ */
public Rectangle getCharacterBounds(int i) { public Rectangle getCharacterBounds(int i) {
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
package sun.audio; package sun.audio;
import java.io.*; import java.io.*;
import java.util.Arrays;
import javax.sound.sampled.*; import javax.sound.sampled.*;
...@@ -65,12 +67,11 @@ public final class AudioData { ...@@ -65,12 +67,11 @@ public final class AudioData {
/** /**
* Constructor * Constructor
*/ */
public AudioData(byte buffer[]) { public AudioData(final byte[] buffer) {
// if we cannot extract valid format information, we resort to assuming
this.buffer = buffer; // the data will be 8k mono u-law in order to provide maximal backwards
// if we cannot extract valid format information, we resort to assuming the data will be 8k mono u-law // compatibility....
// in order to provide maximal backwards compatibility.... this(DEFAULT_FORMAT, buffer);
this.format = DEFAULT_FORMAT;
// okay, we need to extract the format and the byte buffer of data // okay, we need to extract the format and the byte buffer of data
try { try {
...@@ -90,9 +91,10 @@ public final class AudioData { ...@@ -90,9 +91,10 @@ public final class AudioData {
* Non-public constructor; this is the one we use in ADS and CADS * Non-public constructor; this is the one we use in ADS and CADS
* constructors. * constructors.
*/ */
AudioData(AudioFormat format, byte[] buffer) { AudioData(final AudioFormat format, final byte[] buffer) {
this.format = format; this.format = format;
this.buffer = buffer; if (buffer != null) {
this.buffer = Arrays.copyOf(buffer, buffer.length);
}
} }
} }
...@@ -98,8 +98,7 @@ public class ClipboardTransferable implements Transferable { ...@@ -98,8 +98,7 @@ public class ClipboardTransferable implements Transferable {
} }
flavors = DataTransferer.getInstance(). flavors = DataTransferer.getInstance().
setToSortedDataFlavorArray(flavorsToData.keySet(), setToSortedDataFlavorArray(flavorsToData.keySet());
flavorsForFormats);
} }
} finally { } finally {
clipboard.closeClipboard(); clipboard.closeClipboard();
......
...@@ -2405,15 +2405,6 @@ search: ...@@ -2405,15 +2405,6 @@ search:
return retval; return retval;
} }
/**
* Helper function to reduce a Map with DataFlavor keys to a DataFlavor
* array. The array will be sorted according to
* <code>DataFlavorComparator</code>.
*/
public static DataFlavor[] keysToDataFlavorArray(Map map) {
return setToSortedDataFlavorArray(map.keySet(), map);
}
/** /**
* Helper function to convert a Set of DataFlavors to a sorted array. * Helper function to convert a Set of DataFlavors to a sorted array.
* The array will be sorted according to <code>DataFlavorComparator</code>. * The array will be sorted according to <code>DataFlavorComparator</code>.
...@@ -2427,24 +2418,6 @@ search: ...@@ -2427,24 +2418,6 @@ search:
return flavors; return flavors;
} }
/**
* Helper function to convert a Set of DataFlavors to a sorted array.
* The array will be sorted according to a
* <code>DataFlavorComparator</code> created with the specified
* flavor-to-native map as an argument.
*/
public static DataFlavor[] setToSortedDataFlavorArray
(Set flavorsSet, Map flavorToNativeMap)
{
DataFlavor[] flavors = new DataFlavor[flavorsSet.size()];
flavorsSet.toArray(flavors);
Comparator comparator =
new DataFlavorComparator(flavorToNativeMap,
IndexedComparator.SELECT_WORST);
Arrays.sort(flavors, comparator);
return flavors;
}
/** /**
* Helper function to convert an InputStream to a byte[] array. * Helper function to convert an InputStream to a byte[] array.
*/ */
...@@ -2724,11 +2697,9 @@ search: ...@@ -2724,11 +2697,9 @@ search:
* application/x-java-* MIME types. Unknown application types are preferred * application/x-java-* MIME types. Unknown application types are preferred
* because if the user provides his own data flavor, it will likely be the * because if the user provides his own data flavor, it will likely be the
* most descriptive one. For flavors which are otherwise equal, the * most descriptive one. For flavors which are otherwise equal, the
* flavors' native formats are compared, with greater long values * flavors' string representation are compared in the alphabetical order.
* taking precedence.
*/ */
public static class DataFlavorComparator extends IndexedComparator { public static class DataFlavorComparator extends IndexedComparator {
protected final Map flavorToFormatMap;
private final CharsetComparator charsetComparator; private final CharsetComparator charsetComparator;
...@@ -2864,20 +2835,6 @@ search: ...@@ -2864,20 +2835,6 @@ search:
super(order); super(order);
charsetComparator = new CharsetComparator(order); charsetComparator = new CharsetComparator(order);
flavorToFormatMap = Collections.EMPTY_MAP;
}
public DataFlavorComparator(Map map) {
this(map, SELECT_BEST);
}
public DataFlavorComparator(Map map, boolean order) {
super(order);
charsetComparator = new CharsetComparator(order);
HashMap hashMap = new HashMap(map.size());
hashMap.putAll(map);
flavorToFormatMap = Collections.unmodifiableMap(hashMap);
} }
public int compare(Object obj1, Object obj2) { public int compare(Object obj1, Object obj2) {
...@@ -2973,10 +2930,9 @@ search: ...@@ -2973,10 +2930,9 @@ search:
} }
} }
// As a last resort, take the DataFlavor with the greater integer // The flavours are not equal but still not distinguishable.
// format. // Compare String representations in alphabetical order
return compareLongs(flavorToFormatMap, flavor1, flavor2, return flavor1.getMimeType().compareTo(flavor2.getMimeType());
UNKNOWN_OBJECT_LOSES_L);
} }
} }
......
...@@ -339,6 +339,8 @@ public class PSPrinterJob extends RasterPrinterJob { ...@@ -339,6 +339,8 @@ public class PSPrinterJob extends RasterPrinterJob {
*/ */
private static Properties mFontProps = null; private static Properties mFontProps = null;
private static boolean isMac;
/* Class static initialiser block */ /* Class static initialiser block */
static { static {
//enable priviledges so initProps can access system properties, //enable priviledges so initProps can access system properties,
...@@ -347,6 +349,8 @@ public class PSPrinterJob extends RasterPrinterJob { ...@@ -347,6 +349,8 @@ public class PSPrinterJob extends RasterPrinterJob {
new java.security.PrivilegedAction() { new java.security.PrivilegedAction() {
public Object run() { public Object run() {
mFontProps = initProps(); mFontProps = initProps();
String osName = System.getProperty("os.name");
isMac = osName.startsWith("Mac");
return null; return null;
} }
}); });
...@@ -473,6 +477,12 @@ public class PSPrinterJob extends RasterPrinterJob { ...@@ -473,6 +477,12 @@ public class PSPrinterJob extends RasterPrinterJob {
PrintService pServ = getPrintService(); PrintService pServ = getPrintService();
if (pServ != null) { if (pServ != null) {
mDestination = pServ.getName(); mDestination = pServ.getName();
if (isMac) {
PrintServiceAttributeSet psaSet = pServ.getAttributes() ;
if (psaSet != null) {
mDestination = psaSet.get(PrinterName.class).toString();
}
}
} }
} }
} }
...@@ -771,6 +781,12 @@ public class PSPrinterJob extends RasterPrinterJob { ...@@ -771,6 +781,12 @@ public class PSPrinterJob extends RasterPrinterJob {
PrintService pServ = getPrintService(); PrintService pServ = getPrintService();
if (pServ != null) { if (pServ != null) {
mDestination = pServ.getName(); mDestination = pServ.getName();
if (isMac) {
PrintServiceAttributeSet psaSet = pServ.getAttributes();
if (psaSet != null) {
mDestination = psaSet.get(PrinterName.class).toString() ;
}
}
} }
PrinterSpooler spooler = new PrinterSpooler(); PrinterSpooler spooler = new PrinterSpooler();
java.security.AccessController.doPrivileged(spooler); java.security.AccessController.doPrivileged(spooler);
......
...@@ -71,13 +71,17 @@ JNIEXPORT jlong JNICALL Java_sun_font_NullFontScaler_getGlyphImage ...@@ -71,13 +71,17 @@ JNIEXPORT jlong JNICALL Java_sun_font_NullFontScaler_getGlyphImage
void initLCDGammaTables(); void initLCDGammaTables();
/* placeholder for extern variable */ /* placeholder for extern variable */
static int initialisedFontIDs = 0;
FontManagerNativeIDs sunFontIDs; FontManagerNativeIDs sunFontIDs;
JNIEXPORT void JNICALL static void initFontIDs(JNIEnv *env) {
Java_sun_font_SunFontManager_initIDs
(JNIEnv *env, jclass cls) { jclass tmpClass;
jclass tmpClass = (*env)->FindClass(env, "sun/font/TrueTypeFont"); if (initialisedFontIDs) {
return;
}
tmpClass = (*env)->FindClass(env, "sun/font/TrueTypeFont");
sunFontIDs.ttReadBlockMID = sunFontIDs.ttReadBlockMID =
(*env)->GetMethodID(env, tmpClass, "readBlock", (*env)->GetMethodID(env, tmpClass, "readBlock",
"(Ljava/nio/ByteBuffer;II)I"); "(Ljava/nio/ByteBuffer;II)I");
...@@ -173,9 +177,20 @@ Java_sun_font_SunFontManager_initIDs ...@@ -173,9 +177,20 @@ Java_sun_font_SunFontManager_initIDs
(*env)->GetFieldID(env, tmpClass, "lcdSubPixPos", "Z"); (*env)->GetFieldID(env, tmpClass, "lcdSubPixPos", "Z");
initLCDGammaTables(); initLCDGammaTables();
initialisedFontIDs = 1;
} }
JNIEXPORT FontManagerNativeIDs getSunFontIDs() { JNIEXPORT void JNICALL
Java_sun_font_SunFontManager_initIDs
(JNIEnv *env, jclass cls) {
initFontIDs(env);
}
JNIEXPORT FontManagerNativeIDs getSunFontIDs(JNIEnv *env) {
initFontIDs(env);
return sunFontIDs; return sunFontIDs;
} }
......
...@@ -84,7 +84,7 @@ typedef struct FontManagerNativeIDs { ...@@ -84,7 +84,7 @@ typedef struct FontManagerNativeIDs {
/* Note: we share variable in the context of fontmanager lib /* Note: we share variable in the context of fontmanager lib
but we need access method to use it from separate rasterizer lib */ but we need access method to use it from separate rasterizer lib */
extern FontManagerNativeIDs sunFontIDs; extern FontManagerNativeIDs sunFontIDs;
JNIEXPORT FontManagerNativeIDs getSunFontIDs(); JNIEXPORT FontManagerNativeIDs getSunFontIDs(JNIEnv* env);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -245,7 +245,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup ...@@ -245,7 +245,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
continue; continue;
} }
if ((defaultPrintService != null) if ((defaultPrintService != null)
&& printers[p].equals(defaultPrintService.getName())) { && printers[p].equals(getPrinterDestName(defaultPrintService))) {
printerList.add(defaultPrintService); printerList.add(defaultPrintService);
defaultIndex = printerList.size() - 1; defaultIndex = printerList.size() - 1;
} else { } else {
...@@ -270,11 +270,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup ...@@ -270,11 +270,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
} else { } else {
int j; int j;
for (j=0; j<printServices.length; j++) { for (j=0; j<printServices.length; j++) {
if ((printServices[j] != null) && if (printServices[j] != null) {
(printers[p].equals(printServices[j].getName()))) { if (printers[p].equals(getPrinterDestName(printServices[j]))) {
printerList.add(printServices[j]); printerList.add(printServices[j]);
printServices[j] = null; printServices[j] = null;
break; break;
}
} }
} }
...@@ -360,6 +361,17 @@ public class UnixPrintServiceLookup extends PrintServiceLookup ...@@ -360,6 +361,17 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
return true; return true;
} }
/*
* Gets the printer name compatible with the list of printers returned by
* the system when we query default or all the available printers.
*/
private String getPrinterDestName(PrintService ps) {
if (isMac()) {
return ((IPPPrintService)ps).getDest();
}
return ps.getName();
}
/* On a network with many (hundreds) of network printers, it /* On a network with many (hundreds) of network printers, it
* can save several seconds if you know all you want is a particular * can save several seconds if you know all you want is a particular
* printer, to ask for that printer rather than retrieving all printers. * printer, to ask for that printer rather than retrieving all printers.
...@@ -369,10 +381,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup ...@@ -369,10 +381,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
if (name == null || name.equals("") || !checkPrinterName(name)) { if (name == null || name.equals("") || !checkPrinterName(name)) {
return null; return null;
} }
/* check is all printers are already available */ /* check if all printers are already available */
if (printServices != null) { if (printServices != null) {
for (PrintService printService : printServices) { for (PrintService printService : printServices) {
if (printService.getName().equals(name)) { PrinterName printerName =
(PrinterName)printService.getAttribute(PrinterName.class);
if (printerName.getValue().equals(name)) {
return printService; return printService;
} }
} }
...@@ -567,7 +581,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup ...@@ -567,7 +581,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
defaultPrintService = null; defaultPrintService = null;
if (printServices != null) { if (printServices != null) {
for (int j=0; j<printServices.length; j++) { for (int j=0; j<printServices.length; j++) {
if (defaultPrinter.equals(printServices[j].getName())) { if (defaultPrinter.equals(getPrinterDestName(printServices[j]))) {
defaultPrintService = printServices[j]; defaultPrintService = printServices[j];
break; break;
} }
......
/* /*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -346,13 +346,19 @@ JNIEXPORT jobject JNICALL ...@@ -346,13 +346,19 @@ JNIEXPORT jobject JNICALL
awt_GetComponent(JNIEnv* env, void* platformInfo) awt_GetComponent(JNIEnv* env, void* platformInfo)
{ {
Window window = (Window)platformInfo; Window window = (Window)platformInfo;
Widget widget = NULL;
jobject peer = NULL; jobject peer = NULL;
jobject target = NULL; jobject target = NULL;
AWT_LOCK(); AWT_LOCK();
target = (*env)->GetObjectField(env, peer, targetID); if (window != None) {
peer = JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit",
"windowToXWindow", "(J)Lsun/awt/X11/XBaseWindow;", (jlong)window).l;
}
if ((peer != NULL) &&
(JNU_IsInstanceOfByName(env, peer, "sun/awt/X11/XWindow") == 1)) {
target = (*env)->GetObjectField(env, peer, targetID);
}
if (target == NULL) { if (target == NULL) {
JNU_ThrowNullPointerException(env, "NullPointerException"); JNU_ThrowNullPointerException(env, "NullPointerException");
...@@ -360,7 +366,6 @@ JNIEXPORT jobject JNICALL ...@@ -360,7 +366,6 @@ JNIEXPORT jobject JNICALL
return (jobject)NULL; return (jobject)NULL;
} }
AWT_UNLOCK(); AWT_UNLOCK();
return target; return target;
......
...@@ -67,14 +67,15 @@ Java_sun_java2d_opengl_WGLSurfaceData_initOps(JNIEnv *env, jobject wglsd, ...@@ -67,14 +67,15 @@ Java_sun_java2d_opengl_WGLSurfaceData_initOps(JNIEnv *env, jobject wglsd,
J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps"); J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
if (oglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
if (wglsdo == NULL) { if (wglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native wgl ops"); JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
return; return;
} }
if (oglsdo == NULL) {
free(wglsdo);
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
oglsdo->privOps = wglsdo; oglsdo->privOps = wglsdo;
......
...@@ -391,9 +391,16 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect( ...@@ -391,9 +391,16 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect(
DASSERT(hCursor); DASSERT(hCursor);
AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot, try {
yHotSpot, nW, nH, nSS, cols, AwtCursor::setPData(self, ptr_to_jlong(new AwtCursor(env, hCursor, self, xHotSpot,
(BYTE *)andMaskPtr))); yHotSpot, nW, nH, nSS, cols,
(BYTE *)andMaskPtr)));
} catch (...) {
if (cols) {
delete[] cols;
}
throw;
}
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -510,6 +510,11 @@ void AwtFont::LoadMetrics(JNIEnv *env, jobject fontMetrics) ...@@ -510,6 +510,11 @@ void AwtFont::LoadMetrics(JNIEnv *env, jobject fontMetrics)
jobject font = env->GetObjectField(fontMetrics, AwtFont::fontID); jobject font = env->GetObjectField(fontMetrics, AwtFont::fontID);
AwtFont* awtFont = AwtFont::GetFont(env, font); AwtFont* awtFont = AwtFont::GetFont(env, font);
if (!awtFont) {
/* failed to get font */
return;
}
HDC hDC = ::GetDC(0); HDC hDC = ::GetDC(0);
DASSERT(hDC != NULL); DASSERT(hDC != NULL);
......
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 8013611
@summary Tests showing a modal dialog with requesting focus in frame.
@author Anton.Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main JDK8013611
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import test.java.awt.regtesthelpers.Util;
import java.awt.*;
public class JDK8013611 extends JFrame {
static JTextField textField = new JTextField("text");
static JButton button1 = new JButton("button1");
static JButton button2 = new JButton("button2");
static Robot robot;
static JDialog dialog;
static JButton button3 = new JButton("button3");
public static void main(String[] args) {
robot = Util.createRobot();
JDK8013611 frame = new JDK8013611();
frame.setLayout(new FlowLayout());
frame.add(textField);
frame.add(button1);
frame.add(button2);
frame.pack();
dialog = new JDialog(frame, true);
dialog.add(button3);
dialog.pack();
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
dialog.setVisible(true);
}
});
button1.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
button2.requestFocusInWindow();
}
});
frame.setVisible(true);
frame.test();
}
public void test() {
if (!testFocused(textField)) {
Util.clickOnComp(textField, robot);
if (!testFocused(textField)) {
throw new RuntimeException("Error: couldn't focus " + textField);
}
}
robot.keyPress(KeyEvent.VK_TAB);
robot.delay(50);
robot.keyRelease(KeyEvent.VK_TAB);
if (!testFocused(button3)) {
throw new RuntimeException("Test failed: dialog didn't get focus!");
}
System.out.println("Test passed.");
}
boolean testFocused(Component c) {
for (int i=0; i<10; i++) {
if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == c) {
return true;
}
Util.waitForIdle(robot);
}
return false;
}
}
...@@ -37,7 +37,7 @@ import sun.java2d.SunGraphics2D; ...@@ -37,7 +37,7 @@ import sun.java2d.SunGraphics2D;
*/ */
public final class Test8004859 { public final class Test8004859 {
private static Shape[] clips = {new Rectangle(0, 0, 1, 1), new Rectangle( private static Shape[] clips = {new Rectangle(0, 0, -1, -1), new Rectangle(
100, 100, -100, -100)}; 100, 100, -100, -100)};
private static boolean status = true; private static boolean status = true;
......
...@@ -35,11 +35,12 @@ import java.awt.event.*; ...@@ -35,11 +35,12 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
public class ActionListenerCalledTwiceTest { public class ActionListenerCalledTwiceTest {
static String menuItems[] = { "Item1", "Item2", "Item3" }; static String menuItems[] = { "Item1", "Item2", "Item3", "Item4" };
static KeyStroke keyStrokes[] = { static KeyStroke keyStrokes[] = {
KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK), KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK), KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.META_MASK)
}; };
static volatile int listenerCallCounter = 0; static volatile int listenerCallCounter = 0;
......
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 7173464
@summary Clipboard.getAvailableDataFlavors: Comparison method violates contract
@author Petr Pchelko
@run main DataFlavorComparatorTest
*/
import sun.awt.datatransfer.DataTransferer;
import java.awt.datatransfer.DataFlavor;
public class DataFlavorComparatorTest {
public static void main(String[] args) {
DataTransferer.DataFlavorComparator comparator = new DataTransferer.DataFlavorComparator();
DataFlavor flavor1 = DataFlavor.imageFlavor;
DataFlavor flavor2 = DataFlavor.selectionHtmlFlavor;
if (comparator.compare(flavor1, flavor2) == 0) {
throw new RuntimeException(flavor1.getMimeType() + " and " + flavor2.getMimeType() +
" should not be equal");
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册