This commit is contained in:
Lana Steuck 2013-10-31 16:22:30 -07:00
commit 30f9f179d5
806 changed files with 4509 additions and 1988 deletions

View File

@ -163,7 +163,7 @@ NSString *GetJavaRoot(NSDictionary *jvmInfoDict) {
if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) {
self.startOnFirstThread = YES;
} else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) {
// for key compatability with the Apple JavaApplicationStub's 'Java' dictionary
// for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary
self.startOnFirstThread = YES;
}

View File

@ -1,5 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body bgcolor="white">
Classes for receiving gesture events.

View File

@ -1,5 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body bgcolor="white">
Provides classes for integrating Java applications with the native application environment.

View File

@ -244,7 +244,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel {
* used for getting localized defaults. Also initialize the default
* locale used when no locale is passed into UIDefaults.get(). The
* default locale should generally not be relied upon. It is here for
* compatability with releases prior to 1.4.
* compatibility with releases prior to 1.4.
*/
private void initResourceBundle(final UIDefaults table) {
table.setDefaultLocale(Locale.getDefault());

View File

@ -406,7 +406,7 @@ public class AquaMenuPainter {
}
/** Draw a string with the graphics g at location (x,y) just like g.drawString() would.
* The first occurence of underlineChar in text will be underlined. The matching is
* The first occurrence of underlineChar in text will be underlined. The matching is
* not case sensitive.
*/
public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) {

View File

@ -3514,7 +3514,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
public class PropertyChangeHandler implements PropertyChangeListener {
// NOTE: This class exists only for backward compatability. All
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
@ -3528,7 +3528,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
public class TabSelectionHandler implements ChangeListener {
// NOTE: This class exists only for backward compatability. All
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
@ -3542,7 +3542,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
public class MouseHandler extends MouseAdapter {
// NOTE: This class exists only for backward compatability. All
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
@ -3556,7 +3556,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
public class FocusHandler extends FocusAdapter {
// NOTE: This class exists only for backward compatability. All
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.

View File

@ -179,7 +179,7 @@ public class AquaTreeUI extends BasicTreeUI {
}
/**
* Paints the expand (toggle) part of a row. The reciever should NOT modify <code>clipBounds</code>, or
* Paints the expand (toggle) part of a row. The receiver should NOT modify <code>clipBounds</code>, or
* <code>insets</code>.
*/
protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) {

View File

@ -93,9 +93,9 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
}
if (fMenuItem instanceof JCheckBoxMenuItem) {
setState(((JCheckBoxMenuItem)fMenuItem).isSelected());
forceSetState(fMenuItem.isSelected());
} else {
setState(fMenuItem.getModel().isSelected());
forceSetState(fMenuItem.getModel().isSelected());
}
}
@ -196,10 +196,10 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
switch (e.getStateChange()) {
case ItemEvent.SELECTED:
setState(true);
forceSetState(true);
break;
case ItemEvent.DESELECTED:
setState(false);
forceSetState(false);
break;
}
}
@ -210,4 +210,20 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate);
}
}
/*
* The CCheckboxMenuItem peer is calling setState unconditionally every time user clicks the menu
* However for Swing controls in the screen menu bar it is wrong - the state should be changed only
* in response to the ITEM_STATE_CHANGED event. So the setState is overridden to no-op and all the
* correct state changes are made with forceSetState
*/
@Override
public synchronized void setState(boolean b) {
// No Op
}
private void forceSetState(boolean b) {
super.setState(b);
}
}

View File

@ -26,7 +26,7 @@
package java.net;
/**
* Choose a network inteface to be the default for
* Choose a network interface to be the default for
* outgoing IPv6 traffic that does not specify a scope_id (and which needs one).
* We choose the first interface that is up and is (in order of preference):
* 1. neither loopback nor point to point

View File

@ -122,7 +122,7 @@ class MacOSXPreferencesFile {
long user() { return user; }
long host() { return host; }
// private contructor - use factory method getFile() instead
// private constructor - use factory method getFile() instead
private MacOSXPreferencesFile(String newName, long newUser, long newHost)
{
appName = newName;

View File

@ -342,7 +342,7 @@ public class CFontManager extends SunFontManager {
@Override
public String getFontPath(boolean noType1Fonts) {
// In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts
// In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts
Toolkit tk = Toolkit.getDefaultToolkit();
if (tk instanceof HeadlessToolkit) {
tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();

View File

@ -56,15 +56,6 @@ public class LWWindowPeer
private final PlatformWindow platformWindow;
// Window bounds reported by the native system (as opposed to
// regular bounds inherited from LWComponentPeer which are
// requested by user and may haven't been applied yet because
// of asynchronous requests to the windowing system)
private int sysX;
private int sysY;
private int sysW;
private int sysH;
private static final int MINIMUM_WIDTH = 1;
private static final int MINIMUM_HEIGHT = 1;
@ -320,10 +311,18 @@ public class LWWindowPeer
// Don't post ComponentMoved/Resized and Paint events
// until we've got a notification from the delegate
Rectangle cb = constrainBounds(x, y, w, h);
setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false);
// Get updated bounds, so we don't have to handle 'op' here manually
Rectangle r = getBounds();
platformWindow.setBounds(r.x, r.y, r.width, r.height);
Rectangle newBounds = new Rectangle(getBounds());
if ((op & (SET_LOCATION | SET_BOUNDS)) != 0) {
newBounds.x = cb.x;
newBounds.y = cb.y;
}
if ((op & (SET_SIZE | SET_BOUNDS)) != 0) {
newBounds.width = cb.width;
newBounds.height = cb.height;
}
// Native system could constraint bounds, so the peer wold be updated in the callback
platformWindow.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
}
public Rectangle constrainBounds(Rectangle bounds) {
@ -614,17 +613,10 @@ public class LWWindowPeer
*/
@Override
public void notifyReshape(int x, int y, int w, int h) {
final boolean moved;
final boolean resized;
Rectangle oldBounds = getBounds();
final boolean invalid = updateInsets(platformWindow.getInsets());
synchronized (getStateLock()) {
moved = (x != sysX) || (y != sysY);
resized = (w != sysW) || (h != sysH);
sysX = x;
sysY = y;
sysW = w;
sysH = h;
}
final boolean moved = (x != oldBounds.x) || (y != oldBounds.y);
final boolean resized = (w != oldBounds.width) || (h != oldBounds.height);
// Check if anything changed
if (!moved && !resized && !invalid) {

View File

@ -620,8 +620,7 @@ public class CInputMethod extends InputMethodAdapter {
retString[0] = new String(selectedText);
}}
}, fAwtFocussedComponent);
} catch (InterruptedException ie) { ie.printStackTrace(); }
catch (InvocationTargetException ite) { ite.printStackTrace(); }
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
synchronized(retString) { return retString[0]; }
}
@ -669,8 +668,7 @@ public class CInputMethod extends InputMethodAdapter {
}}
}, fAwtFocussedComponent);
} catch (InterruptedException ie) { ie.printStackTrace(); }
catch (InvocationTargetException ite) { ite.printStackTrace(); }
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
synchronized(returnValue) { return returnValue; }
}
@ -695,8 +693,7 @@ public class CInputMethod extends InputMethodAdapter {
returnValue[0] = fIMContext.getInsertPositionOffset();
}}
}, fAwtFocussedComponent);
} catch (InterruptedException ie) { ie.printStackTrace(); }
catch (InvocationTargetException ite) { ite.printStackTrace(); }
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
returnValue[1] = fCurrentTextLength;
synchronized(returnValue) { return returnValue; }
@ -743,8 +740,7 @@ public class CInputMethod extends InputMethodAdapter {
}
}}
}, fAwtFocussedComponent);
} catch (InterruptedException ie) { ie.printStackTrace(); }
catch (InvocationTargetException ite) { ite.printStackTrace(); }
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
synchronized(rect) { return rect; }
}
@ -764,8 +760,7 @@ public class CInputMethod extends InputMethodAdapter {
insertPositionOffset[0] = fIMContext.getInsertPositionOffset();
}}
}, fAwtFocussedComponent);
} catch (InterruptedException ie) { ie.printStackTrace(); }
catch (InvocationTargetException ite) { ite.printStackTrace(); }
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
// This bit of gymnastics ensures that the returned location is within the composed text.
// If it falls outside that region, the input method will commit the text, which is inconsistent with native

View File

@ -53,14 +53,6 @@ public class CPlatformLWView extends CPlatformView {
public void setBounds(int x, int y, int width, int height) {
}
@Override
public void enterFullScreenMode() {
}
@Override
public void exitFullScreenMode() {
}
@Override
public SurfaceData replaceSurfaceData() {
return null;

View File

@ -96,14 +96,6 @@ public class CPlatformView extends CFRetainedResource {
return peer;
}
public void enterFullScreenMode() {
CWrapper.NSView.enterFullScreenMode(ptr);
}
public void exitFullScreenMode() {
CWrapper.NSView.exitFullScreenMode(ptr);
}
public void setToolTip(String msg) {
CWrapper.NSView.setToolTip(ptr, msg);
}

View File

@ -63,6 +63,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
private static native void nativeSynthesizeMouseEnteredExitedEvents();
private static native void nativeDispose(long nsWindowPtr);
private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse();
private static native void nativeEnterFullScreenMode(long nsWindowPtr);
private static native void nativeExitFullScreenMode(long nsWindowPtr);
// Loger to report issues happened during execution but that do not affect functionality
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
@ -230,7 +232,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
contentView.initialize(peer, responder);
final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L;
Rectangle bounds = _peer.constrainBounds(_target.getBounds());
Rectangle bounds;
if (!IS(DECORATED, styleBits)) {
// For undecorated frames the move/resize event does not come if the frame is centered on the screen
// so we need to set a stub location to force an initial move/resize. Real bounds would be set later.
bounds = new Rectangle(0, 0, 1, 1);
} else {
bounds = _peer.constrainBounds(_target.getBounds());
}
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
setPtr(nativeWindowPtr);
@ -433,10 +442,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
@Override // PlatformWindow
public Insets getInsets() {
if (!isFullScreenMode) {
return nativeGetNSWindowInsets(getNSWindowPtr());
}
return new Insets(0, 0, 0, 0);
return nativeGetNSWindowInsets(getNSWindowPtr());
}
@Override // PlatformWindow
@ -538,6 +544,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
updateIconImages();
updateFocusabilityForAutoRequestFocus(false);
boolean wasMaximized = isMaximized();
// Actually show or hide the window
LWWindowPeer blocker = (peer == null)? null : peer.getBlocker();
if (blocker == null || !visible) {
@ -571,16 +579,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
if (visible) {
// Apply the extended state as expected in shared code
if (target instanceof Frame) {
switch (((Frame)target).getExtendedState()) {
case Frame.ICONIFIED:
CWrapper.NSWindow.miniaturize(nsWindowPtr);
break;
case Frame.MAXIMIZED_BOTH:
maximize();
break;
default: // NORMAL
unmaximize(); // in case it was maximized, otherwise this is a no-op
break;
if (!wasMaximized && isMaximized()) {
// setVisible could have changed the native maximized state
deliverZoom(true);
} else {
switch (((Frame)target).getExtendedState()) {
case Frame.ICONIFIED:
CWrapper.NSWindow.miniaturize(nsWindowPtr);
break;
case Frame.MAXIMIZED_BOTH:
maximize();
break;
default: // NORMAL
unmaximize(); // in case it was maximized, otherwise this is a no-op
break;
}
}
}
}
@ -750,18 +763,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
@Override
public void enterFullScreenMode() {
isFullScreenMode = true;
contentView.enterFullScreenMode();
// the move/size notification from the underlying system comes
// but it contains a bounds smaller than the whole screen
// and therefore we need to create the synthetic notifications
Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds();
peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
screenBounds.height);
nativeEnterFullScreenMode(getNSWindowPtr());
}
@Override
public void exitFullScreenMode() {
contentView.exitFullScreenMode();
nativeExitFullScreenMode(getNSWindowPtr());
isFullScreenMode = false;
}
@ -884,7 +891,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
//Posting an empty to flush the EventQueue without blocking the main thread
}
}, target);
} catch (InterruptedException | InvocationTargetException e) {
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
@ -919,13 +926,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
protected void deliverMoveResizeEvent(int x, int y, int width, int height,
boolean byUser) {
// when the content view enters the full-screen mode, the native
// move/resize notifications contain a bounds smaller than
// the whole screen and therefore we ignore the native notifications
// and the content view itself creates correct synthetic notifications
if (isFullScreenMode) {
return;
}
checkZoom();
final Rectangle oldB = nativeBounds;
nativeBounds = new Rectangle(x, y, width, height);
@ -957,6 +958,17 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
}
private void checkZoom() {
if (target instanceof Frame && isVisible()) {
Frame targetFrame = (Frame)target;
if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) {
deliverZoom(true);
} else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) {
deliverZoom(false);
}
}
}
private void deliverNCMouseDown() {
if (peer != null) {
peer.notifyNCMouseDown();

View File

@ -97,6 +97,6 @@ public class CViewEmbeddedFrame extends EmbeddedFrame {
setVisible(true);
}
}, this);
} catch (InterruptedException | InvocationTargetException ex) {}
} catch (InvocationTargetException ex) {}
}
}

View File

@ -82,9 +82,6 @@ public final class CWrapper {
public static native Rectangle2D frame(long view);
public static native long window(long view);
public static native void enterFullScreenMode(long view);
public static native void exitFullScreenMode(long view);
public static native void setHidden(long view, boolean hidden);
public static native void setToolTip(long view, String msg);

View File

@ -548,22 +548,18 @@ public final class LWCToolkit extends LWToolkit {
// Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
// The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
// Does not dispatch native events while in the loop
public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException {
public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException {
final long mediator = createAWTRunLoopMediator();
InvocationEvent invocationEvent =
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) {
@Override
public void dispatch() {
try {
super.dispatch();
} finally {
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(),
runnable,
() -> {
if (mediator != 0) {
stopAWTRunLoop(mediator);
}
}
}
};
},
true);
if (component != null) {
AppContext appContext = SunToolkit.targetToAppContext(component);

View File

@ -272,7 +272,6 @@ AWT_ASSERT_APPKIT_THREAD;
*/
- (void) keyDown: (NSEvent *)event {
fProcessingKeystroke = YES;
fKeyEventsNeeded = YES;
@ -308,6 +307,23 @@ AWT_ASSERT_APPKIT_THREAD;
- (BOOL) performKeyEquivalent: (NSEvent *) event {
[self deliverJavaKeyEventHelper: event];
// Workaround for 8020209: special case for "Cmd =" and "Cmd ."
// because Cocoa calls performKeyEquivalent twice for these keystrokes
NSUInteger modFlags = [event modifierFlags] &
(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask);
if (modFlags == NSCommandKeyMask) {
NSString *eventChars = [event charactersIgnoringModifiers];
if ([eventChars length] == 1) {
unichar ch = [eventChars characterAtIndex:0];
if (ch == '=' || ch == '.') {
[[NSApp mainMenu] performKeyEquivalent: event];
return YES;
}
}
}
return NO;
}
@ -580,7 +596,7 @@ AWT_ASSERT_APPKIT_THREAD;
// --- Services menu support for lightweights ---
// finds the focused accessable element, and if it's a text element, obtains the text from it
// finds the focused accessible element, and if it is a text element, obtains the text from it
- (NSString *)accessibleSelectedText
{
id focused = [self accessibilityFocusedUIElement];
@ -598,7 +614,7 @@ AWT_ASSERT_APPKIT_THREAD;
return rtfdData;
}
// finds the focused accessable element, and if it's a text element, sets the text in it
// finds the focused accessible element, and if it is a text element, sets the text in it
- (BOOL)replaceAccessibleTextSelection:(NSString *)text
{
id focused = [self accessibilityFocusedUIElement];

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@ -45,6 +45,7 @@
BOOL isEnabled;
NSWindow *nsWindow;
AWTWindow *ownerWindow;
jint preFullScreenLevel;
}
// An instance of either AWTWindow_Normal or AWTWindow_Panel
@ -57,6 +58,7 @@
@property (nonatomic) NSSize javaMaxSize;
@property (nonatomic) jint styleBits;
@property (nonatomic) BOOL isEnabled;
@property (nonatomic) jint preFullScreenLevel;
- (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow

View File

@ -122,6 +122,7 @@ AWT_NS_WINDOW_IMPLEMENTATION
@synthesize styleBits;
@synthesize isEnabled;
@synthesize ownerWindow;
@synthesize preFullScreenLevel;
- (void) updateMinMaxSize:(BOOL)resizable {
if (resizable) {
@ -501,20 +502,6 @@ AWT_ASSERT_APPKIT_THREAD;
// window exposing in _setVisible:(BOOL)
}
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)proposedFrame {
AWT_ASSERT_APPKIT_THREAD;
[AWTToolkit eventCountPlusPlus];
JNIEnv *env = [ThreadUtilities getJNIEnv];
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
if (platformWindow != NULL) {
static JNF_MEMBER_CACHE(jm_deliverZoom, jc_CPlatformWindow, "deliverZoom", "(Z)V");
JNFCallVoidMethod(env, platformWindow, jm_deliverZoom, ![window isZoomed]);
(*env)->DeleteLocalRef(env, platformWindow);
}
return YES;
}
- (void) _deliverIconify:(BOOL)iconify {
AWT_ASSERT_APPKIT_THREAD;
@ -1226,3 +1213,58 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT(env);
}
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeEnterFullScreenMode
(JNIEnv *env, jclass clazz, jlong windowPtr)
{
JNF_COCOA_ENTER(env);
NSWindow *nsWindow = OBJC(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWTWindow *window = (AWTWindow*)[nsWindow delegate];
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow];
CGDirectDisplayID aID = [screenID intValue];
if (CGDisplayCapture(aID) == kCGErrorSuccess) {
// remove window decoration
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits];
[nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask];
int shieldLevel = CGShieldingWindowLevel();
window.preFullScreenLevel = [nsWindow level];
[nsWindow setLevel: shieldLevel];
NSRect screenRect = [[nsWindow screen] frame];
[nsWindow setFrame:screenRect display:YES];
} else {
[JNFException raise:env as:kRuntimeException reason:"Failed to enter full screen."];
}
}];
JNF_COCOA_EXIT(env);
}
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode
(JNIEnv *env, jclass clazz, jlong windowPtr)
{
JNF_COCOA_ENTER(env);
NSWindow *nsWindow = OBJC(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWTWindow *window = (AWTWindow*)[nsWindow delegate];
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow];
CGDirectDisplayID aID = [screenID intValue];
if (CGDisplayRelease(aID) == kCGErrorSuccess) {
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits];
[nsWindow setStyleMask:styleMask];
[nsWindow setLevel: window.preFullScreenLevel];
// GraphicsDevice takes care of restoring pre full screen bounds
} else {
[JNFException raise:env as:kRuntimeException reason:"Failed to exit full screen."];
}
}];
JNF_COCOA_EXIT(env);
}

View File

@ -322,7 +322,7 @@ static void DrawTextContext
Each stage of the pipeline is responsible for doing only one major thing, like allocating buffers,
aquiring transform arrays from JNI, filling buffers, or striking glyphs. All resources or memory
aquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc)
acquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc)
is to be handled in the stage it occurs in, and is to return immediatly after freeing it's resources.
-----------------------------------*/

View File

@ -585,46 +585,6 @@ JNF_COCOA_EXIT(env);
return jRect;
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSView
* Method: enterFullScreenMode
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode
(JNIEnv *env, jclass cls, jlong viewPtr)
{
JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
NSScreen *screen = [[view window] screen];
NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil];
[view enterFullScreenMode:screen withOptions:opts];
}];
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSView
* Method: exitFullScreenMode
* Signature: (J)V
*/
JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode
(JNIEnv *env, jclass cls, jlong viewPtr)
{
JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[view exitFullScreenModeWithOptions:nil];
}];
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSView
* Method: window

View File

@ -312,15 +312,17 @@ AWT_ASSERT_APPKIT_THREAD;
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
}
// Don't set the delegate until the NSApplication has been created and
// its finishLaunching has initialized it.
// ApplicationDelegate is the support code for com.apple.eawt.
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
if (delegate != nil) {
OSXAPP_SetApplicationDelegate(delegate);
}
}];
if (!headless) {
// Don't set the delegate until the NSApplication has been created and
// its finishLaunching has initialized it.
// ApplicationDelegate is the support code for com.apple.eawt.
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
id<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
if (delegate != nil) {
OSXAPP_SetApplicationDelegate(delegate);
}
}];
}
}
- (void)starter:(NSArray*)args {

View File

@ -341,6 +341,10 @@ AWT_ASSERT_APPKIT_THREAD;
if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) {
[seenDummyEventLock lockWhenCondition:NO];
[seenDummyEventLock unlockWithCondition:YES];
} else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) {
// Cocoa won't send us key up event when releasing a key while Cmd is down,
// so we have to do it ourselves.
[[self keyWindow] sendEvent:event];
} else {
[super sendEvent:event];
}

View File

@ -52,7 +52,7 @@
* the number times an object has been referenced through
* commonRef_refToID. A RefNode is freed once the reference
* count is decremented to 0 (with commonRef_release*), even if the
* correspoding object has not been collected.
* corresponding object has not been collected.
*
* One hash table is maintained. The mapping of ID to jobject (or RefNode*)
* is handled with one hash table that will re-size itself as the number

View File

@ -644,7 +644,7 @@ eventFilter_predictFiltering(HandlerNode *node, jclass clazz, char *classname)
case JDWP_REQUEST_MODIFIER(Count): {
/*
* If preceeding filters have determined that events will
* If preceding filters have determined that events will
* be filtered out, that is fine and we won't get here.
* However, the count must be decremented - even if
* subsequent filters will filter these events. We

View File

@ -1092,7 +1092,7 @@ debugMonitorWait(jrawMonitorID monitor)
* we don't want to consume it. It came from
* user code and is intended for user code, not us.
* So, we will remember that the interrupt has
* occured and re-activate it when this thread
* occurred and re-activate it when this thread
* goes back into user code.
* That being said, what do we do here? Since
* we could have been notified too, here we will

View File

@ -40,7 +40,7 @@ abstract class AccessorElementHandler extends ElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>name
* <dd>the name of the accessible entity

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 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
@ -57,7 +57,7 @@ import java.lang.reflect.Array;
* &lt;int&gt;456&lt;/int&gt;
* &lt;/array&gt;</pre>
* is equivalent to {@code int[] array = {123, 456}} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>length
* <dd>the array length
@ -76,7 +76,7 @@ final class ArrayElementHandler extends NewElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>length
* <dd>the array length
@ -109,6 +109,20 @@ final class ArrayElementHandler extends NewElementHandler {
}
}
/**
* Tests whether the value of this element can be used
* as an argument of the element that contained in this one.
*
* @return {@code true} if the value of this element can be used
* as an argument of the element that contained in this one,
* {@code false} otherwise
*/
@Override
protected boolean isArgument() {
return true; // hack for compatibility
}
/**
* Creates an instance of the array.
*

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;true&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Boolean.valueOf("true")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;127&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Byte.decode("127")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -33,7 +33,7 @@ package com.sun.beans.decoder;
* For example:<pre>
* &lt;char&gt;X&lt;/char&gt;</pre>
* which is equivalent to {@code Character.valueOf('X')} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>code
* <dd>this attribute specifies character code
@ -52,7 +52,7 @@ final class CharElementHandler extends StringElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>code
* <dd>this attribute specifies character code

View File

@ -36,7 +36,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;java.lang.Class&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Class.forName("java.lang.Class")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;1.23e45&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Double.valueOf("1.23e45")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -126,7 +126,7 @@ public abstract class ElementHandler {
/**
* Parses attributes of the element.
* By default, the following atribute is supported:
* By default, the following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -31,7 +31,7 @@ package com.sun.beans.decoder;
* For example:<pre>
* &lt;false/&gt;</pre>
* is equivalent to {@code false} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -43,7 +43,7 @@ import java.lang.reflect.Field;
* For example:<pre>
* &lt;field name="id"&gt;&lt;int&gt;0&lt;/int&gt;&lt;/field&gt;</pre>
* is equivalent to {@code id = 0} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the field name
@ -62,7 +62,7 @@ final class FieldElementHandler extends AccessorElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>name
* <dd>the field name

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;-1.23&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Float.valueOf("-1.23")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;-1&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Integer.decode("-1")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -32,7 +32,7 @@ import java.beans.XMLDecoder;
* is evaluated in the context of the decoder itself.
* Typically this outer context is used to retrieve the owner of the decoder,
* which can be set before reading the archive.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>version
* <dd>the Java version (not supported)
@ -54,7 +54,7 @@ final class JavaElementHandler extends ElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>version
* <dd>the Java version (not supported)

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;0xFFFF&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Long.decode("0xFFFF")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -43,7 +43,7 @@ import sun.reflect.misc.MethodUtil;
* &lt;string&gt;10&lt;/string&gt;
* &lt;/method&gt;</pre>
* is equivalent to {@code Long.valueOf("10")} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the method name
@ -62,7 +62,7 @@ final class MethodElementHandler extends NewElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>name
* <dd>the method name

View File

@ -43,7 +43,7 @@ import java.util.List;
* &lt;string&gt;10&lt;/string&gt;
* &lt;/new&gt;</pre>
* is equivalent to {@code new Long("10")} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type of object for instantiation
@ -63,7 +63,7 @@ class NewElementHandler extends ElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type of object for instantiation

View File

@ -31,7 +31,7 @@ package com.sun.beans.decoder;
* For example:<pre>
* &lt;null/&gt;</pre>
* is equivalent to {@code null} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -33,7 +33,7 @@ import static java.util.Locale.ENGLISH;
* This element looks like &lt;void&gt; element,
* but its value is always used as an argument for element
* that contains this one.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields
@ -64,7 +64,7 @@ class ObjectElementHandler extends NewElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields

View File

@ -63,7 +63,7 @@ import sun.reflect.misc.MethodUtil;
* &lt;int&gt;0&lt;/int&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code set(0)} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the property name
@ -85,7 +85,7 @@ final class PropertyElementHandler extends AccessorElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>name
* <dd>the property name

View File

@ -37,7 +37,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;200&lt;/string&gt;
* &lt;/method&gt;</pre>
* which is equivalent to {@code Short.decode("200")} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -40,7 +40,7 @@ package com.sun.beans.decoder;
* &lt;string&gt;
* &lt;true&gt;
* &lt;/string&gt;</pre>
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -31,7 +31,7 @@ package com.sun.beans.decoder;
* For example:<pre>
* &lt;true/&gt;</pre>
* is equivalent to {@code true} in Java code.
* <p>The following atribute is supported:
* <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result

View File

@ -30,7 +30,7 @@ package com.sun.beans.decoder;
* For example:<pre>
* &lt;var id="id1" idref="id2"/&gt;</pre>
* is equivalent to {@code id1 = id2} in Java code.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>idref
* <dd>the identifier to refer to the variable
@ -47,7 +47,7 @@ final class VarElementHandler extends ElementHandler {
/**
* Parses attributes of the element.
* The following atributes are supported:
* The following attributes are supported:
* <dl>
* <dt>idref
* <dd>the identifier to refer to the variable

View File

@ -29,7 +29,7 @@ package com.sun.beans.decoder;
* This element looks like &lt;object&gt; element,
* but its value is not used as an argument for element
* that contains this one.
* <p>The following atributes are supported:
* <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields

View File

@ -408,7 +408,7 @@ final class PBECipherCore {
* no padding has been requested (only in encryption mode), and the total
* input length of the data processed by this cipher is not a multiple of
* block size
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
byte[] doFinal(byte[] input, int inputOffset, int inputLen)
@ -448,7 +448,7 @@ final class PBECipherCore {
* block size
* @exception ShortBufferException if the given output buffer is too small
* to hold the result
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
int doFinal(byte[] input, int inputOffset, int inputLen,

View File

@ -408,7 +408,7 @@ final class PBES1Core {
* no padding has been requested (only in encryption mode), and the total
* input length of the data processed by this cipher is not a multiple of
* block size
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
byte[] doFinal(byte[] input, int inputOffset, int inputLen)
@ -448,7 +448,7 @@ final class PBES1Core {
* block size
* @exception ShortBufferException if the given output buffer is too small
* to hold the result
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
int doFinal(byte[] input, int inputOffset, int inputLen,

View File

@ -307,7 +307,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi {
* no padding has been requested (only in encryption mode), and the total
* input length of the data processed by this cipher is not a multiple of
* block size
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
@ -348,7 +348,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi {
* block size
* @exception ShortBufferException if the given output buffer is too small
* to hold the result
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,

View File

@ -317,7 +317,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi {
* no padding has been requested (only in encryption mode), and the total
* input length of the data processed by this cipher is not a multiple of
* block size
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
@ -358,7 +358,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi {
* block size
* @exception ShortBufferException if the given output buffer is too small
* to hold the result
* @exception BadPaddingException if decrypting and padding is choosen,
* @exception BadPaddingException if decrypting and padding is chosen,
* but the last input data does not have proper padding bytes.
*/
protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,

View File

@ -32,7 +32,7 @@ import javax.imageio.metadata.IIOMetadataFormatImpl;
public class StandardMetadataFormat extends IIOMetadataFormatImpl {
// Utility method for nodes with a single atttribute named "value"
// Utility method for nodes with a single attribute named "value"
private void addSingleAttributeElement(String elementName,
String parentName,
int dataType) {

View File

@ -1368,7 +1368,7 @@ class JFIFMarkerSegment extends MarkerSegment {
/**
* An APP2 marker segment containing an ICC profile. In the stream
* a profile larger than 64K is broken up into a series of chunks.
* This inner class represents the complete profile as a single objec,
* This inner class represents the complete profile as a single object,
* combining chunks as necessary.
*/
class ICCMarkerSegment extends MarkerSegment {

View File

@ -1041,7 +1041,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
}
/**
* Rotates the triangle to accomodate the passed in hue.
* Rotates the triangle to accommodate the passed in hue.
*/
private void setAngleFromHue(float hue) {
setHueAngle((1.0 - hue) * Math.PI * 2);

View File

@ -304,7 +304,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
table.put("Synth.doNotSetTextAA", true);
initResourceBundle(table);
// For compatability with apps expecting certain defaults we'll
// For compatibility with apps expecting certain defaults we'll
// populate the table with the values from basic.
initSystemColorDefaults(table);
initComponentDefaults(table);
@ -332,7 +332,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
}
protected void initComponentDefaults(UIDefaults table) {
// For compatability with apps expecting certain defaults we'll
// For compatibility with apps expecting certain defaults we'll
// populate the table with the values from basic.
super.initComponentDefaults(table);

View File

@ -131,7 +131,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
* Returns a <code>SynthPainter</code> that will route the appropriate
* calls to a <code>GTKEngine</code>.
*
* @param state SynthContext indentifying requestor
* @param state SynthContext identifying requestor
* @return SynthPainter
*/
@Override
@ -204,7 +204,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
/**
* Returns the color for the specified state.
*
* @param context SynthContext identifying requester
* @param context SynthContext identifying requestor
* @param state to get the color for
* @param type of the color
* @return Color to render with
@ -305,7 +305,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
* insets will be placed in it, otherwise a new Insets object will be
* created and returned.
*
* @param context SynthContext indentifying requestor
* @param context SynthContext identifying requestor
* @param insets Where to place Insets
* @return Insets.
*/
@ -640,7 +640,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
/**
* Convenience method to get a class specific integer value.
*
* @param context SynthContext indentifying requestor
* @param context SynthContext identifying requestor
* @param key Key identifying class specific value
* @param defaultValue Returned if there is no value for the specified
* type
@ -660,7 +660,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
/**
* Convenience method to get a class specific Insets value.
*
* @param context SynthContext indentifying requestor
* @param context SynthContext identifying requestor
* @param key Key identifying class specific value
* @param defaultValue Returned if there is no value for the specified
* type
@ -680,7 +680,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
/**
* Convenience method to get a class specific Boolean value.
*
* @param context SynthContext indentifying requestor
* @param context SynthContext identifying requestor
* @param key Key identifying class specific value
* @param defaultValue Returned if there is no value for the specified
* type
@ -702,7 +702,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
* to. A Style should NOT assume the opacity will remain this value, the
* developer may reset it or override it.
*
* @param context SynthContext indentifying requestor
* @param context SynthContext identifying requestor
* @return opaque Whether or not the JComponent is opaque.
*/
@Override
@ -843,7 +843,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
// Is it another kind of value ?
if (key != "engine") {
// For backward compatability we'll fallback to the UIManager.
// For backward compatibility we'll fallback to the UIManager.
// We don't go to the UIManager for engine as the engine is GTK
// specific.
Object value = UIManager.get(key);

View File

@ -86,19 +86,19 @@ public class MotifInternalFrameTitlePane
protected void assembleSystemMenu() {
systemMenu = new JPopupMenu();
JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
mi.setMnemonic('R');
mi = systemMenu.add(new JMenuItem(moveAction));
mi.setMnemonic('M');
mi = systemMenu.add(new JMenuItem(sizeAction));
mi.setMnemonic('S');
mi = systemMenu.add(new JMenuItem(iconifyAction));
mi.setMnemonic('n');
mi = systemMenu.add(new JMenuItem(maximizeAction));
mi.setMnemonic('x');
JMenuItem mi = systemMenu.add(restoreAction);
mi.setMnemonic(getButtonMnemonic("restore"));
mi = systemMenu.add(moveAction);
mi.setMnemonic(getButtonMnemonic("move"));
mi = systemMenu.add(sizeAction);
mi.setMnemonic(getButtonMnemonic("size"));
mi = systemMenu.add(iconifyAction);
mi.setMnemonic(getButtonMnemonic("minimize"));
mi = systemMenu.add(maximizeAction);
mi.setMnemonic(getButtonMnemonic("maximize"));
systemMenu.add(new JSeparator());
mi = systemMenu.add(new JMenuItem(closeAction));
mi.setMnemonic('C');
mi = systemMenu.add(closeAction);
mi.setMnemonic(getButtonMnemonic("close"));
systemButton = new SystemButton();
systemButton.addActionListener(new ActionListener() {
@ -124,6 +124,14 @@ public class MotifInternalFrameTitlePane
});
}
private static int getButtonMnemonic(String button) {
try {
return Integer.parseInt(UIManager.getString(
"InternalFrameTitlePane." + button + "Button.mnemonic"));
} catch (NumberFormatException e) {
return -1;
}
}
protected void createButtons() {
minimizeButton = new MinimizeButton();

View File

@ -45,7 +45,7 @@ public class WindowsGraphicsUtils {
/**
* Renders a text String in Windows without the mnemonic.
* This is here because the WindowsUI hiearchy doesn't match the Component heirarchy. All
* This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All
* the overriden paintText methods of the ButtonUI delegates will call this static method.
* <p>
* @param g Graphics context

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -174,7 +174,7 @@ public class WindowsIconFactory implements Serializable
XPStyle xp = XPStyle.getXP();
if (xp != null) {
Skin skin = xp.getSkin(c, part);
JButton b = (JButton)c;
AbstractButton b = (AbstractButton)c;
ButtonModel model = b.getModel();
// Find out if frame is inactive

View File

@ -326,18 +326,27 @@ public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane {
protected void addSystemMenuItems(JPopupMenu menu) {
JMenuItem mi = menu.add(restoreAction);
mi.setMnemonic('R');
mi.setMnemonic(getButtonMnemonic("restore"));
mi = menu.add(moveAction);
mi.setMnemonic('M');
mi.setMnemonic(getButtonMnemonic("move"));
mi = menu.add(sizeAction);
mi.setMnemonic('S');
mi.setMnemonic(getButtonMnemonic("size"));
mi = menu.add(iconifyAction);
mi.setMnemonic('n');
mi.setMnemonic(getButtonMnemonic("minimize"));
mi = menu.add(maximizeAction);
mi.setMnemonic('x');
systemPopupMenu.add(new JSeparator());
mi.setMnemonic(getButtonMnemonic("maximize"));
menu.add(new JSeparator());
mi = menu.add(closeAction);
mi.setMnemonic('C');
mi.setMnemonic(getButtonMnemonic("close"));
}
private static int getButtonMnemonic(String button) {
try {
return Integer.parseInt(UIManager.getString(
"InternalFrameTitlePane." + button + "Button.mnemonic"));
} catch (NumberFormatException e) {
return -1;
}
}
protected void showSystemMenu(){

View File

@ -2012,7 +2012,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
* results.
* </p>
*
* @param component Component the error occured in, may be
* @param component Component the error occurred in, may be
* null indicating the error condition is
* not directly associated with a
* <code>Component</code>.

View File

@ -50,7 +50,7 @@ import sun.swing.DefaultLookup;
* <li>The cursor blinks at about 1/2 second intervals.
* <li>The entire value is selected when focus is gained.
* <li>Shift-left-arrow and shift-right-arrow extend selection
* <li>Cntrl-left-arrow and cntrl-right-arrow act like home and
* <li>Ctrl-left-arrow and ctrl-right-arrow act like home and
* end respectively.
* </ul>
* <p>

View File

@ -162,7 +162,7 @@ public abstract class WindowsTextUI extends BasicTextUI {
* necessarily the region to paint.
* @param c the editor
* @param view View painting for
* @return region drawing occured in
* @return region drawing occurred in
*/
public Shape paintLayer(Graphics g, int offs0, int offs1,
Shape bounds, JTextComponent c, View view) {

View File

@ -190,7 +190,7 @@ class NativeUnpack {
copyInOption(Utils.DEBUG_VERBOSE);
copyInOption(Pack200.Unpacker.DEFLATE_HINT);
if (modtime == Constants.NO_MODTIME) // Dont pass KEEP && NOW
if (modtime == Constants.NO_MODTIME) // Don't pass KEEP && NOW
copyInOption(Utils.UNPACK_MODIFICATION_TIME);
updateProgress(); // reset progress bar
for (;;) {

View File

@ -106,7 +106,7 @@ class PackageWriter extends BandStructure {
Set<Entry> requiredEntries; // for the CP
Map<Attribute.Layout, int[]> backCountTable; // for layout callables
int[][] attrCounts; // count attr. occurences
int[][] attrCounts; // count attr. occurrences
void setup() {
requiredEntries = new HashSet<>();

View File

@ -70,7 +70,7 @@ public interface ListeningConnector extends Connector {
* method).
* <p>
* If <code>arguments</code> contains addressing information. and
* only one conection will be accepted, the {@link #accept accept} method
* only one connection will be accepted, the {@link #accept accept} method
* can be called immediately without calling this method.
*
* @return the address at which the connector is listening

View File

@ -250,7 +250,7 @@ public abstract class TransportService {
*
* @param address
* The address to start listening for connections,
* or <tt>null</tt> to listen on an address choosen
* or <tt>null</tt> to listen on an address chosen
* by the transport service.
*
* @return a listen key to be used in subsequent calls to be
@ -266,7 +266,7 @@ public abstract class TransportService {
public abstract ListenKey startListening(String address) throws IOException;
/**
* Listens on an address choosen by the transport service.
* Listens on an address chosen by the transport service.
*
* <p> This convenience method works as if by invoking {@link
* #startListening(String) startListening(<tt>null</tt>)}. </p>

View File

@ -1291,7 +1291,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
* ambiguous set. If this set itself corresponds to a constructor,
* there is no ambiguity for that pair. In the usual case, one
* of the constructors is a superset of the other so the union is
* just the bigger constuctor.
* just the bigger constructor.
*
* The algorithm here is quadratic in the number of constructors
* with a @ConstructorProperties annotation. Typically this corresponds

View File

@ -644,7 +644,7 @@ public class Introspector {
/**
* Returns the list of "getter" methods for the given class. The list
* is ordered so that isXXX methods appear before getXXX methods - this
* is for compatability with the JavaBeans Introspector.
* is for compatibility with the JavaBeans Introspector.
*/
static List<Method> getReadMethods(Class<?> clazz) {
// return cached result if available
@ -682,7 +682,7 @@ public class Introspector {
* {@code null} if no method is found.
*/
static Method getReadMethod(Class<?> clazz, String property) {
// first character in uppercase (compatability with JavaBeans)
// first character in uppercase (compatibility with JavaBeans)
property = property.substring(0, 1).toUpperCase(Locale.ENGLISH) +
property.substring(1);
String getMethod = GET_METHOD_PREFIX + property;

View File

@ -35,7 +35,7 @@ class TokenMgrError extends Error
*/
/**
* Lexical error occured.
* Lexical error occurred.
*/
static final int LEXICAL_ERROR = 0;
@ -114,10 +114,10 @@ class TokenMgrError extends Error
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexicl error
* curLexState : lexical state in which this error occured
* errorLine : line number when the error occured
* errorColumn : column number when the error occured
* errorAfter : prefix that was seen before this error occured
* curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/

View File

@ -70,7 +70,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent
* @param server The MBean server to register the service with.
* @param name The object name.
*
* @return The passed name paramter.
* @return The passed name parameter.
*
* @exception java.lang.Exception
*/
@ -99,7 +99,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent
*
* @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
@ -147,7 +147,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent
*
* @param inRequest The SnmpMibRequest object holding the list of variable to be set.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
@ -165,7 +165,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent
*
* @param inRequest The SnmpMibRequest object holding the list of variables to be retrieved.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
@ -190,7 +190,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent
*
* @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override

View File

@ -127,7 +127,7 @@ public abstract class SnmpMibAgent
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
public abstract void get(SnmpMibRequest req)
@ -142,7 +142,7 @@ public abstract class SnmpMibAgent
* OIDs from which the next variables should be retrieved.
* This list is composed of <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
public abstract void getNext(SnmpMibRequest req)
@ -166,7 +166,7 @@ public abstract class SnmpMibAgent
* following the first <CODE>nonRepeat</CODE> variables for which
* multiple lexicographic successors are requested.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
@Override
public abstract void getBulk(SnmpMibRequest req, int nonRepeat,
@ -184,7 +184,7 @@ public abstract class SnmpMibAgent
* be set. This list is composed of
* <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
* Throwing an exception in this method will break the
* atomicity of the SET operation. Care must be taken so that
* the exception is thrown in the {@link #check(SnmpMibRequest)}
@ -643,7 +643,7 @@ public abstract class SnmpMibAgent
*
* @return The variable list containing returned values.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
*/
void getBulkWithGetNext(SnmpMibRequest req, int nonRepeat, int maxRepeat)
throws SnmpStatusException {

View File

@ -62,7 +62,7 @@ public interface SnmpMibAgentMBean {
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
* @see SnmpMibAgent#get(SnmpMibRequest)
*/
public void get(SnmpMibRequest req) throws SnmpStatusException;
@ -75,7 +75,7 @@ public interface SnmpMibAgentMBean {
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
* @see SnmpMibAgent#getNext(SnmpMibRequest)
*/
public void getNext(SnmpMibRequest req) throws SnmpStatusException;
@ -97,7 +97,7 @@ public interface SnmpMibAgentMBean {
* following the first <CODE>nonRepeat</CODE> variables for which
* multiple lexicographic successors are requested.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
* @see SnmpMibAgent#getBulk(SnmpMibRequest,int,int)
*/
public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
@ -111,7 +111,7 @@ public interface SnmpMibAgentMBean {
* be set. This list is composed of
* <CODE>SnmpVarBind</CODE> objects.
*
* @exception SnmpStatusException An error occured during the operation.
* @exception SnmpStatusException An error occurred during the operation.
* @see SnmpMibAgent#set(SnmpMibRequest)
*/
public void set(SnmpMibRequest req) throws SnmpStatusException;

View File

@ -119,7 +119,7 @@ public abstract class SnmpMibGroup extends SnmpMibOid
// needed...
// For instance, the subclass could provide a generated isNestedArc()
// method in which the subgroup OID arcs would be hardcoded.
// However, the generic approach was prefered because at this time
// However, the generic approach was preferred because at this time
// groups and subgroups are dynamically registered in the MIB.
//
/**

View File

@ -435,7 +435,7 @@ public abstract class SnmpMibTable extends SnmpMibNode
* If the entry is going to be registered, or if ObjectName's are
* required, then
* {@link com.sun.jmx.snmp.agent.SnmpMibTable#addEntry(SnmpOid,
* ObjectName, Object)} should be prefered.
* ObjectName, Object)} should be preferred.
* <br> This function is mainly provided for backward compatibility.
*
* <p>
@ -1088,7 +1088,7 @@ public abstract class SnmpMibTable extends SnmpMibNode
* @return <code>true</code> if the row can be placed in
* <i>notInService</i> state.
*
* @exception SnmpStatusException An error occured while trying
* @exception SnmpStatusException An error occurred while trying
* to retrieve the row status, and the operation should
* be aborted.
*
@ -2444,7 +2444,7 @@ public abstract class SnmpMibTable extends SnmpMibNode
l1+1,l2);
} else if (pos < tablecount) {
// Vector is large enough to accomodate one additional
// Vector is large enough to accommodate one additional
// entry.
//
// Shift vector, making an empty room at `pos'

View File

@ -581,7 +581,7 @@ final class SnmpRequestTree {
} else if (pos < entrycount) {
// Vectors are large enough to accomodate one additional
// Vectors are large enough to accommodate one additional
// entry.
//
// Shift vectors, making an empty room at `pos'

View File

@ -480,7 +480,7 @@ public abstract class SnmpTableSupport implements SnmpTableEntryFactory,
* associated SnmpIndex.
* <p>
* If the entry is going to be registered, then
* {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be prefered.
* {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be preferred.
* <br> This function is mainly provided for backward compatibility.
*
* @param index The SnmpIndex built from the given entry.

View File

@ -473,7 +473,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean {
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occured while sending the trap.
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
*/
public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
@ -563,7 +563,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean {
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
*
* @exception IOException An I/O error occured while sending the trap.
* @exception IOException An I/O error occurred while sending the trap.
* @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
*/
public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;

View File

@ -559,7 +559,7 @@ class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions {
//
SnmpPduPacket result= executeSubRequest(req,userData);
if (result != null)
// It means that an error occured. The error is already
// It means that an error occurred. The error is already
// formatted by the executeSubRequest
// method.
return result;

View File

@ -52,7 +52,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler {
private SnmpAdaptorServer server = null;
/**
* The constuctor initialize the subrequest with the whole varbind list contained
* The constructor initialize the subrequest with the whole varbind list contained
* in the original request.
*/
protected SnmpSubBulkRequestHandler(SnmpEngine engine,
@ -68,7 +68,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler {
}
/**
* The constuctor initialize the subrequest with the whole varbind list contained
* The constructor initialize the subrequest with the whole varbind list contained
* in the original request.
*/
protected SnmpSubBulkRequestHandler(SnmpAdaptorServer server,

View File

@ -55,7 +55,7 @@ import com.sun.jmx.snmp.ThreadContext;
class SnmpSubNextRequestHandler extends SnmpSubRequestHandler {
private SnmpAdaptorServer server = null;
/**
* The constuctor initialize the subrequest with the whole varbind
* The constructor initialize the subrequest with the whole varbind
* list contained in the original request.
*/
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,

View File

@ -99,7 +99,7 @@ class SnmpSubRequestHandler implements SnmpDefinitions, Runnable {
}
/**
* SNMP V1/V2 The constuctor initialize the subrequest with the whole varbind list contained
* SNMP V1/V2 The constructor initialize the subrequest with the whole varbind list contained
* in the original request.
*/
@SuppressWarnings("unchecked") // cast to NonSyncVector<SnmpVarBind>

View File

@ -568,7 +568,7 @@ public final class Connection implements Runnable {
//System.err.println("ldap.abandon: " + ex);
}
// Dont expect any response for the abandon request.
// Don't expect any response for the abandon request.
}
synchronized void abandonOutstandingReqs(Control[] reqCtls) {
@ -623,7 +623,7 @@ public final class Connection implements Runnable {
//System.err.println("ldap.unbind: " + ex);
}
// Dont expect any response for the unbind request.
// Don't expect any response for the unbind request.
}
/**

View File

@ -191,7 +191,7 @@ final class Filter {
/**
* convert character 'c' that represents a hexadecimal digit to an integer.
* if 'c' is not a hexidecimal digit [0-9A-Fa-f], -1 is returned.
* if 'c' is not a hexadecimal digit [0-9A-Fa-f], -1 is returned.
* otherwise the converted value is returned.
*/
private static int hexchar2int( byte c ) {

View File

@ -176,7 +176,7 @@ final public class LdapCtx extends ComponentDirContext
"com.sun.jndi.ldap.netscape.schemaBugs";
// deprecated
private static final String OLD_NETSCAPE_SCHEMA_BUG =
"com.sun.naming.netscape.schemaBugs"; // for backward compatability
"com.sun.naming.netscape.schemaBugs"; // for backward compatibility
// Timeout for socket connect
private static final String CONNECT_TIMEOUT =

View File

@ -862,7 +862,7 @@ public final class LdapName implements Name {
--end;
}
// Add back the trailing whitespace with a preceeding '\'
// Add back the trailing whitespace with a preceding '\'
// (escaped or unescaped) that was taken off in the above
// loop. Whether or not to retain this whitespace is
// decided below.
@ -918,7 +918,7 @@ public final class LdapName implements Name {
}
// Get rid of the unescaped trailing whitespace with the
// preceeding '\' character that was previously added back.
// preceding '\' character that was previously added back.
int len = buf.length();
if (isWhitespace(buf.charAt(len - 1)) && esc != (end - 1)) {
buf.setLength(len - 1);

View File

@ -109,7 +109,7 @@ public abstract class PartialCompositeContext implements Context, Resolver {
/**
* A cheap way of getting the environment.
* Default implemenation is NOT cheap because it simply calls
* Default implementation is NOT cheap because it simply calls
* getEnvironment(), which most implementations clone before returning.
* Subclass should ALWAYS override this with the cheapest possible way.
* The toolkit knows to clone when necessary.

View File

@ -82,7 +82,7 @@ public class ContextEnumerator implements NamingEnumeration<Binding> {
return ctx.listBindings("");
}
// Subclass should overrride so that instance is of same type as subclass
// Subclass should override so that instance is of same type as subclass
protected ContextEnumerator newEnumerator(Context ctx, int scope,
String contextName, boolean returnSelf) throws NamingException {
return new ContextEnumerator(ctx, scope, contextName, returnSelf);

View File

@ -106,7 +106,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice
return info;
}
/** Open the device from an aplication program.
/** Open the device from an application program.
* Setting the open reference count to -1 here prevents Transmitters and Receivers that
* opened the the device implicitly from closing it. The only way to close the device after
* this call is a call to close().

View File

@ -51,15 +51,6 @@ public final class AiffFileReader extends SunFileReader {
private static final int MAX_READ_LENGTH = 8;
/**
* Constructs a new AiffParser object.
*/
public AiffFileReader() {
}
// METHODS TO IMPLEMENT AudioFileReader
/**
@ -292,9 +283,15 @@ public final class AiffFileReader extends SunFileReader {
throw new UnsupportedAudioFileException("Invalid AIFF/COMM chunksize");
}
// Read header info.
int channels = dis.readShort();
dis.readInt();
int sampleSizeInBits = dis.readShort();
int channels = dis.readUnsignedShort();
if (channels <= 0) {
throw new UnsupportedAudioFileException("Invalid number of channels");
}
dis.readInt(); // numSampleFrames
int sampleSizeInBits = dis.readUnsignedShort();
if (sampleSizeInBits < 1 || sampleSizeInBits > 32) {
throw new UnsupportedAudioFileException("Invalid AIFF/COMM sampleSize");
}
float sampleRate = (float) read_ieee_extended(dis);
chunkRead += (2 + 4 + 2 + 10);
@ -438,7 +435,4 @@ public final class AiffFileReader extends SunFileReader {
return f;
}
}

View File

@ -49,13 +49,6 @@ import javax.sound.sampled.UnsupportedAudioFileException;
*/
public final class AuFileReader extends SunFileReader {
/**
* Constructs a new AuFileReader object.
*/
public AuFileReader() {
}
// METHODS TO IMPLEMENT AudioFileReader
/**
@ -90,7 +83,7 @@ public final class AuFileReader extends SunFileReader {
int frameRate = -1;
int frameSize = -1;
int channels = -1;
int sampleSizeInBits = 0;
final int sampleSizeInBits;
int length = 0;
int nread = 0;
AudioFormat.Encoding encoding = null;
@ -118,6 +111,10 @@ public final class AuFileReader extends SunFileReader {
encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4;
sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4;
channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4;
if (channels <= 0) {
dis.reset();
throw new UnsupportedAudioFileException("Invalid number of channels");
}
frameRate = sampleRate;
@ -372,7 +369,4 @@ public final class AuFileReader extends SunFileReader {
return result;
}
}

View File

@ -34,7 +34,7 @@ public final class AudioSynthesizerPropertyInfo {
/**
* Constructs a <code>AudioSynthesizerPropertyInfo</code> object with a given
* name and value. The <code>description</code> and <code>choices</code>
* are intialized by <code>null</code> values.
* are initialized by <code>null</code> values.
*
* @param name the name of the property
* @param value the current value or class used for values.

View File

@ -378,7 +378,7 @@ final class DirectAudioDevice extends AbstractMixer {
protected final boolean isSource; // true for SourceDataLine, false for TargetDataLine
protected volatile long bytePosition;
protected volatile boolean doIO = false; // true in between start() and stop() calls
protected volatile boolean stoppedWritten = false; // true if a write occured in stopped state
protected volatile boolean stoppedWritten = false; // true if a write occurred in stopped state
protected volatile boolean drained = false; // set to true when drain function returns, set to false in write()
protected boolean monitoring = false;
@ -642,7 +642,7 @@ final class DirectAudioDevice extends AbstractMixer {
public void drain() {
noService = true;
// additional safeguard against draining forever
// this occured on Solaris 8 x86, probably due to a bug
// this occurred on Solaris 8 x86, probably due to a bug
// in the audio driver
int counter = 0;
long startPos = getLongFramePosition();

View File

@ -37,7 +37,7 @@ import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
/**
* SourceDataLine implemention for the SoftMixingMixer.
* SourceDataLine implementation for the SoftMixingMixer.
*
* @author Karl Helgason
*/

Some files were not shown because too many files have changed in this diff Show More