6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
Replace calls to Logger with sun.util.logging.PlatformLogger Reviewed-by: prr, art, alexp, dcherepanov, igor, dav, anthony
This commit is contained in:
parent
6103978814
commit
fc0fc96e68
@ -30,9 +30,8 @@ import java.awt.event.*;
|
|||||||
import java.awt.peer.ComponentPeer;
|
import java.awt.peer.ComponentPeer;
|
||||||
import java.awt.peer.LightweightPeer;
|
import java.awt.peer.LightweightPeer;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import sun.awt.AWTAccessor;
|
import sun.awt.AWTAccessor;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The root event class for all AWT events.
|
* The root event class for all AWT events.
|
||||||
@ -76,7 +75,7 @@ import sun.awt.AWTAccessor;
|
|||||||
* @since 1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract class AWTEvent extends EventObject {
|
public abstract class AWTEvent extends EventObject {
|
||||||
private static final Logger log = Logger.getLogger("java.awt.AWTEvent");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.AWTEvent");
|
||||||
private byte bdata[];
|
private byte bdata[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -252,12 +251,12 @@ public abstract class AWTEvent extends EventObject {
|
|||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
return field;
|
return field;
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
|
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
|
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -549,8 +548,8 @@ public abstract class AWTEvent extends EventObject {
|
|||||||
boolean b = field.getBoolean(this);
|
boolean b = field.getBoolean(this);
|
||||||
field.setBoolean(that, b);
|
field.setBoolean(that, b);
|
||||||
} catch(IllegalAccessException e) {
|
} catch(IllegalAccessException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
|
log.fine("AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -564,8 +563,8 @@ public abstract class AWTEvent extends EventObject {
|
|||||||
try {
|
try {
|
||||||
field.setBoolean(this, false);
|
field.setBoolean(this, false);
|
||||||
} catch(IllegalAccessException e) {
|
} catch(IllegalAccessException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "AWTEvent.dispatched() got IllegalAccessException ", e);
|
log.fine("AWTEvent.dispatched() got IllegalAccessException ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,21 +25,21 @@
|
|||||||
|
|
||||||
package java.awt;
|
package java.awt;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
abstract class AttributeValue {
|
abstract class AttributeValue {
|
||||||
private static final Logger log = Logger.getLogger("java.awt.AttributeValue");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.AttributeValue");
|
||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
private final String[] names;
|
private final String[] names;
|
||||||
|
|
||||||
protected AttributeValue(int value, String[] names) {
|
protected AttributeValue(int value, String[] names) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.log(Level.FINEST, "value = " + value + ", names = " + names);
|
log.finest("value = " + value + ", names = " + names);
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINER)) {
|
|
||||||
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
if ((value < 0) || (names == null) || (value >= names.length)) {
|
if ((value < 0) || (names == null) || (value >= names.length)) {
|
||||||
log.log(Level.FINER, "Assertion failed");
|
log.finer("Assertion failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
@ -60,7 +60,6 @@ import java.lang.reflect.Method;
|
|||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import javax.accessibility.*;
|
import javax.accessibility.*;
|
||||||
import java.util.logging.*;
|
|
||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
|
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
@ -84,6 +83,7 @@ import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
|
|||||||
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
|
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
|
||||||
import sun.awt.RequestFocusController;
|
import sun.awt.RequestFocusController;
|
||||||
import sun.java2d.SunGraphicsEnvironment;
|
import sun.java2d.SunGraphicsEnvironment;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A <em>component</em> is an object having a graphical representation
|
* A <em>component</em> is an object having a graphical representation
|
||||||
@ -178,10 +178,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
Serializable
|
Serializable
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.Component");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Component");
|
||||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.Component");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Component");
|
||||||
private static final Logger focusLog = Logger.getLogger("java.awt.focus.Component");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
|
||||||
private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Component");
|
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The peer of the component. The peer implements the component's
|
* The peer of the component. The peer implements the component's
|
||||||
@ -4478,13 +4478,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// Check that this component belongs to this app-context
|
// Check that this component belongs to this app-context
|
||||||
AppContext compContext = appContext;
|
AppContext compContext = appContext;
|
||||||
if (compContext != null && !compContext.equals(AppContext.getAppContext())) {
|
if (compContext != null && !compContext.equals(AppContext.getAppContext())) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "Event " + e + " is being dispatched on the wrong AppContext");
|
eventLog.fine("Event " + e + " is being dispatched on the wrong AppContext");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINEST)) {
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
eventLog.log(Level.FINEST, "{0}", e);
|
eventLog.finest("{0}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4519,8 +4519,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(Level.FINEST)) {
|
if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "" + e);
|
focusLog.finest("" + e);
|
||||||
}
|
}
|
||||||
// MouseWheel may need to be retargeted here so that
|
// MouseWheel may need to be retargeted here so that
|
||||||
// AWTEventListener sees the event go to the correct
|
// AWTEventListener sees the event go to the correct
|
||||||
@ -4577,8 +4577,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
if (inputContext != null) {
|
if (inputContext != null) {
|
||||||
inputContext.dispatchEvent(e);
|
inputContext.dispatchEvent(e);
|
||||||
if (e.isConsumed()) {
|
if (e.isConsumed()) {
|
||||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(Level.FINEST)) {
|
if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "3579: Skipping " + e);
|
focusLog.finest("3579: Skipping " + e);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4612,8 +4612,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
if (p != null) {
|
if (p != null) {
|
||||||
p.preProcessKeyEvent((KeyEvent)e);
|
p.preProcessKeyEvent((KeyEvent)e);
|
||||||
if (e.isConsumed()) {
|
if (e.isConsumed()) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Pre-process consumed event");
|
focusLog.finest("Pre-process consumed event");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4745,9 +4745,9 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// position relative to its parent.
|
// position relative to its parent.
|
||||||
MouseWheelEvent newMWE;
|
MouseWheelEvent newMWE;
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINEST)) {
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
eventLog.log(Level.FINEST, "dispatchMouseWheelToAncestor");
|
eventLog.finest("dispatchMouseWheelToAncestor");
|
||||||
eventLog.log(Level.FINEST, "orig event src is of " + e.getSource().getClass());
|
eventLog.finest("orig event src is of " + e.getSource().getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parent field for Window refers to the owning Window.
|
/* parent field for Window refers to the owning Window.
|
||||||
@ -4768,8 +4768,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINEST)) {
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
eventLog.log(Level.FINEST, "new event src is " + anc.getClass());
|
eventLog.finest("new event src is " + anc.getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anc != null && anc.eventEnabled(e)) {
|
if (anc != null && anc.eventEnabled(e)) {
|
||||||
@ -5264,11 +5264,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// Should only be called while holding the tree lock
|
// Should only be called while holding the tree lock
|
||||||
int numListening(long mask) {
|
int numListening(long mask) {
|
||||||
// One mask or the other, but not neither or both.
|
// One mask or the other, but not neither or both.
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
if ((mask != AWTEvent.HIERARCHY_EVENT_MASK) &&
|
if ((mask != AWTEvent.HIERARCHY_EVENT_MASK) &&
|
||||||
(mask != AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK))
|
(mask != AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK))
|
||||||
{
|
{
|
||||||
eventLog.log(Level.FINE, "Assertion failed");
|
eventLog.fine("Assertion failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((mask == AWTEvent.HIERARCHY_EVENT_MASK &&
|
if ((mask == AWTEvent.HIERARCHY_EVENT_MASK &&
|
||||||
@ -5305,9 +5305,9 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
break;
|
break;
|
||||||
case HierarchyEvent.ANCESTOR_MOVED:
|
case HierarchyEvent.ANCESTOR_MOVED:
|
||||||
case HierarchyEvent.ANCESTOR_RESIZED:
|
case HierarchyEvent.ANCESTOR_RESIZED:
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (changeFlags != 0) {
|
if (changeFlags != 0) {
|
||||||
eventLog.log(Level.FINE, "Assertion (changeFlags == 0) failed");
|
eventLog.fine("Assertion (changeFlags == 0) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hierarchyBoundsListener != null ||
|
if (hierarchyBoundsListener != null ||
|
||||||
@ -5321,8 +5321,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// assert false
|
// assert false
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "This code must never be reached");
|
eventLog.fine("This code must never be reached");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -7383,8 +7383,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
CausedFocusEvent.Cause cause)
|
CausedFocusEvent.Cause cause)
|
||||||
{
|
{
|
||||||
if (!isRequestFocusAccepted(temporary, focusedWindowChangeAllowed, cause)) {
|
if (!isRequestFocusAccepted(temporary, focusedWindowChangeAllowed, cause)) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "requestFocus is not accepted");
|
focusLog.finest("requestFocus is not accepted");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7395,8 +7395,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
Component window = this;
|
Component window = this;
|
||||||
while ( (window != null) && !(window instanceof Window)) {
|
while ( (window != null) && !(window instanceof Window)) {
|
||||||
if (!window.isVisible()) {
|
if (!window.isVisible()) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "component is recurively invisible");
|
focusLog.finest("component is recurively invisible");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7407,15 +7407,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
Component heavyweight = (peer instanceof LightweightPeer)
|
Component heavyweight = (peer instanceof LightweightPeer)
|
||||||
? getNativeContainer() : this;
|
? getNativeContainer() : this;
|
||||||
if (heavyweight == null || !heavyweight.isVisible()) {
|
if (heavyweight == null || !heavyweight.isVisible()) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Component is not a part of visible hierarchy");
|
focusLog.finest("Component is not a part of visible hierarchy");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
peer = heavyweight.peer;
|
peer = heavyweight.peer;
|
||||||
if (peer == null) {
|
if (peer == null) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Peer is null");
|
focusLog.finest("Peer is null");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7427,12 +7427,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
if (!success) {
|
if (!success) {
|
||||||
KeyboardFocusManager.getCurrentKeyboardFocusManager
|
KeyboardFocusManager.getCurrentKeyboardFocusManager
|
||||||
(appContext).dequeueKeyEvents(time, this);
|
(appContext).dequeueKeyEvents(time, this);
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Peer request failed");
|
focusLog.finest("Peer request failed");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Pass for " + this);
|
focusLog.finest("Pass for " + this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
@ -7443,24 +7443,24 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
CausedFocusEvent.Cause cause)
|
CausedFocusEvent.Cause cause)
|
||||||
{
|
{
|
||||||
if (!isFocusable() || !isVisible()) {
|
if (!isFocusable() || !isVisible()) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Not focusable or not visible");
|
focusLog.finest("Not focusable or not visible");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentPeer peer = this.peer;
|
ComponentPeer peer = this.peer;
|
||||||
if (peer == null) {
|
if (peer == null) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "peer is null");
|
focusLog.finest("peer is null");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Window window = getContainingWindow();
|
Window window = getContainingWindow();
|
||||||
if (window == null || !((Window)window).isFocusableWindow()) {
|
if (window == null || !((Window)window).isFocusableWindow()) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Component doesn't have toplevel");
|
focusLog.finest("Component doesn't have toplevel");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7481,8 +7481,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// Controller is supposed to verify focus transfers and for this it
|
// Controller is supposed to verify focus transfers and for this it
|
||||||
// should know both from and to components. And it shouldn't verify
|
// should know both from and to components. And it shouldn't verify
|
||||||
// transfers from when these components are equal.
|
// transfers from when these components are equal.
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "focus owner is null or this");
|
focusLog.finest("focus owner is null or this");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -7494,8 +7494,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// most recent focus owner. But most recent focus owner can be
|
// most recent focus owner. But most recent focus owner can be
|
||||||
// changed by requestFocsuXXX() call only, so this transfer has
|
// changed by requestFocsuXXX() call only, so this transfer has
|
||||||
// been already approved.
|
// been already approved.
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "cause is activation");
|
focusLog.finest("cause is activation");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -7505,8 +7505,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
temporary,
|
temporary,
|
||||||
focusedWindowChangeAllowed,
|
focusedWindowChangeAllowed,
|
||||||
cause);
|
cause);
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "RequestFocusController returns {0}", ret);
|
focusLog.finest("RequestFocusController returns {0}", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -7597,7 +7597,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean transferFocus(boolean clearOnFailure) {
|
boolean transferFocus(boolean clearOnFailure) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("clearOnFailure = " + clearOnFailure);
|
focusLog.finer("clearOnFailure = " + clearOnFailure);
|
||||||
}
|
}
|
||||||
Component toFocus = getNextFocusCandidate();
|
Component toFocus = getNextFocusCandidate();
|
||||||
@ -7606,12 +7606,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
|
res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
|
||||||
}
|
}
|
||||||
if (clearOnFailure && !res) {
|
if (clearOnFailure && !res) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("clear global focus owner");
|
focusLog.finer("clear global focus owner");
|
||||||
}
|
}
|
||||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("returning result: " + res);
|
focusLog.finer("returning result: " + res);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@ -7626,19 +7626,19 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
comp = rootAncestor;
|
comp = rootAncestor;
|
||||||
rootAncestor = comp.getFocusCycleRootAncestor();
|
rootAncestor = comp.getFocusCycleRootAncestor();
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
|
focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
|
||||||
}
|
}
|
||||||
Component candidate = null;
|
Component candidate = null;
|
||||||
if (rootAncestor != null) {
|
if (rootAncestor != null) {
|
||||||
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
||||||
Component toFocus = policy.getComponentAfter(rootAncestor, comp);
|
Component toFocus = policy.getComponentAfter(rootAncestor, comp);
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("component after is " + toFocus);
|
focusLog.finer("component after is " + toFocus);
|
||||||
}
|
}
|
||||||
if (toFocus == null) {
|
if (toFocus == null) {
|
||||||
toFocus = policy.getDefaultComponent(rootAncestor);
|
toFocus = policy.getDefaultComponent(rootAncestor);
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("default component is " + toFocus);
|
focusLog.finer("default component is " + toFocus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7650,7 +7650,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
candidate = toFocus;
|
candidate = toFocus;
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("Focus transfer candidate: " + candidate);
|
focusLog.finer("Focus transfer candidate: " + candidate);
|
||||||
}
|
}
|
||||||
return candidate;
|
return candidate;
|
||||||
@ -7687,12 +7687,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("clear global focus owner");
|
focusLog.finer("clear global focus owner");
|
||||||
}
|
}
|
||||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("returning result: " + res);
|
focusLog.finer("returning result: " + res);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@ -9448,7 +9448,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
|
|
||||||
if (!areBoundsValid()) {
|
if (!areBoundsValid()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -9484,7 +9484,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
this.compoundShape = shape;
|
this.compoundShape = shape;
|
||||||
Point compAbsolute = getLocationOnWindow();
|
Point compAbsolute = getLocationOnWindow();
|
||||||
if (mixingLog.isLoggable(Level.FINER)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; compAbsolute=" + compAbsolute + "; shape=" + shape);
|
"; compAbsolute=" + compAbsolute + "; shape=" + shape);
|
||||||
}
|
}
|
||||||
@ -9618,7 +9618,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
Region s = getNormalShape();
|
Region s = getNormalShape();
|
||||||
|
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; normalShape=" + s);
|
mixingLog.fine("this = " + this + "; normalShape=" + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9652,7 +9652,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("currentShape=" + s);
|
mixingLog.fine("currentShape=" + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9662,12 +9662,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
void applyCurrentShape() {
|
void applyCurrentShape() {
|
||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
if (!areBoundsValid()) {
|
if (!areBoundsValid()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||||
}
|
}
|
||||||
return; // Because applyCompoundShape() ignores such components anyway
|
return; // Because applyCompoundShape() ignores such components anyway
|
||||||
}
|
}
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
applyCompoundShape(calculateCurrentShape());
|
applyCompoundShape(calculateCurrentShape());
|
||||||
@ -9676,7 +9676,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
final void subtractAndApplyShape(Region s) {
|
final void subtractAndApplyShape(Region s) {
|
||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
|
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; s=" + s);
|
mixingLog.fine("this = " + this + "; s=" + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9723,7 +9723,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
|
|
||||||
void mixOnShowing() {
|
void mixOnShowing() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
if (!isMixingNeeded()) {
|
if (!isMixingNeeded()) {
|
||||||
@ -9741,7 +9741,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
// We cannot be sure that the peer exists at this point, so we need the argument
|
// We cannot be sure that the peer exists at this point, so we need the argument
|
||||||
// to find out whether the hiding component is (well, actually was) a LW or a HW.
|
// to find out whether the hiding component is (well, actually was) a LW or a HW.
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; isLightweight = " + isLightweight);
|
mixingLog.fine("this = " + this + "; isLightweight = " + isLightweight);
|
||||||
}
|
}
|
||||||
if (!isMixingNeeded()) {
|
if (!isMixingNeeded()) {
|
||||||
@ -9755,7 +9755,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
|
|
||||||
void mixOnReshaping() {
|
void mixOnReshaping() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
if (!isMixingNeeded()) {
|
if (!isMixingNeeded()) {
|
||||||
@ -9774,7 +9774,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
boolean becameHigher = newZorder < oldZorder;
|
boolean becameHigher = newZorder < oldZorder;
|
||||||
Container parent = getContainer();
|
Container parent = getContainer();
|
||||||
|
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; oldZorder=" + oldZorder + "; newZorder=" + newZorder + "; parent=" + parent);
|
"; oldZorder=" + oldZorder + "; newZorder=" + newZorder + "; parent=" + parent);
|
||||||
}
|
}
|
||||||
@ -9818,13 +9818,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
|
|
||||||
final boolean isMixingNeeded() {
|
final boolean isMixingNeeded() {
|
||||||
if (SunToolkit.getSunAwtDisableMixing()) {
|
if (SunToolkit.getSunAwtDisableMixing()) {
|
||||||
if (mixingLog.isLoggable(Level.FINEST)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
mixingLog.finest("this = " + this + "; Mixing disabled via sun.awt.disableMixing");
|
mixingLog.finest("this = " + this + "; Mixing disabled via sun.awt.disableMixing");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!areBoundsValid()) {
|
if (!areBoundsValid()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -9832,7 +9832,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
Window window = getContainingWindow();
|
Window window = getContainingWindow();
|
||||||
if (window != null) {
|
if (window != null) {
|
||||||
if (!window.hasHeavyweightDescendants() || !window.hasLightweightDescendants()) {
|
if (!window.hasHeavyweightDescendants() || !window.hasLightweightDescendants()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("containing window = " + window +
|
mixingLog.fine("containing window = " + window +
|
||||||
"; has h/w descendants = " + window.hasHeavyweightDescendants() +
|
"; has h/w descendants = " + window.hasHeavyweightDescendants() +
|
||||||
"; has l/w descendants = " + window.hasLightweightDescendants());
|
"; has l/w descendants = " + window.hasLightweightDescendants());
|
||||||
@ -9840,8 +9840,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.finest("this = " + this + "; containing window is null");
|
mixingLog.fine("this = " + this + "; containing window is null");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,10 @@ import java.util.EventListener;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import javax.accessibility.*;
|
import javax.accessibility.*;
|
||||||
|
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.CausedFocusEvent;
|
import sun.awt.CausedFocusEvent;
|
||||||
import sun.awt.PeerEvent;
|
import sun.awt.PeerEvent;
|
||||||
@ -85,8 +85,8 @@ import sun.java2d.pipe.Region;
|
|||||||
*/
|
*/
|
||||||
public class Container extends Component {
|
public class Container extends Component {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.Container");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Container");
|
||||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.Container");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Container");
|
||||||
|
|
||||||
private static final Component[] EMPTY_ARRAY = new Component[0];
|
private static final Component[] EMPTY_ARRAY = new Component[0];
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ public class Container extends Component {
|
|||||||
private transient int numOfHWComponents = 0;
|
private transient int numOfHWComponents = 0;
|
||||||
private transient int numOfLWComponents = 0;
|
private transient int numOfLWComponents = 0;
|
||||||
|
|
||||||
private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Container");
|
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Container");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @serialField ncomponents int
|
* @serialField ncomponents int
|
||||||
@ -1287,33 +1287,33 @@ public class Container extends Component {
|
|||||||
int superListening = super.numListening(mask);
|
int superListening = super.numListening(mask);
|
||||||
|
|
||||||
if (mask == AWTEvent.HIERARCHY_EVENT_MASK) {
|
if (mask == AWTEvent.HIERARCHY_EVENT_MASK) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
// Verify listeningChildren is correct
|
// Verify listeningChildren is correct
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (Component comp : component) {
|
for (Component comp : component) {
|
||||||
sum += comp.numListening(mask);
|
sum += comp.numListening(mask);
|
||||||
}
|
}
|
||||||
if (listeningChildren != sum) {
|
if (listeningChildren != sum) {
|
||||||
eventLog.log(Level.FINE, "Assertion (listeningChildren == sum) failed");
|
eventLog.fine("Assertion (listeningChildren == sum) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return listeningChildren + superListening;
|
return listeningChildren + superListening;
|
||||||
} else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) {
|
} else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
// Verify listeningBoundsChildren is correct
|
// Verify listeningBoundsChildren is correct
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (Component comp : component) {
|
for (Component comp : component) {
|
||||||
sum += comp.numListening(mask);
|
sum += comp.numListening(mask);
|
||||||
}
|
}
|
||||||
if (listeningBoundsChildren != sum) {
|
if (listeningBoundsChildren != sum) {
|
||||||
eventLog.log(Level.FINE, "Assertion (listeningBoundsChildren == sum) failed");
|
eventLog.fine("Assertion (listeningBoundsChildren == sum) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return listeningBoundsChildren + superListening;
|
return listeningBoundsChildren + superListening;
|
||||||
} else {
|
} else {
|
||||||
// assert false;
|
// assert false;
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "This code must never be reached");
|
eventLog.fine("This code must never be reached");
|
||||||
}
|
}
|
||||||
return superListening;
|
return superListening;
|
||||||
}
|
}
|
||||||
@ -1321,13 +1321,13 @@ public class Container extends Component {
|
|||||||
|
|
||||||
// Should only be called while holding tree lock
|
// Should only be called while holding tree lock
|
||||||
void adjustListeningChildren(long mask, int num) {
|
void adjustListeningChildren(long mask, int num) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK ||
|
boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK ||
|
||||||
mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK ||
|
mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK ||
|
||||||
mask == (AWTEvent.HIERARCHY_EVENT_MASK |
|
mask == (AWTEvent.HIERARCHY_EVENT_MASK |
|
||||||
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK));
|
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK));
|
||||||
if (!toAssert) {
|
if (!toAssert) {
|
||||||
eventLog.log(Level.FINE, "Assertion failed");
|
eventLog.fine("Assertion failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,14 +1362,14 @@ public class Container extends Component {
|
|||||||
|
|
||||||
// Should only be called while holding tree lock
|
// Should only be called while holding tree lock
|
||||||
int countHierarchyMembers() {
|
int countHierarchyMembers() {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
// Verify descendantsCount is correct
|
// Verify descendantsCount is correct
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (Component comp : component) {
|
for (Component comp : component) {
|
||||||
sum += comp.countHierarchyMembers();
|
sum += comp.countHierarchyMembers();
|
||||||
}
|
}
|
||||||
if (descendantsCount != sum) {
|
if (descendantsCount != sum) {
|
||||||
log.log(Level.FINE, "Assertion (descendantsCount == sum) failed");
|
log.fine("Assertion (descendantsCount == sum) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return descendantsCount + 1;
|
return descendantsCount + 1;
|
||||||
@ -3924,7 +3924,7 @@ public class Container extends Component {
|
|||||||
|
|
||||||
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) {
|
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) {
|
||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder);
|
"; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder);
|
||||||
}
|
}
|
||||||
@ -3961,7 +3961,7 @@ public class Container extends Component {
|
|||||||
|
|
||||||
final void recursiveApplyCurrentShape(int fromZorder, int toZorder) {
|
final void recursiveApplyCurrentShape(int fromZorder, int toZorder) {
|
||||||
checkTreeLock();
|
checkTreeLock();
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; fromZ=" + fromZorder + "; toZ=" + toZorder);
|
"; fromZ=" + fromZorder + "; toZ=" + toZorder);
|
||||||
}
|
}
|
||||||
@ -4065,7 +4065,7 @@ public class Container extends Component {
|
|||||||
@Override
|
@Override
|
||||||
void mixOnShowing() {
|
void mixOnShowing() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4090,7 +4090,7 @@ public class Container extends Component {
|
|||||||
@Override
|
@Override
|
||||||
void mixOnHiding(boolean isLightweight) {
|
void mixOnHiding(boolean isLightweight) {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; isLightweight=" + isLightweight);
|
"; isLightweight=" + isLightweight);
|
||||||
}
|
}
|
||||||
@ -4104,7 +4104,7 @@ public class Container extends Component {
|
|||||||
@Override
|
@Override
|
||||||
void mixOnReshaping() {
|
void mixOnReshaping() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4139,7 +4139,7 @@ public class Container extends Component {
|
|||||||
@Override
|
@Override
|
||||||
void mixOnZOrderChanging(int oldZorder, int newZorder) {
|
void mixOnZOrderChanging(int oldZorder, int newZorder) {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this +
|
mixingLog.fine("this = " + this +
|
||||||
"; oldZ=" + oldZorder + "; newZ=" + newZorder);
|
"; oldZ=" + oldZorder + "; newZ=" + newZorder);
|
||||||
}
|
}
|
||||||
@ -4160,7 +4160,7 @@ public class Container extends Component {
|
|||||||
@Override
|
@Override
|
||||||
void mixOnValidating() {
|
void mixOnValidating() {
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
if (mixingLog.isLoggable(Level.FINE)) {
|
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
mixingLog.fine("this = " + this);
|
mixingLog.fine("this = " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4206,7 +4206,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
|
|||||||
*/
|
*/
|
||||||
private static final int LWD_MOUSE_DRAGGED_OVER = 1500;
|
private static final int LWD_MOUSE_DRAGGED_OVER = 1500;
|
||||||
|
|
||||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.LightweightDispatcher");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
|
||||||
|
|
||||||
LightweightDispatcher(Container nativeContainer) {
|
LightweightDispatcher(Container nativeContainer) {
|
||||||
this.nativeContainer = nativeContainer;
|
this.nativeContainer = nativeContainer;
|
||||||
@ -4348,10 +4348,10 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
|
|||||||
// This may send it somewhere that doesn't have MouseWheelEvents
|
// This may send it somewhere that doesn't have MouseWheelEvents
|
||||||
// enabled. In this case, Component.dispatchEventImpl() will
|
// enabled. In this case, Component.dispatchEventImpl() will
|
||||||
// retarget the event to a parent that DOES have the events enabled.
|
// retarget the event to a parent that DOES have the events enabled.
|
||||||
if (eventLog.isLoggable(Level.FINEST) && (mouseOver != null)) {
|
if (eventLog.isLoggable(PlatformLogger.FINEST) && (mouseOver != null)) {
|
||||||
eventLog.log(Level.FINEST, "retargeting mouse wheel to " +
|
eventLog.finest("retargeting mouse wheel to " +
|
||||||
mouseOver.getName() + ", " +
|
mouseOver.getName() + ", " +
|
||||||
mouseOver.getClass());
|
mouseOver.getClass());
|
||||||
}
|
}
|
||||||
retargetMouseEvent(mouseOver, id, e);
|
retargetMouseEvent(mouseOver, id, e);
|
||||||
break;
|
break;
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
*/
|
*/
|
||||||
package java.awt;
|
package java.awt;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A FocusTraversalPolicy that determines traversal order based on the order
|
* A FocusTraversalPolicy that determines traversal order based on the order
|
||||||
@ -60,7 +60,7 @@ import java.util.ArrayList;
|
|||||||
public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
||||||
implements java.io.Serializable
|
implements java.io.Serializable
|
||||||
{
|
{
|
||||||
private static final Logger log = Logger.getLogger("java.awt.ContainerOrderFocusTraversalPolicy");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.ContainerOrderFocusTraversalPolicy");
|
||||||
|
|
||||||
final private int FORWARD_TRAVERSAL = 0;
|
final private int FORWARD_TRAVERSAL = 0;
|
||||||
final private int BACKWARD_TRAVERSAL = 1;
|
final private int BACKWARD_TRAVERSAL = 1;
|
||||||
@ -165,7 +165,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
if (getImplicitDownCycleTraversal()) {
|
if (getImplicitDownCycleTraversal()) {
|
||||||
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
|
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
|
||||||
|
|
||||||
if (retComp != null && log.isLoggable(Level.FINE)) {
|
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Transfered focus down-cycle to " + retComp +
|
log.fine("### Transfered focus down-cycle to " + retComp +
|
||||||
" in the focus cycle root " + cont);
|
" in the focus cycle root " + cont);
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
|
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
|
||||||
cont.getFocusTraversalPolicy().getLastComponent(cont));
|
cont.getFocusTraversalPolicy().getLastComponent(cont));
|
||||||
|
|
||||||
if (retComp != null && log.isLoggable(Level.FINE)) {
|
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
|
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
* aComponent is null
|
* aComponent is null
|
||||||
*/
|
*/
|
||||||
public Component getComponentAfter(Container aContainer, Component aComponent) {
|
public Component getComponentAfter(Container aContainer, Component aComponent) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent);
|
||||||
|
|
||||||
if (aContainer == null || aComponent == null) {
|
if (aContainer == null || aComponent == null) {
|
||||||
throw new IllegalArgumentException("aContainer and aComponent cannot be null");
|
throw new IllegalArgumentException("aContainer and aComponent cannot be null");
|
||||||
@ -236,7 +236,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
// See if the component is inside of policy provider.
|
// See if the component is inside of policy provider.
|
||||||
Container provider = getTopmostProvider(aContainer, aComponent);
|
Container provider = getTopmostProvider(aContainer, aComponent);
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
// Null result means that we overstepped the limit of the FTP's cycle.
|
// Null result means that we overstepped the limit of the FTP's cycle.
|
||||||
// In that case we must quit the cycle, otherwise return the component found.
|
// In that case we must quit the cycle, otherwise return the component found.
|
||||||
if (afterComp != null) {
|
if (afterComp != null) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + afterComp);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
|
||||||
return afterComp;
|
return afterComp;
|
||||||
}
|
}
|
||||||
aComponent = provider;
|
aComponent = provider;
|
||||||
@ -255,12 +255,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
|
|
||||||
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
||||||
|
|
||||||
int index = getComponentIndex(cycle, aComponent);
|
int index = getComponentIndex(cycle, aComponent);
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
||||||
}
|
}
|
||||||
return getFirstComponent(aContainer);
|
return getFirstComponent(aContainer);
|
||||||
@ -325,7 +325,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
// See if the component is inside of policy provider.
|
// See if the component is inside of policy provider.
|
||||||
Container provider = getTopmostProvider(aContainer, aComponent);
|
Container provider = getTopmostProvider(aContainer, aComponent);
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
// Null result means that we overstepped the limit of the FTP's cycle.
|
// Null result means that we overstepped the limit of the FTP's cycle.
|
||||||
// In that case we must quit the cycle, otherwise return the component found.
|
// In that case we must quit the cycle, otherwise return the component found.
|
||||||
if (beforeComp != null) {
|
if (beforeComp != null) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + beforeComp);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
|
||||||
return beforeComp;
|
return beforeComp;
|
||||||
}
|
}
|
||||||
aComponent = provider;
|
aComponent = provider;
|
||||||
@ -349,12 +349,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
|
|
||||||
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
||||||
|
|
||||||
int index = getComponentIndex(cycle, aComponent);
|
int index = getComponentIndex(cycle, aComponent);
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
||||||
}
|
}
|
||||||
return getLastComponent(aContainer);
|
return getLastComponent(aContainer);
|
||||||
@ -401,7 +401,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
public Component getFirstComponent(Container aContainer) {
|
public Component getFirstComponent(Container aContainer) {
|
||||||
List<Component> cycle;
|
List<Component> cycle;
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Getting first component in " + aContainer);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
|
||||||
if (aContainer == null) {
|
if (aContainer == null) {
|
||||||
throw new IllegalArgumentException("aContainer cannot be null");
|
throw new IllegalArgumentException("aContainer cannot be null");
|
||||||
|
|
||||||
@ -420,10 +420,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cycle.size() == 0) {
|
if (cycle.size() == 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
|
||||||
|
|
||||||
for (Component comp : cycle) {
|
for (Component comp : cycle) {
|
||||||
if (accept(comp)) {
|
if (accept(comp)) {
|
||||||
@ -451,7 +451,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
*/
|
*/
|
||||||
public Component getLastComponent(Container aContainer) {
|
public Component getLastComponent(Container aContainer) {
|
||||||
List<Component> cycle;
|
List<Component> cycle;
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Getting last component in " + aContainer);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
|
||||||
|
|
||||||
if (aContainer == null) {
|
if (aContainer == null) {
|
||||||
throw new IllegalArgumentException("aContainer cannot be null");
|
throw new IllegalArgumentException("aContainer cannot be null");
|
||||||
@ -470,10 +470,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cycle.size() == 0) {
|
if (cycle.size() == 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
|
||||||
|
|
||||||
for (int i= cycle.size() - 1; i >= 0; i--) {
|
for (int i= cycle.size() - 1; i >= 0; i--) {
|
||||||
Component comp = cycle.get(i);
|
Component comp = cycle.get(i);
|
||||||
|
@ -36,10 +36,10 @@ import java.util.Hashtable;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
|
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class to encapsulate the bitmap representation of the mouse cursor.
|
* A class to encapsulate the bitmap representation of the mouse cursor.
|
||||||
*
|
*
|
||||||
@ -191,7 +191,7 @@ public class Cursor implements java.io.Serializable {
|
|||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 8028237497568985504L;
|
private static final long serialVersionUID = 8028237497568985504L;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.Cursor");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Cursor");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
/* ensure that the necessary native libraries are loaded */
|
/* ensure that the necessary native libraries are loaded */
|
||||||
@ -298,8 +298,8 @@ public class Cursor implements java.io.Serializable {
|
|||||||
String key = prefix + DotFileSuffix;
|
String key = prefix + DotFileSuffix;
|
||||||
|
|
||||||
if (!systemCustomCursorProperties.containsKey(key)) {
|
if (!systemCustomCursorProperties.containsKey(key)) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
|
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -353,8 +353,8 @@ public class Cursor implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cursor == null) {
|
if (cursor == null) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
|
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
systemCustomCursors.put(name, cursor);
|
systemCustomCursors.put(name, cursor);
|
||||||
|
@ -35,8 +35,7 @@ import java.util.Iterator;
|
|||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
@ -62,7 +61,7 @@ import sun.awt.CausedFocusEvent;
|
|||||||
* @since 1.4
|
* @since 1.4
|
||||||
*/
|
*/
|
||||||
public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
||||||
private static final Logger focusLog = Logger.getLogger("java.awt.focus.DefaultKeyboardFocusManager");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.DefaultKeyboardFocusManager");
|
||||||
|
|
||||||
// null weak references to not create too many objects
|
// null weak references to not create too many objects
|
||||||
private static final WeakReference<Window> NULL_WINDOW_WR =
|
private static final WeakReference<Window> NULL_WINDOW_WR =
|
||||||
@ -275,7 +274,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
* <code>false</code> otherwise
|
* <code>false</code> otherwise
|
||||||
*/
|
*/
|
||||||
public boolean dispatchEvent(AWTEvent e) {
|
public boolean dispatchEvent(AWTEvent e) {
|
||||||
if (focusLog.isLoggable(Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e);
|
if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e);
|
||||||
switch (e.getID()) {
|
switch (e.getID()) {
|
||||||
case WindowEvent.WINDOW_GAINED_FOCUS: {
|
case WindowEvent.WINDOW_GAINED_FOCUS: {
|
||||||
WindowEvent we = (WindowEvent)e;
|
WindowEvent we = (WindowEvent)e;
|
||||||
@ -378,9 +377,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
|
|
||||||
// The component which last has the focus when this window was focused
|
// The component which last has the focus when this window was focused
|
||||||
// should receive focus first
|
// should receive focus first
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "tempLost {0}, toFocus {1}",
|
focusLog.finer("tempLost {0}, toFocus {1}",
|
||||||
new Object[]{tempLost, toFocus});
|
tempLost, toFocus);
|
||||||
}
|
}
|
||||||
if (tempLost != null) {
|
if (tempLost != null) {
|
||||||
tempLost.requestFocusInWindow(CausedFocusEvent.Cause.ACTIVATION);
|
tempLost.requestFocusInWindow(CausedFocusEvent.Cause.ACTIVATION);
|
||||||
@ -447,8 +446,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
Component oldFocusOwner = getGlobalFocusOwner();
|
Component oldFocusOwner = getGlobalFocusOwner();
|
||||||
Component newFocusOwner = fe.getComponent();
|
Component newFocusOwner = fe.getComponent();
|
||||||
if (oldFocusOwner == newFocusOwner) {
|
if (oldFocusOwner == newFocusOwner) {
|
||||||
if (focusLog.isLoggable(Level.FINE)) {
|
if (focusLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
focusLog.log(Level.FINE, "Skipping {0} because focus owner is the same", new Object[] {e});
|
focusLog.fine("Skipping {0} because focus owner is the same", e);
|
||||||
}
|
}
|
||||||
// We can't just drop the event - there could be
|
// We can't just drop the event - there could be
|
||||||
// type-ahead markers associated with it.
|
// type-ahead markers associated with it.
|
||||||
@ -565,16 +564,16 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
FocusEvent fe = (FocusEvent)e;
|
FocusEvent fe = (FocusEvent)e;
|
||||||
Component currentFocusOwner = getGlobalFocusOwner();
|
Component currentFocusOwner = getGlobalFocusOwner();
|
||||||
if (currentFocusOwner == null) {
|
if (currentFocusOwner == null) {
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because focus owner is null",
|
if (focusLog.isLoggable(PlatformLogger.FINE))
|
||||||
new Object[] {e});
|
focusLog.fine("Skipping {0} because focus owner is null", e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Ignore cases where a Component loses focus to itself.
|
// Ignore cases where a Component loses focus to itself.
|
||||||
// If we make a mistake because of retargeting, then the
|
// If we make a mistake because of retargeting, then the
|
||||||
// FOCUS_GAINED handler will correct it.
|
// FOCUS_GAINED handler will correct it.
|
||||||
if (currentFocusOwner == fe.getOppositeComponent()) {
|
if (currentFocusOwner == fe.getOppositeComponent()) {
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because current focus owner is equal to opposite",
|
if (focusLog.isLoggable(PlatformLogger.FINE))
|
||||||
new Object[] {e});
|
focusLog.fine("Skipping {0} because current focus owner is equal to opposite", e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,9 +641,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
Window losingFocusWindow = we.getWindow();
|
Window losingFocusWindow = we.getWindow();
|
||||||
Window activeWindow = getGlobalActiveWindow();
|
Window activeWindow = getGlobalActiveWindow();
|
||||||
Window oppositeWindow = we.getOppositeWindow();
|
Window oppositeWindow = we.getOppositeWindow();
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Active {0}, Current focused {1}, losing focus {2} opposite {3}",
|
if (focusLog.isLoggable(PlatformLogger.FINE))
|
||||||
new Object[] {activeWindow, currentFocusedWindow,
|
focusLog.fine("Active {0}, Current focused {1}, losing focus {2} opposite {3}",
|
||||||
losingFocusWindow, oppositeWindow});
|
activeWindow, currentFocusedWindow,
|
||||||
|
losingFocusWindow, oppositeWindow);
|
||||||
if (currentFocusedWindow == null) {
|
if (currentFocusedWindow == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -828,7 +828,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ke != null) {
|
if (ke != null) {
|
||||||
focusLog.log(Level.FINER, "Pumping approved event {0}", new Object[] {ke});
|
focusLog.finer("Pumping approved event {0}", ke);
|
||||||
enqueuedKeyEvents.removeFirst();
|
enqueuedKeyEvents.removeFirst();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -843,14 +843,14 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
* Dumps the list of type-ahead queue markers to stderr
|
* Dumps the list of type-ahead queue markers to stderr
|
||||||
*/
|
*/
|
||||||
void dumpMarkers() {
|
void dumpMarkers() {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, ">>> Markers dump, time: {0}", System.currentTimeMillis());
|
focusLog.finest(">>> Markers dump, time: {0}", System.currentTimeMillis());
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (typeAheadMarkers.size() != 0) {
|
if (typeAheadMarkers.size() != 0) {
|
||||||
Iterator iter = typeAheadMarkers.iterator();
|
Iterator iter = typeAheadMarkers.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
TypeAheadMarker marker = (TypeAheadMarker)iter.next();
|
TypeAheadMarker marker = (TypeAheadMarker)iter.next();
|
||||||
focusLog.log(Level.FINEST, " {0}", marker);
|
focusLog.finest(" {0}", marker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,7 +878,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
// The fix is rolled out.
|
// The fix is rolled out.
|
||||||
|
|
||||||
if (ke.getWhen() > marker.after) {
|
if (ke.getWhen() > marker.after) {
|
||||||
focusLog.log(Level.FINER, "Storing event {0} because of marker {1}", new Object[] {ke, marker});
|
focusLog.finer("Storing event {0} because of marker {1}", ke, marker);
|
||||||
enqueuedKeyEvents.addLast(ke);
|
enqueuedKeyEvents.addLast(ke);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -890,7 +890,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FocusEvent.FOCUS_GAINED:
|
case FocusEvent.FOCUS_GAINED:
|
||||||
focusLog.log(Level.FINEST, "Markers before FOCUS_GAINED on {0}", new Object[] {target});
|
focusLog.finest("Markers before FOCUS_GAINED on {0}", target);
|
||||||
dumpMarkers();
|
dumpMarkers();
|
||||||
// Search the marker list for the first marker tied to
|
// Search the marker list for the first marker tied to
|
||||||
// the Component which just gained focus. Then remove
|
// the Component which just gained focus. Then remove
|
||||||
@ -919,10 +919,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Exception condition - event without marker
|
// Exception condition - event without marker
|
||||||
focusLog.log(Level.FINER, "Event without marker {0}", e);
|
focusLog.finer("Event without marker {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
focusLog.log(Level.FINEST, "Markers after FOCUS_GAINED");
|
focusLog.finest("Markers after FOCUS_GAINED");
|
||||||
dumpMarkers();
|
dumpMarkers();
|
||||||
|
|
||||||
redispatchEvent(target, e);
|
redispatchEvent(target, e);
|
||||||
@ -1159,8 +1159,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
focusLog.log(Level.FINER, "Enqueue at {0} for {1}",
|
focusLog.finer("Enqueue at {0} for {1}",
|
||||||
new Object[] {after, untilFocused});
|
after, untilFocused);
|
||||||
|
|
||||||
int insertionIndex = 0,
|
int insertionIndex = 0,
|
||||||
i = typeAheadMarkers.size();
|
i = typeAheadMarkers.size();
|
||||||
@ -1199,8 +1199,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
focusLog.log(Level.FINER, "Dequeue at {0} for {1}",
|
focusLog.finer("Dequeue at {0} for {1}",
|
||||||
new Object[] {after, untilFocused});
|
after, untilFocused);
|
||||||
|
|
||||||
TypeAheadMarker marker;
|
TypeAheadMarker marker;
|
||||||
ListIterator iter = typeAheadMarkers.listIterator
|
ListIterator iter = typeAheadMarkers.listIterator
|
||||||
|
@ -36,7 +36,7 @@ import sun.awt.AWTAutoShutdown;
|
|||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.dnd.SunDragSourceContextPeer;
|
import sun.awt.dnd.SunDragSourceContextPeer;
|
||||||
import sun.awt.EventQueueDelegate;
|
import sun.awt.EventQueueDelegate;
|
||||||
@ -61,7 +61,7 @@ import sun.awt.EventQueueDelegate;
|
|||||||
* @since 1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
class EventDispatchThread extends Thread {
|
class EventDispatchThread extends Thread {
|
||||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.EventDispatchThread");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventDispatchThread");
|
||||||
|
|
||||||
private EventQueue theQueue;
|
private EventQueue theQueue;
|
||||||
private boolean doDispatch = true;
|
private boolean doDispatch = true;
|
||||||
@ -275,8 +275,8 @@ class EventDispatchThread extends Thread {
|
|||||||
}
|
}
|
||||||
while (eventOK == false);
|
while (eventOK == false);
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINEST)) {
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
eventLog.log(Level.FINEST, "Dispatching: " + event);
|
eventLog.finest("Dispatching: " + event);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object handle = null;
|
Object handle = null;
|
||||||
@ -308,8 +308,8 @@ class EventDispatchThread extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void processException(Throwable e) {
|
private void processException(Throwable e) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "Processing exception: " + e);
|
eventLog.fine("Processing exception: " + e);
|
||||||
}
|
}
|
||||||
getUncaughtExceptionHandler().uncaughtException(this, e);
|
getUncaughtExceptionHandler().uncaughtException(this, e);
|
||||||
// don't rethrow the exception to avoid EDT recreation
|
// don't rethrow the exception to avoid EDT recreation
|
||||||
|
@ -36,7 +36,7 @@ import java.security.AccessController;
|
|||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
|
|
||||||
import java.util.EmptyStackException;
|
import java.util.EmptyStackException;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.AWTAutoShutdown;
|
import sun.awt.AWTAutoShutdown;
|
||||||
@ -153,7 +153,7 @@ public class EventQueue {
|
|||||||
|
|
||||||
private final String name = "AWT-EventQueue-" + nextThreadNum();
|
private final String name = "AWT-EventQueue-" + nextThreadNum();
|
||||||
|
|
||||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.EventQueue");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
AWTAccessor.setEventQueueAccessor(
|
AWTAccessor.setEventQueueAccessor(
|
||||||
@ -707,8 +707,8 @@ public class EventQueue {
|
|||||||
* @since 1.2
|
* @since 1.2
|
||||||
*/
|
*/
|
||||||
public synchronized void push(EventQueue newEventQueue) {
|
public synchronized void push(EventQueue newEventQueue) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "EventQueue.push(" + newEventQueue + ")");
|
eventLog.fine("EventQueue.push(" + newEventQueue + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextQueue != null) {
|
if (nextQueue != null) {
|
||||||
@ -722,8 +722,8 @@ public class EventQueue {
|
|||||||
try {
|
try {
|
||||||
newEventQueue.postEventPrivate(getNextEvent());
|
newEventQueue.postEventPrivate(getNextEvent());
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "Interrupted push", ie);
|
eventLog.fine("Interrupted push", ie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -766,8 +766,8 @@ public class EventQueue {
|
|||||||
* @since 1.2
|
* @since 1.2
|
||||||
*/
|
*/
|
||||||
protected void pop() throws EmptyStackException {
|
protected void pop() throws EmptyStackException {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "EventQueue.pop(" + this + ")");
|
eventLog.fine("EventQueue.pop(" + this + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// To prevent deadlock, we lock on the previous EventQueue before
|
// To prevent deadlock, we lock on the previous EventQueue before
|
||||||
@ -790,8 +790,8 @@ public class EventQueue {
|
|||||||
try {
|
try {
|
||||||
previousQueue.postEventPrivate(getNextEvent());
|
previousQueue.postEventPrivate(getNextEvent());
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
if (eventLog.isLoggable(Level.FINE)) {
|
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
eventLog.log(Level.FINE, "Interrupted pop", ie);
|
eventLog.fine("Interrupted pop", ie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,7 @@ import java.util.Set;
|
|||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.HeadlessToolkit;
|
import sun.awt.HeadlessToolkit;
|
||||||
@ -111,7 +110,7 @@ public abstract class KeyboardFocusManager
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Shared focus engine logger
|
// Shared focus engine logger
|
||||||
private static final Logger focusLog = Logger.getLogger("java.awt.focus.KeyboardFocusManager");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.KeyboardFocusManager");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
/* ensure that the necessary native libraries are loaded */
|
/* ensure that the necessary native libraries are loaded */
|
||||||
@ -154,7 +153,7 @@ public abstract class KeyboardFocusManager
|
|||||||
*/
|
*/
|
||||||
private static native void initIDs();
|
private static native void initIDs();
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.KeyboardFocusManager");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.KeyboardFocusManager");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier for the Forward focus traversal keys.
|
* The identifier for the Forward focus traversal keys.
|
||||||
@ -504,8 +503,8 @@ public abstract class KeyboardFocusManager
|
|||||||
if (this == getCurrentKeyboardFocusManager()) {
|
if (this == getCurrentKeyboardFocusManager()) {
|
||||||
return focusOwner;
|
return focusOwner;
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
||||||
}
|
}
|
||||||
throw new SecurityException(notPrivileged);
|
throw new SecurityException(notPrivileged);
|
||||||
}
|
}
|
||||||
@ -609,9 +608,9 @@ public abstract class KeyboardFocusManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setNativeFocusOwner(Component comp) {
|
void setNativeFocusOwner(Component comp) {
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Calling peer {0} setCurrentFocusOwner for {1}",
|
focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}",
|
||||||
new Object[] {peer, comp});
|
peer, comp);
|
||||||
}
|
}
|
||||||
peer.setCurrentFocusOwner(comp);
|
peer.setCurrentFocusOwner(comp);
|
||||||
}
|
}
|
||||||
@ -673,8 +672,8 @@ public abstract class KeyboardFocusManager
|
|||||||
if (this == getCurrentKeyboardFocusManager()) {
|
if (this == getCurrentKeyboardFocusManager()) {
|
||||||
return permanentFocusOwner;
|
return permanentFocusOwner;
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
||||||
}
|
}
|
||||||
throw new SecurityException(notPrivileged);
|
throw new SecurityException(notPrivileged);
|
||||||
}
|
}
|
||||||
@ -781,8 +780,8 @@ public abstract class KeyboardFocusManager
|
|||||||
if (this == getCurrentKeyboardFocusManager()) {
|
if (this == getCurrentKeyboardFocusManager()) {
|
||||||
return focusedWindow;
|
return focusedWindow;
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
||||||
}
|
}
|
||||||
throw new SecurityException(notPrivileged);
|
throw new SecurityException(notPrivileged);
|
||||||
}
|
}
|
||||||
@ -885,8 +884,8 @@ public abstract class KeyboardFocusManager
|
|||||||
if (this == getCurrentKeyboardFocusManager()) {
|
if (this == getCurrentKeyboardFocusManager()) {
|
||||||
return activeWindow;
|
return activeWindow;
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
||||||
}
|
}
|
||||||
throw new SecurityException(notPrivileged);
|
throw new SecurityException(notPrivileged);
|
||||||
}
|
}
|
||||||
@ -919,8 +918,8 @@ public abstract class KeyboardFocusManager
|
|||||||
Window oldActiveWindow;
|
Window oldActiveWindow;
|
||||||
synchronized (KeyboardFocusManager.class) {
|
synchronized (KeyboardFocusManager.class) {
|
||||||
oldActiveWindow = getActiveWindow();
|
oldActiveWindow = getActiveWindow();
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
|
focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1215,8 +1214,8 @@ public abstract class KeyboardFocusManager
|
|||||||
if (this == getCurrentKeyboardFocusManager()) {
|
if (this == getCurrentKeyboardFocusManager()) {
|
||||||
return currentFocusCycleRoot;
|
return currentFocusCycleRoot;
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
|
||||||
}
|
}
|
||||||
throw new SecurityException(notPrivileged);
|
throw new SecurityException(notPrivileged);
|
||||||
}
|
}
|
||||||
@ -2149,9 +2148,9 @@ public abstract class KeyboardFocusManager
|
|||||||
|
|
||||||
HeavyweightFocusRequest(Component heavyweight, Component descendant,
|
HeavyweightFocusRequest(Component heavyweight, Component descendant,
|
||||||
boolean temporary, CausedFocusEvent.Cause cause) {
|
boolean temporary, CausedFocusEvent.Cause cause) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (heavyweight == null) {
|
if (heavyweight == null) {
|
||||||
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
|
log.fine("Assertion (heavyweight != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2161,12 +2160,12 @@ public abstract class KeyboardFocusManager
|
|||||||
}
|
}
|
||||||
boolean addLightweightRequest(Component descendant,
|
boolean addLightweightRequest(Component descendant,
|
||||||
boolean temporary, CausedFocusEvent.Cause cause) {
|
boolean temporary, CausedFocusEvent.Cause cause) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) {
|
if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) {
|
||||||
log.log(Level.FINE, "Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
|
log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
|
||||||
}
|
}
|
||||||
if (descendant == null) {
|
if (descendant == null) {
|
||||||
log.log(Level.FINE, "Assertion (descendant != null) failed");
|
log.fine("Assertion (descendant != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2339,12 +2338,12 @@ public abstract class KeyboardFocusManager
|
|||||||
(Component heavyweight, Component descendant, boolean temporary,
|
(Component heavyweight, Component descendant, boolean temporary,
|
||||||
boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
|
boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
|
||||||
{
|
{
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (heavyweight == null) {
|
if (heavyweight == null) {
|
||||||
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
|
log.fine("Assertion (heavyweight != null) failed");
|
||||||
}
|
}
|
||||||
if (time == 0) {
|
if (time == 0) {
|
||||||
log.log(Level.FINE, "Assertion (time != 0) failed");
|
log.fine("Assertion (time != 0) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2361,31 +2360,31 @@ public abstract class KeyboardFocusManager
|
|||||||
Component currentFocusOwner = thisManager.getGlobalFocusOwner();
|
Component currentFocusOwner = thisManager.getGlobalFocusOwner();
|
||||||
Component nativeFocusOwner = thisManager.getNativeFocusOwner();
|
Component nativeFocusOwner = thisManager.getNativeFocusOwner();
|
||||||
Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
|
Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.log(Level.FINER, "SNFH for {0} in {1}",
|
focusLog.finer("SNFH for {0} in {1}",
|
||||||
new Object[] {descendant, heavyweight});
|
descendant, heavyweight);
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "0. Current focus owner {0}",
|
focusLog.finest("0. Current focus owner {0}",
|
||||||
currentFocusOwner);
|
currentFocusOwner);
|
||||||
focusLog.log(Level.FINEST, "0. Native focus owner {0}",
|
focusLog.finest("0. Native focus owner {0}",
|
||||||
nativeFocusOwner);
|
nativeFocusOwner);
|
||||||
focusLog.log(Level.FINEST, "0. Native focused window {0}",
|
focusLog.finest("0. Native focused window {0}",
|
||||||
nativeFocusedWindow);
|
nativeFocusedWindow);
|
||||||
}
|
}
|
||||||
synchronized (heavyweightRequests) {
|
synchronized (heavyweightRequests) {
|
||||||
HeavyweightFocusRequest hwFocusRequest = getLastHWRequest();
|
HeavyweightFocusRequest hwFocusRequest = getLastHWRequest();
|
||||||
if (focusLog.isLoggable(Level.FINEST)) {
|
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
focusLog.log(Level.FINEST, "Request {0}", hwFocusRequest);
|
focusLog.finest("Request {0}", hwFocusRequest);
|
||||||
}
|
}
|
||||||
if (hwFocusRequest == null &&
|
if (hwFocusRequest == null &&
|
||||||
heavyweight == nativeFocusOwner)
|
heavyweight == nativeFocusOwner)
|
||||||
{
|
{
|
||||||
if (descendant == currentFocusOwner) {
|
if (descendant == currentFocusOwner) {
|
||||||
// Redundant request.
|
// Redundant request.
|
||||||
if (focusLog.isLoggable(Level.FINEST))
|
if (focusLog.isLoggable(PlatformLogger.FINEST))
|
||||||
focusLog.log(Level.FINEST, "1. SNFH_FAILURE for {0}",
|
focusLog.finest("1. SNFH_FAILURE for {0}",
|
||||||
descendant);
|
descendant);
|
||||||
return SNFH_FAILURE;
|
return SNFH_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2417,8 +2416,8 @@ public abstract class KeyboardFocusManager
|
|||||||
// SunToolkit.postPriorityEvent(newFocusOwnerEvent);
|
// SunToolkit.postPriorityEvent(newFocusOwnerEvent);
|
||||||
SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent);
|
SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent);
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINEST))
|
if (focusLog.isLoggable(PlatformLogger.FINEST))
|
||||||
focusLog.log(Level.FINEST, "2. SNFH_HANDLED for {0}", descendant);
|
focusLog.finest("2. SNFH_HANDLED for {0}", descendant);
|
||||||
return SNFH_SUCCESS_HANDLED;
|
return SNFH_SUCCESS_HANDLED;
|
||||||
} else if (hwFocusRequest != null &&
|
} else if (hwFocusRequest != null &&
|
||||||
hwFocusRequest.heavyweight == heavyweight) {
|
hwFocusRequest.heavyweight == heavyweight) {
|
||||||
@ -2431,7 +2430,7 @@ public abstract class KeyboardFocusManager
|
|||||||
manager.enqueueKeyEvents(time, descendant);
|
manager.enqueueKeyEvents(time, descendant);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINEST))
|
if (focusLog.isLoggable(PlatformLogger.FINEST))
|
||||||
focusLog.finest("3. SNFH_HANDLED for lightweight" +
|
focusLog.finest("3. SNFH_HANDLED for lightweight" +
|
||||||
descendant + " in " + heavyweight);
|
descendant + " in " + heavyweight);
|
||||||
return SNFH_SUCCESS_HANDLED;
|
return SNFH_SUCCESS_HANDLED;
|
||||||
@ -2454,7 +2453,7 @@ public abstract class KeyboardFocusManager
|
|||||||
(hwFocusRequest != null)
|
(hwFocusRequest != null)
|
||||||
? hwFocusRequest.heavyweight
|
? hwFocusRequest.heavyweight
|
||||||
: nativeFocusedWindow)) {
|
: nativeFocusedWindow)) {
|
||||||
if (focusLog.isLoggable(Level.FINEST))
|
if (focusLog.isLoggable(PlatformLogger.FINEST))
|
||||||
focusLog.finest("4. SNFH_FAILURE for " + descendant);
|
focusLog.finest("4. SNFH_FAILURE for " + descendant);
|
||||||
return SNFH_FAILURE;
|
return SNFH_FAILURE;
|
||||||
}
|
}
|
||||||
@ -2464,7 +2463,7 @@ public abstract class KeyboardFocusManager
|
|||||||
heavyweightRequests.add
|
heavyweightRequests.add
|
||||||
(new HeavyweightFocusRequest(heavyweight, descendant,
|
(new HeavyweightFocusRequest(heavyweight, descendant,
|
||||||
temporary, cause));
|
temporary, cause));
|
||||||
if (focusLog.isLoggable(Level.FINEST))
|
if (focusLog.isLoggable(PlatformLogger.FINEST))
|
||||||
focusLog.finest("5. SNFH_PROCEED for " + descendant);
|
focusLog.finest("5. SNFH_PROCEED for " + descendant);
|
||||||
return SNFH_SUCCESS_PROCEED;
|
return SNFH_SUCCESS_PROCEED;
|
||||||
}
|
}
|
||||||
@ -2855,13 +2854,13 @@ public abstract class KeyboardFocusManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
KeyboardFocusManager manager = getCurrentKeyboardFocusManager();
|
KeyboardFocusManager manager = getCurrentKeyboardFocusManager();
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
if (event instanceof FocusEvent || event instanceof WindowEvent) {
|
if (event instanceof FocusEvent || event instanceof WindowEvent) {
|
||||||
focusLog.log(Level.FINER, ">>> {0}", new Object[] {event});
|
focusLog.finer(">>> {0}", event);
|
||||||
}
|
}
|
||||||
if (focusLog.isLoggable(Level.FINER) && event instanceof KeyEvent) {
|
if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) {
|
||||||
focusLog.log(Level.FINER, " focus owner is {0}", new Object[] {manager.getGlobalFocusOwner()});
|
focusLog.finer(" focus owner is {0}", manager.getGlobalFocusOwner());
|
||||||
focusLog.log(Level.FINER, ">>> {0}", new Object[] {event});
|
focusLog.finer(">>> {0}", event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2945,9 +2944,9 @@ public abstract class KeyboardFocusManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void removeLastFocusRequest(Component heavyweight) {
|
static void removeLastFocusRequest(Component heavyweight) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (heavyweight == null) {
|
if (heavyweight == null) {
|
||||||
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
|
log.fine("Assertion (heavyweight != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ import java.awt.image.*;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
import sun.awt.image.SunWritableRaster;
|
import sun.awt.image.SunWritableRaster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,8 +203,8 @@ public final class SplashScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(java.net.MalformedURLException e) {
|
catch(java.net.MalformedURLException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "MalformedURLException caught in the getImageURL() method", e);
|
log.fine("MalformedURLException caught in the getImageURL() method", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,7 +354,7 @@ public final class SplashScreen {
|
|||||||
*/
|
*/
|
||||||
private static SplashScreen theInstance = null;
|
private static SplashScreen theInstance = null;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.SplashScreen");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.SplashScreen");
|
||||||
|
|
||||||
private native static void _update(long splashPtr, int[] data, int x, int y, int width, int height, int scanlineStride);
|
private native static void _update(long splashPtr, int[] data, int x, int y, int width, int height, int scanlineStride);
|
||||||
private native static boolean _isVisible(long splashPtr);
|
private native static boolean _isVisible(long splashPtr);
|
||||||
|
@ -48,7 +48,7 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
@ -1956,7 +1956,7 @@ public abstract class Toolkit {
|
|||||||
*/
|
*/
|
||||||
public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType);
|
public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType);
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.Toolkit");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Toolkit");
|
||||||
|
|
||||||
private static final int LONG_BITS = 64;
|
private static final int LONG_BITS = 64;
|
||||||
private int[] calls = new int[LONG_BITS];
|
private int[] calls = new int[LONG_BITS];
|
||||||
@ -2123,9 +2123,9 @@ public abstract class Toolkit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized int countAWTEventListeners(long eventMask) {
|
synchronized int countAWTEventListeners(long eventMask) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (eventMask == 0) {
|
if (eventMask == 0) {
|
||||||
log.log(Level.FINE, "Assertion (eventMask != 0) failed");
|
log.fine("Assertion (eventMask != 0) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +48,6 @@ import java.util.Locale;
|
|||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import javax.accessibility.*;
|
import javax.accessibility.*;
|
||||||
import sun.awt.AWTAccessor;
|
import sun.awt.AWTAccessor;
|
||||||
@ -61,6 +59,7 @@ import sun.java2d.Disposer;
|
|||||||
import sun.java2d.pipe.Region;
|
import sun.java2d.pipe.Region;
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import sun.security.util.SecurityConstants;
|
import sun.security.util.SecurityConstants;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A <code>Window</code> object is a top-level window with no borders and no
|
* A <code>Window</code> object is a top-level window with no borders and no
|
||||||
@ -324,7 +323,7 @@ public class Window extends Container implements Accessible {
|
|||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 4497834738069338734L;
|
private static final long serialVersionUID = 4497834738069338734L;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("java.awt.Window");
|
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Window");
|
||||||
|
|
||||||
private static final boolean locationByPlatformProp;
|
private static final boolean locationByPlatformProp;
|
||||||
|
|
||||||
@ -2985,7 +2984,7 @@ public class Window extends Container implements Accessible {
|
|||||||
}
|
}
|
||||||
synchronized (getTreeLock()) {
|
synchronized (getTreeLock()) {
|
||||||
super.setGraphicsConfiguration(gc);
|
super.setGraphicsConfiguration(gc);
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("+ Window.setGraphicsConfiguration(): new GC is \n+ " + getGraphicsConfiguration_NoClientCode() + "\n+ this is " + this);
|
log.finer("+ Window.setGraphicsConfiguration(): new GC is \n+ " + getGraphicsConfiguration_NoClientCode() + "\n+ this is " + this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,7 @@ import java.awt.Event;
|
|||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.GraphicsEnvironment;
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +54,7 @@ import java.util.Arrays;
|
|||||||
* @since 1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public abstract class InputEvent extends ComponentEvent {
|
public abstract class InputEvent extends ComponentEvent {
|
||||||
private static final Logger log = Logger.getLogger("java.awt.event.InputEvent");
|
private static final PlatformLogger logger = PlatformLogger.getLogger("java.awt.event.InputEvent");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Shift key modifier constant.
|
* The Shift key modifier constant.
|
||||||
@ -344,8 +343,8 @@ public abstract class InputEvent extends ComponentEvent {
|
|||||||
sm.checkSystemClipboardAccess();
|
sm.checkSystemClipboardAccess();
|
||||||
b = true;
|
b = true;
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (logger.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "InputEvent.canAccessSystemClipboard() got SecurityException ", se);
|
logger.fine("InputEvent.canAccessSystemClipboard() got SecurityException ", se);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -32,7 +32,6 @@ import java.lang.reflect.*;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import com.sun.java.swing.SwingUtilities3;
|
import com.sun.java.swing.SwingUtilities3;
|
||||||
|
|
||||||
@ -41,6 +40,7 @@ import sun.java2d.SunGraphics2D;
|
|||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
|
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PaintManager implementation that uses a BufferStrategy for
|
* A PaintManager implementation that uses a BufferStrategy for
|
||||||
@ -78,7 +78,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
private static Method COMPONENT_CREATE_BUFFER_STRATEGY_METHOD;
|
private static Method COMPONENT_CREATE_BUFFER_STRATEGY_METHOD;
|
||||||
private static Method COMPONENT_GET_BUFFER_STRATEGY_METHOD;
|
private static Method COMPONENT_GET_BUFFER_STRATEGY_METHOD;
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(
|
private static final PlatformLogger LOGGER = PlatformLogger.getLogger(
|
||||||
"javax.swing.BufferStrategyPaintManager");
|
"javax.swing.BufferStrategyPaintManager");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -222,9 +222,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dispose(java.util.List<BufferInfo> bufferInfos) {
|
private void dispose(java.util.List<BufferInfo> bufferInfos) {
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.log(Level.FINER, "BufferStrategyPaintManager disposed",
|
LOGGER.finer("BufferStrategyPaintManager disposed",
|
||||||
new RuntimeException());
|
new RuntimeException());
|
||||||
}
|
}
|
||||||
if (bufferInfos != null) {
|
if (bufferInfos != null) {
|
||||||
for (BufferInfo bufferInfo : bufferInfos) {
|
for (BufferInfo bufferInfo : bufferInfos) {
|
||||||
@ -305,7 +305,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Invalid root, do what Swing has always done.
|
// Invalid root, do what Swing has always done.
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("prepare failed");
|
LOGGER.finer("prepare failed");
|
||||||
}
|
}
|
||||||
return super.paint(paintingComponent, bufferComponent, g, x, y, w, h);
|
return super.paint(paintingComponent, bufferComponent, g, x, y, w, h);
|
||||||
@ -335,7 +335,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
}
|
}
|
||||||
accumulate(x + xOffset + deltaX, y + yOffset + deltaY, w, h);
|
accumulate(x + xOffset + deltaX, y + yOffset + deltaY, w, h);
|
||||||
} else {
|
} else {
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("copyArea: prepare failed or not in sync");
|
LOGGER.finer("copyArea: prepare failed or not in sync");
|
||||||
}
|
}
|
||||||
// Prepare failed, or not in sync. By calling super.copyArea
|
// Prepare failed, or not in sync. By calling super.copyArea
|
||||||
@ -363,7 +363,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOGGER.isLoggable(Level.FINEST)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINEST)) {
|
||||||
LOGGER.finest("beginPaint");
|
LOGGER.finest("beginPaint");
|
||||||
}
|
}
|
||||||
// Reset the area that needs to be painted.
|
// Reset the area that needs to be painted.
|
||||||
@ -371,7 +371,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void endPaint() {
|
public void endPaint() {
|
||||||
if (LOGGER.isLoggable(Level.FINEST)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINEST)) {
|
||||||
LOGGER.finest("endPaint: region " + accumulatedX + " " +
|
LOGGER.finest("endPaint: region " + accumulatedX + " " +
|
||||||
accumulatedY + " " + accumulatedMaxX + " " +
|
accumulatedY + " " + accumulatedMaxX + " " +
|
||||||
accumulatedMaxY);
|
accumulatedMaxY);
|
||||||
@ -420,7 +420,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
contentsLost = bufferStrategy.contentsLost();
|
contentsLost = bufferStrategy.contentsLost();
|
||||||
}
|
}
|
||||||
if (contentsLost) {
|
if (contentsLost) {
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("endPaint: contents lost");
|
LOGGER.finer("endPaint: contents lost");
|
||||||
}
|
}
|
||||||
// Shown region was bogus, mark buffer as out of sync.
|
// Shown region was bogus, mark buffer as out of sync.
|
||||||
@ -514,7 +514,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
contentsLost = true;
|
contentsLost = true;
|
||||||
bufferInfo = new BufferInfo(root);
|
bufferInfo = new BufferInfo(root);
|
||||||
bufferInfos.add(bufferInfo);
|
bufferInfos.add(bufferInfo);
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("prepare: new BufferInfo: " + root);
|
LOGGER.finer("prepare: new BufferInfo: " + root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -525,7 +525,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
bsg = bufferStrategy.getDrawGraphics();
|
bsg = bufferStrategy.getDrawGraphics();
|
||||||
if (bufferStrategy.contentsRestored()) {
|
if (bufferStrategy.contentsRestored()) {
|
||||||
contentsLost = true;
|
contentsLost = true;
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer(
|
LOGGER.finer(
|
||||||
"prepare: contents restored in prepare");
|
"prepare: contents restored in prepare");
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
if (bufferInfo.getContentsLostDuringExpose()) {
|
if (bufferInfo.getContentsLostDuringExpose()) {
|
||||||
contentsLost = true;
|
contentsLost = true;
|
||||||
bufferInfo.setContentsLostDuringExpose(false);
|
bufferInfo.setContentsLostDuringExpose(false);
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("prepare: contents lost on expose");
|
LOGGER.finer("prepare: contents lost on expose");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -642,7 +642,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
if (biRoot == null) {
|
if (biRoot == null) {
|
||||||
// Window gc'ed
|
// Window gc'ed
|
||||||
bufferInfos.remove(counter);
|
bufferInfos.remove(counter);
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("BufferInfo pruned, root null");
|
LOGGER.finer("BufferInfo pruned, root null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -748,7 +748,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
if (bs != null) {
|
if (bs != null) {
|
||||||
weakBS = new WeakReference<BufferStrategy>(bs);
|
weakBS = new WeakReference<BufferStrategy>(bs);
|
||||||
}
|
}
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("getBufferStrategy: created bs: " + bs);
|
LOGGER.finer("getBufferStrategy: created bs: " + bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -806,7 +806,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
BufferStrategy bs = null;
|
BufferStrategy bs = null;
|
||||||
if (SwingUtilities3.isVsyncRequested(root)) {
|
if (SwingUtilities3.isVsyncRequested(root)) {
|
||||||
bs = createBufferStrategy(root, true);
|
bs = createBufferStrategy(root, true);
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.finer("createBufferStrategy: using vsynced strategy");
|
LOGGER.finer("createBufferStrategy: using vsynced strategy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -848,9 +848,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
invoke(root);
|
invoke(root);
|
||||||
} catch (InvocationTargetException ite) {
|
} catch (InvocationTargetException ite) {
|
||||||
// Type is not supported
|
// Type is not supported
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.log(Level.FINER, "createBufferStratety failed",
|
LOGGER.finer("createBufferStratety failed",
|
||||||
ite);
|
ite);
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
assert false;
|
assert false;
|
||||||
@ -864,9 +864,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
bs = ((Window)root).getBufferStrategy();
|
bs = ((Window)root).getBufferStrategy();
|
||||||
} catch (AWTException e) {
|
} catch (AWTException e) {
|
||||||
// Type not supported
|
// Type not supported
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.log(Level.FINER, "createBufferStratety failed",
|
LOGGER.finer("createBufferStratety failed",
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,8 +878,8 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
|
|||||||
*/
|
*/
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
Container root = getRoot();
|
Container root = getRoot();
|
||||||
if (LOGGER.isLoggable(Level.FINER)) {
|
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
|
||||||
LOGGER.log(Level.FINER, "disposed BufferInfo for: " + root);
|
LOGGER.finer("disposed BufferInfo for: " + root);
|
||||||
}
|
}
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
root.removeComponentListener(this);
|
root.removeComponentListener(this);
|
||||||
|
@ -29,7 +29,7 @@ import java.awt.Container;
|
|||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.awt.FocusTraversalPolicy;
|
import java.awt.FocusTraversalPolicy;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A FocusTraversalPolicy that determines traversal order by sorting the
|
* A FocusTraversalPolicy that determines traversal order by sorting the
|
||||||
@ -64,7 +64,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
private Comparator<? super Component> comparator;
|
private Comparator<? super Component> comparator;
|
||||||
private boolean implicitDownCycleTraversal = true;
|
private boolean implicitDownCycleTraversal = true;
|
||||||
|
|
||||||
private Logger log = Logger.getLogger("javax.swing.SortingFocusTraversalPolicy");
|
private PlatformLogger log = PlatformLogger.getLogger("javax.swing.SortingFocusTraversalPolicy");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by getComponentAfter and getComponentBefore for efficiency. In
|
* Used by getComponentAfter and getComponentBefore for efficiency. In
|
||||||
@ -115,8 +115,8 @@ public class SortingFocusTraversalPolicy
|
|||||||
try {
|
try {
|
||||||
index = Collections.binarySearch(cycle, aComponent, comparator);
|
index = Collections.binarySearch(cycle, aComponent, comparator);
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "### During the binary search for " + aComponent + " the exception occured: ", e);
|
log.fine("### During the binary search for " + aComponent + " the exception occured: ", e);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
if (getImplicitDownCycleTraversal()) {
|
if (getImplicitDownCycleTraversal()) {
|
||||||
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
|
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
|
||||||
|
|
||||||
if (retComp != null && log.isLoggable(Level.FINE)) {
|
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Transfered focus down-cycle to " + retComp +
|
log.fine("### Transfered focus down-cycle to " + retComp +
|
||||||
" in the focus cycle root " + cont);
|
" in the focus cycle root " + cont);
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
|
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
|
||||||
cont.getFocusTraversalPolicy().getLastComponent(cont));
|
cont.getFocusTraversalPolicy().getLastComponent(cont));
|
||||||
|
|
||||||
if (retComp != null && log.isLoggable(Level.FINE)) {
|
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
|
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
* aComponent is null
|
* aComponent is null
|
||||||
*/
|
*/
|
||||||
public Component getComponentAfter(Container aContainer, Component aComponent) {
|
public Component getComponentAfter(Container aContainer, Component aComponent) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Searching in " + aContainer + " for component after " + aComponent);
|
log.fine("### Searching in " + aContainer + " for component after " + aComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
// See if the component is inside of policy provider.
|
// See if the component is inside of policy provider.
|
||||||
Container provider = getTopmostProvider(aContainer, aComponent);
|
Container provider = getTopmostProvider(aContainer, aComponent);
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
// Null result means that we overstepped the limit of the FTP's cycle.
|
// Null result means that we overstepped the limit of the FTP's cycle.
|
||||||
// In that case we must quit the cycle, otherwise return the component found.
|
// In that case we must quit the cycle, otherwise return the component found.
|
||||||
if (afterComp != null) {
|
if (afterComp != null) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + afterComp);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
|
||||||
return afterComp;
|
return afterComp;
|
||||||
}
|
}
|
||||||
aComponent = provider;
|
aComponent = provider;
|
||||||
@ -279,12 +279,12 @@ public class SortingFocusTraversalPolicy
|
|||||||
|
|
||||||
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
||||||
|
|
||||||
int index = getComponentIndex(cycle, aComponent);
|
int index = getComponentIndex(cycle, aComponent);
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
||||||
}
|
}
|
||||||
return getFirstComponent(aContainer);
|
return getFirstComponent(aContainer);
|
||||||
@ -349,7 +349,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
// See if the component is inside of policy provider.
|
// See if the component is inside of policy provider.
|
||||||
Container provider = getTopmostProvider(aContainer, aComponent);
|
Container provider = getTopmostProvider(aContainer, aComponent);
|
||||||
if (provider != null) {
|
if (provider != null) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
// Null result means that we overstepped the limit of the FTP's cycle.
|
// Null result means that we overstepped the limit of the FTP's cycle.
|
||||||
// In that case we must quit the cycle, otherwise return the component found.
|
// In that case we must quit the cycle, otherwise return the component found.
|
||||||
if (beforeComp != null) {
|
if (beforeComp != null) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + beforeComp);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
|
||||||
return beforeComp;
|
return beforeComp;
|
||||||
}
|
}
|
||||||
aComponent = provider;
|
aComponent = provider;
|
||||||
@ -373,12 +373,12 @@ public class SortingFocusTraversalPolicy
|
|||||||
|
|
||||||
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
List<Component> cycle = getFocusTraversalCycle(aContainer);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
|
||||||
|
|
||||||
int index = getComponentIndex(cycle, aComponent);
|
int index = getComponentIndex(cycle, aComponent);
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
|
||||||
}
|
}
|
||||||
return getLastComponent(aContainer);
|
return getLastComponent(aContainer);
|
||||||
@ -424,7 +424,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
public Component getFirstComponent(Container aContainer) {
|
public Component getFirstComponent(Container aContainer) {
|
||||||
List<Component> cycle;
|
List<Component> cycle;
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Getting first component in " + aContainer);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
|
||||||
if (aContainer == null) {
|
if (aContainer == null) {
|
||||||
throw new IllegalArgumentException("aContainer cannot be null");
|
throw new IllegalArgumentException("aContainer cannot be null");
|
||||||
}
|
}
|
||||||
@ -436,10 +436,10 @@ public class SortingFocusTraversalPolicy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cycle.size() == 0) {
|
if (cycle.size() == 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
|
||||||
|
|
||||||
for (Component comp : cycle) {
|
for (Component comp : cycle) {
|
||||||
if (accept(comp)) {
|
if (accept(comp)) {
|
||||||
@ -466,7 +466,7 @@ public class SortingFocusTraversalPolicy
|
|||||||
*/
|
*/
|
||||||
public Component getLastComponent(Container aContainer) {
|
public Component getLastComponent(Container aContainer) {
|
||||||
List<Component> cycle;
|
List<Component> cycle;
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Getting last component in " + aContainer);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
|
||||||
|
|
||||||
if (aContainer == null) {
|
if (aContainer == null) {
|
||||||
throw new IllegalArgumentException("aContainer cannot be null");
|
throw new IllegalArgumentException("aContainer cannot be null");
|
||||||
@ -479,10 +479,10 @@ public class SortingFocusTraversalPolicy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cycle.size() == 0) {
|
if (cycle.size() == 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
|
||||||
|
|
||||||
for (int i= cycle.size() - 1; i >= 0; i--) {
|
for (int i= cycle.size() - 1; i >= 0; i--) {
|
||||||
Component comp = cycle.get(i);
|
Component comp = cycle.get(i);
|
||||||
|
@ -30,7 +30,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is to let AWT shutdown automatically when a user is done
|
* This class is to let AWT shutdown automatically when a user is done
|
||||||
@ -363,7 +363,7 @@ public final class AWTAutoShutdown implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final void dumpPeers(final Logger aLog) {
|
final void dumpPeers(final PlatformLogger aLog) {
|
||||||
synchronized (activationLock) {
|
synchronized (activationLock) {
|
||||||
synchronized (mainLock) {
|
synchronized (mainLock) {
|
||||||
aLog.fine("Mapped peers:");
|
aLog.fine("Mapped peers:");
|
||||||
|
@ -40,10 +40,9 @@ import java.util.IdentityHashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AppContext is a table referenced by ThreadGroup which stores
|
* The AppContext is a table referenced by ThreadGroup which stores
|
||||||
@ -128,7 +127,7 @@ import java.beans.PropertyChangeListener;
|
|||||||
* @author Fred Ecks
|
* @author Fred Ecks
|
||||||
*/
|
*/
|
||||||
public final class AppContext {
|
public final class AppContext {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.AppContext");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.AppContext");
|
||||||
|
|
||||||
/* Since the contents of an AppContext are unique to each Java
|
/* Since the contents of an AppContext are unique to each Java
|
||||||
* session, this class should never be serialized. */
|
* session, this class should never be serialized. */
|
||||||
@ -380,9 +379,7 @@ public final class AppContext {
|
|||||||
try {
|
try {
|
||||||
w.dispose();
|
w.dispose();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
log.finer("exception occured while disposing app context", t);
|
||||||
log.log(Level.FINER, "exception occured while disposing app context", t);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AccessController.doPrivileged(new PrivilegedAction() {
|
AccessController.doPrivileged(new PrivilegedAction() {
|
||||||
|
@ -39,8 +39,7 @@ import java.lang.reflect.Field;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
@ -78,7 +77,7 @@ public class ComponentAccessor
|
|||||||
private static Method methodGetCursorNoClientCode;
|
private static Method methodGetCursorNoClientCode;
|
||||||
private static Method methodLocationNoClientCode;
|
private static Method methodLocationNoClientCode;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.ComponentAccessor");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.ComponentAccessor");
|
||||||
|
|
||||||
private ComponentAccessor() {
|
private ComponentAccessor() {
|
||||||
}
|
}
|
||||||
@ -136,13 +135,13 @@ public class ComponentAccessor
|
|||||||
methodLocationNoClientCode.setAccessible(true);
|
methodLocationNoClientCode.setAccessible(true);
|
||||||
}
|
}
|
||||||
catch (NoSuchFieldException e) {
|
catch (NoSuchFieldException e) {
|
||||||
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
|
log.fine("Unable to initialize ComponentAccessor", e);
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e) {
|
catch (ClassNotFoundException e) {
|
||||||
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
|
log.fine("Unable to initialize ComponentAccessor", e);
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException e) {
|
catch (NoSuchMethodException e) {
|
||||||
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
|
log.fine("Unable to initialize ComponentAccessor", e);
|
||||||
}
|
}
|
||||||
// to please javac
|
// to please javac
|
||||||
return null;
|
return null;
|
||||||
@ -157,7 +156,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +167,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +178,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +189,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +203,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +213,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -225,7 +224,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -236,7 +235,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -247,7 +246,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -258,7 +257,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -271,10 +270,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
@ -288,10 +287,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
@ -307,10 +306,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,10 +321,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +335,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,7 +347,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
@ -361,7 +360,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
@ -372,7 +371,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +383,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -396,7 +395,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return peer;
|
return peer;
|
||||||
}
|
}
|
||||||
@ -406,7 +405,7 @@ public class ComponentAccessor
|
|||||||
fieldPeer.set(c, peer);
|
fieldPeer.set(c, peer);
|
||||||
} catch (IllegalAccessException e)
|
} catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,7 +414,7 @@ public class ComponentAccessor
|
|||||||
return fieldIgnoreRepaint.getBoolean(comp);
|
return fieldIgnoreRepaint.getBoolean(comp);
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException e) {
|
catch (IllegalAccessException e) {
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -427,7 +426,7 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -439,10 +438,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
@ -455,10 +454,10 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cursor;
|
return cursor;
|
||||||
@ -472,12 +471,13 @@ public class ComponentAccessor
|
|||||||
}
|
}
|
||||||
catch (IllegalAccessException e)
|
catch (IllegalAccessException e)
|
||||||
{
|
{
|
||||||
log.log(Level.FINE, "Unable to access the Component object", e);
|
log.fine("Unable to access the Component object", e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to invoke on the Component object", e);
|
log.fine("Unable to invoke on the Component object", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ package sun.awt;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal class that manages sun.awt.Debug settings.
|
* Internal class that manages sun.awt.Debug settings.
|
||||||
@ -72,7 +72,7 @@ import java.util.logging.*;
|
|||||||
* the fix for 4638447).
|
* the fix for 4638447).
|
||||||
*/
|
*/
|
||||||
final class DebugSettings {
|
final class DebugSettings {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.debug.DebugSettings");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.debug.DebugSettings");
|
||||||
|
|
||||||
/* standard debug property key names */
|
/* standard debug property key names */
|
||||||
static final String PREFIX = "awtdebug";
|
static final String PREFIX = "awtdebug";
|
||||||
@ -128,8 +128,8 @@ final class DebugSettings {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// echo the initial property settings to stdout
|
// echo the initial property settings to stdout
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "DebugSettings:\n{0}", this);
|
log.fine("DebugSettings:\n{0}" + this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,8 +258,8 @@ final class DebugSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void println(Object object) {
|
private void println(Object object) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, object.toString());
|
log.finer(object.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ import java.nio.charset.Charset;
|
|||||||
import java.nio.charset.CharsetEncoder;
|
import java.nio.charset.CharsetEncoder;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
@ -51,6 +50,7 @@ import sun.font.CompositeFontDescriptor;
|
|||||||
import sun.font.SunFontManager;
|
import sun.font.SunFontManager;
|
||||||
import sun.font.FontManagerFactory;
|
import sun.font.FontManagerFactory;
|
||||||
import sun.font.FontUtilities;
|
import sun.font.FontUtilities;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the definitions of the five logical fonts: Serif, SansSerif,
|
* Provides the definitions of the five logical fonts: Serif, SansSerif,
|
||||||
@ -66,7 +66,7 @@ public abstract class FontConfiguration {
|
|||||||
protected static Locale startupLocale = null;
|
protected static Locale startupLocale = null;
|
||||||
protected static Hashtable localeMap = null;
|
protected static Hashtable localeMap = null;
|
||||||
private static FontConfiguration fontConfig;
|
private static FontConfiguration fontConfig;
|
||||||
private static Logger logger;
|
private static PlatformLogger logger;
|
||||||
protected static boolean isProperties = true;
|
protected static boolean isProperties = true;
|
||||||
|
|
||||||
protected SunFontManager fontManager;
|
protected SunFontManager fontManager;
|
||||||
@ -83,7 +83,7 @@ public abstract class FontConfiguration {
|
|||||||
*/
|
*/
|
||||||
public FontConfiguration(SunFontManager fm) {
|
public FontConfiguration(SunFontManager fm) {
|
||||||
if (FontUtilities.debugFonts() && logger == null) {
|
if (FontUtilities.debugFonts() && logger == null) {
|
||||||
logger = Logger.getLogger("sun.awt.FontConfiguration");
|
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
|
||||||
}
|
}
|
||||||
fontManager = fm;
|
fontManager = fm;
|
||||||
setOsNameAndVersion(); /* static initialization */
|
setOsNameAndVersion(); /* static initialization */
|
||||||
@ -366,7 +366,7 @@ public abstract class FontConfiguration {
|
|||||||
stringTable = new StringBuilder(4096);
|
stringTable = new StringBuilder(4096);
|
||||||
|
|
||||||
if (verbose && logger == null) {
|
if (verbose && logger == null) {
|
||||||
logger = Logger.getLogger("sun.awt.FontConfiguration");
|
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
|
||||||
}
|
}
|
||||||
new PropertiesHandler().load(in);
|
new PropertiesHandler().load(in);
|
||||||
|
|
||||||
|
@ -39,12 +39,11 @@ import java.awt.peer.ComponentPeer;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManagerPeer {
|
public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManagerPeer {
|
||||||
|
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
|
||||||
|
|
||||||
private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor =
|
private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor =
|
||||||
AWTAccessor.getKeyboardFocusManagerAccessor();
|
AWTAccessor.getKeyboardFocusManagerAccessor();
|
||||||
@ -64,7 +63,8 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
|
|||||||
public void clearGlobalFocusOwner(Window activeWindow) {
|
public void clearGlobalFocusOwner(Window activeWindow) {
|
||||||
if (activeWindow != null) {
|
if (activeWindow != null) {
|
||||||
Component focusOwner = activeWindow.getFocusOwner();
|
Component focusOwner = activeWindow.getFocusOwner();
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Clearing global focus owner " + focusOwner);
|
if (focusLog.isLoggable(PlatformLogger.FINE))
|
||||||
|
focusLog.fine("Clearing global focus owner " + focusOwner);
|
||||||
if (focusOwner != null) {
|
if (focusOwner != null) {
|
||||||
FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
|
FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
|
||||||
CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
|
CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
|
||||||
@ -130,14 +130,16 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
|
|||||||
FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
|
FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
|
||||||
false, lightweightChild, cause);
|
false, lightweightChild, cause);
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Posting focus event: " + fl);
|
if (focusLog.isLoggable(PlatformLogger.FINER))
|
||||||
|
focusLog.finer("Posting focus event: " + fl);
|
||||||
SunToolkit.postPriorityEvent(fl);
|
SunToolkit.postPriorityEvent(fl);
|
||||||
}
|
}
|
||||||
|
|
||||||
FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
|
FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
|
||||||
false, currentOwner, cause);
|
false, currentOwner, cause);
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Posting focus event: " + fg);
|
if (focusLog.isLoggable(PlatformLogger.FINER))
|
||||||
|
focusLog.finer("Posting focus event: " + fg);
|
||||||
SunToolkit.postPriorityEvent(fg);
|
SunToolkit.postPriorityEvent(fg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import java.awt.Insets;
|
|||||||
import java.awt.Adjustable;
|
import java.awt.Adjustable;
|
||||||
import java.awt.event.MouseWheelEvent;
|
import java.awt.event.MouseWheelEvent;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ScrollPaneWheelScroller is a helper class for implmenenting mouse wheel
|
* ScrollPaneWheelScroller is a helper class for implmenenting mouse wheel
|
||||||
@ -39,7 +39,7 @@ import java.util.logging.*;
|
|||||||
*/
|
*/
|
||||||
public abstract class ScrollPaneWheelScroller {
|
public abstract class ScrollPaneWheelScroller {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.ScrollPaneWheelScroller");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.ScrollPaneWheelScroller");
|
||||||
|
|
||||||
private ScrollPaneWheelScroller() {}
|
private ScrollPaneWheelScroller() {}
|
||||||
|
|
||||||
@ -47,8 +47,8 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
* Called from ScrollPane.processMouseWheelEvent()
|
* Called from ScrollPane.processMouseWheelEvent()
|
||||||
*/
|
*/
|
||||||
public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) {
|
public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
|
log.finer("x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
|
||||||
}
|
}
|
||||||
int increment = 0;
|
int increment = 0;
|
||||||
|
|
||||||
@ -56,8 +56,8 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
Adjustable adj = getAdjustableToScroll(sp);
|
Adjustable adj = getAdjustableToScroll(sp);
|
||||||
if (adj != null) {
|
if (adj != null) {
|
||||||
increment = getIncrementFromAdjustable(adj, e);
|
increment = getIncrementFromAdjustable(adj, e);
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "increment from adjustable(" + adj.getClass() + ") : " + increment);
|
log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment);
|
||||||
}
|
}
|
||||||
scrollAdjustable(adj, increment);
|
scrollAdjustable(adj, increment);
|
||||||
}
|
}
|
||||||
@ -74,8 +74,8 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
// if policy is display always or never, use vert
|
// if policy is display always or never, use vert
|
||||||
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
|
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
|
||||||
policy == ScrollPane.SCROLLBARS_NEVER) {
|
policy == ScrollPane.SCROLLBARS_NEVER) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "using vertical scrolling due to scrollbar policy");
|
log.finer("using vertical scrolling due to scrollbar policy");
|
||||||
}
|
}
|
||||||
return sp.getVAdjustable();
|
return sp.getVAdjustable();
|
||||||
|
|
||||||
@ -85,31 +85,31 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
Insets ins = sp.getInsets();
|
Insets ins = sp.getInsets();
|
||||||
int vertScrollWidth = sp.getVScrollbarWidth();
|
int vertScrollWidth = sp.getVScrollbarWidth();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "insets: l = " + ins.left + ", r = " + ins.right +
|
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
|
||||||
", t = " + ins.top + ", b = " + ins.bottom);
|
", t = " + ins.top + ", b = " + ins.bottom);
|
||||||
log.log(Level.FINER, "vertScrollWidth = " + vertScrollWidth);
|
log.finer("vertScrollWidth = " + vertScrollWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if scrollbar is showing by examining insets of the
|
// Check if scrollbar is showing by examining insets of the
|
||||||
// ScrollPane
|
// ScrollPane
|
||||||
if (ins.right >= vertScrollWidth) {
|
if (ins.right >= vertScrollWidth) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "using vertical scrolling because scrollbar is present");
|
log.finer("using vertical scrolling because scrollbar is present");
|
||||||
}
|
}
|
||||||
return sp.getVAdjustable();
|
return sp.getVAdjustable();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int horizScrollHeight = sp.getHScrollbarHeight();
|
int horizScrollHeight = sp.getHScrollbarHeight();
|
||||||
if (ins.bottom >= horizScrollHeight) {
|
if (ins.bottom >= horizScrollHeight) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "using horiz scrolling because scrollbar is present");
|
log.finer("using horiz scrolling because scrollbar is present");
|
||||||
}
|
}
|
||||||
return sp.getHAdjustable();
|
return sp.getHAdjustable();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "using NO scrollbar becsause neither is present");
|
log.finer("using NO scrollbar becsause neither is present");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -124,9 +124,9 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
*/
|
*/
|
||||||
public static int getIncrementFromAdjustable(Adjustable adj,
|
public static int getIncrementFromAdjustable(Adjustable adj,
|
||||||
MouseWheelEvent e) {
|
MouseWheelEvent e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (adj == null) {
|
if (adj == null) {
|
||||||
log.log(Level.FINE, "Assertion (adj != null) failed");
|
log.fine("Assertion (adj != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,19 +146,19 @@ public abstract class ScrollPaneWheelScroller {
|
|||||||
* bounds and sets the new value to the Adjustable.
|
* bounds and sets the new value to the Adjustable.
|
||||||
*/
|
*/
|
||||||
public static void scrollAdjustable(Adjustable adj, int amount) {
|
public static void scrollAdjustable(Adjustable adj, int amount) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (adj == null) {
|
if (adj == null) {
|
||||||
log.log(Level.FINE, "Assertion (adj != null) failed");
|
log.fine("Assertion (adj != null) failed");
|
||||||
}
|
}
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
log.log(Level.FINE, "Assertion (amount != 0) failed");
|
log.fine("Assertion (amount != 0) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int current = adj.getValue();
|
int current = adj.getValue();
|
||||||
int upperLimit = adj.getMaximum() - adj.getVisibleAmount();
|
int upperLimit = adj.getMaximum() - adj.getVisibleAmount();
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "doScrolling by " + amount);
|
log.finer("doScrolling by " + amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amount > 0 && current < upperLimit) { // still some room to scroll
|
if (amount > 0 && current < upperLimit) { // still some room to scroll
|
||||||
|
@ -33,7 +33,7 @@ import java.util.Set;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used to aid in keeping track of DisplayChangedListeners and
|
* This class is used to aid in keeping track of DisplayChangedListeners and
|
||||||
@ -54,7 +54,7 @@ import java.util.logging.*;
|
|||||||
* screen to another on a system equipped with multiple displays.
|
* screen to another on a system equipped with multiple displays.
|
||||||
*/
|
*/
|
||||||
public class SunDisplayChanger {
|
public class SunDisplayChanger {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.multiscreen.SunDisplayChanger");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.multiscreen.SunDisplayChanger");
|
||||||
|
|
||||||
// Create a new synchronizedMap with initial capacity of one listener.
|
// Create a new synchronizedMap with initial capacity of one listener.
|
||||||
// It is asserted that the most common case is to have one GraphicsDevice
|
// It is asserted that the most common case is to have one GraphicsDevice
|
||||||
@ -68,13 +68,13 @@ public class SunDisplayChanger {
|
|||||||
* notified when the display is changed.
|
* notified when the display is changed.
|
||||||
*/
|
*/
|
||||||
public void add(DisplayChangedListener theListener) {
|
public void add(DisplayChangedListener theListener) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (theListener == null) {
|
if (theListener == null) {
|
||||||
log.log(Level.FINE, "Assertion (theListener != null) failed");
|
log.fine("Assertion (theListener != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "Adding listener: " + theListener);
|
log.finer("Adding listener: " + theListener);
|
||||||
}
|
}
|
||||||
listeners.put(theListener, null);
|
listeners.put(theListener, null);
|
||||||
}
|
}
|
||||||
@ -83,13 +83,13 @@ public class SunDisplayChanger {
|
|||||||
* Remove the given DisplayChangeListener from this SunDisplayChanger.
|
* Remove the given DisplayChangeListener from this SunDisplayChanger.
|
||||||
*/
|
*/
|
||||||
public void remove(DisplayChangedListener theListener) {
|
public void remove(DisplayChangedListener theListener) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (theListener == null) {
|
if (theListener == null) {
|
||||||
log.log(Level.FINE, "Assertion (theListener != null) failed");
|
log.fine("Assertion (theListener != null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "Removing listener: " + theListener);
|
log.finer("Removing listener: " + theListener);
|
||||||
}
|
}
|
||||||
listeners.remove(theListener);
|
listeners.remove(theListener);
|
||||||
}
|
}
|
||||||
@ -99,8 +99,8 @@ public class SunDisplayChanger {
|
|||||||
* taken place by calling their displayChanged() methods.
|
* taken place by calling their displayChanged() methods.
|
||||||
*/
|
*/
|
||||||
public void notifyListeners() {
|
public void notifyListeners() {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.log(Level.FINEST, "notifyListeners");
|
log.finest("notifyListeners");
|
||||||
}
|
}
|
||||||
// This method is implemented by making a clone of the set of listeners,
|
// This method is implemented by making a clone of the set of listeners,
|
||||||
// and then iterating over the clone. This is because during the course
|
// and then iterating over the clone. This is because during the course
|
||||||
@ -126,8 +126,8 @@ public class SunDisplayChanger {
|
|||||||
DisplayChangedListener current =
|
DisplayChangedListener current =
|
||||||
(DisplayChangedListener) itr.next();
|
(DisplayChangedListener) itr.next();
|
||||||
try {
|
try {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.log(Level.FINEST, "displayChanged for listener: " + current);
|
log.finest("displayChanged for listener: " + current);
|
||||||
}
|
}
|
||||||
current.displayChanged();
|
current.displayChanged();
|
||||||
} catch (IllegalComponentStateException e) {
|
} catch (IllegalComponentStateException e) {
|
||||||
@ -146,7 +146,7 @@ public class SunDisplayChanger {
|
|||||||
* taken place by calling their paletteChanged() methods.
|
* taken place by calling their paletteChanged() methods.
|
||||||
*/
|
*/
|
||||||
public void notifyPaletteChanged() {
|
public void notifyPaletteChanged() {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("notifyPaletteChanged");
|
log.finest("notifyPaletteChanged");
|
||||||
}
|
}
|
||||||
// This method is implemented by making a clone of the set of listeners,
|
// This method is implemented by making a clone of the set of listeners,
|
||||||
@ -172,8 +172,8 @@ public class SunDisplayChanger {
|
|||||||
DisplayChangedListener current =
|
DisplayChangedListener current =
|
||||||
(DisplayChangedListener) itr.next();
|
(DisplayChangedListener) itr.next();
|
||||||
try {
|
try {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.log(Level.FINEST, "paletteChanged for listener: " + current);
|
log.finest("paletteChanged for listener: " + current);
|
||||||
}
|
}
|
||||||
current.paletteChanged();
|
current.paletteChanged();
|
||||||
} catch (IllegalComponentStateException e) {
|
} catch (IllegalComponentStateException e) {
|
||||||
|
@ -27,14 +27,14 @@ package sun.awt;
|
|||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public abstract class SunGraphicsCallback {
|
public abstract class SunGraphicsCallback {
|
||||||
public static final int HEAVYWEIGHTS = 0x1;
|
public static final int HEAVYWEIGHTS = 0x1;
|
||||||
public static final int LIGHTWEIGHTS = 0x2;
|
public static final int LIGHTWEIGHTS = 0x2;
|
||||||
public static final int TWO_PASSES = 0x4;
|
public static final int TWO_PASSES = 0x4;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.SunGraphicsCallback");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunGraphicsCallback");
|
||||||
|
|
||||||
public abstract void run(Component comp, Graphics cg);
|
public abstract void run(Component comp, Graphics cg);
|
||||||
|
|
||||||
@ -87,11 +87,11 @@ public abstract class SunGraphicsCallback {
|
|||||||
int ncomponents = comps.length;
|
int ncomponents = comps.length;
|
||||||
Shape clip = g.getClip();
|
Shape clip = g.getClip();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER) && (clip != null)) {
|
if (log.isLoggable(PlatformLogger.FINER) && (clip != null)) {
|
||||||
Rectangle newrect = clip.getBounds();
|
Rectangle newrect = clip.getBounds();
|
||||||
log.log(Level.FINER, "x = " + newrect.x + ", y = " + newrect.y +
|
log.finer("x = " + newrect.x + ", y = " + newrect.y +
|
||||||
", width = " + newrect.width +
|
", width = " + newrect.width +
|
||||||
", height = " + newrect.height);
|
", height = " + newrect.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// A seriously sad hack--
|
// A seriously sad hack--
|
||||||
|
@ -40,8 +40,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.locks.Condition;
|
import java.util.concurrent.locks.Condition;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import sun.misc.SoftCache;
|
import sun.misc.SoftCache;
|
||||||
import sun.font.FontDesignMetrics;
|
import sun.font.FontDesignMetrics;
|
||||||
import sun.awt.im.InputContext;
|
import sun.awt.im.InputContext;
|
||||||
@ -61,7 +60,7 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
implements WindowClosingSupport, WindowClosingListener,
|
implements WindowClosingSupport, WindowClosingListener,
|
||||||
ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider {
|
ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.SunToolkit");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunToolkit");
|
||||||
|
|
||||||
/* Load debug settings for native code */
|
/* Load debug settings for native code */
|
||||||
static {
|
static {
|
||||||
@ -986,9 +985,9 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
//with scale factors x1, x3/4, x2/3, xN, x1/N.
|
//with scale factors x1, x3/4, x2/3, xN, x1/N.
|
||||||
Image im = i.next();
|
Image im = i.next();
|
||||||
if (im == null) {
|
if (im == null) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
|
log.finer("SunToolkit.getScaledIconImage: " +
|
||||||
"Skipping the image passed into Java because it's null.");
|
"Skipping the image passed into Java because it's null.");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1002,9 +1001,9 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
iw = im.getWidth(null);
|
iw = im.getWidth(null);
|
||||||
ih = im.getHeight(null);
|
ih = im.getHeight(null);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
|
log.finer("SunToolkit.getScaledIconImage: " +
|
||||||
"Perhaps the image passed into Java is broken. Skipping this icon.");
|
"Perhaps the image passed into Java is broken. Skipping this icon.");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1077,8 +1076,8 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
try {
|
try {
|
||||||
int x = (width - bestWidth) / 2;
|
int x = (width - bestWidth) / 2;
|
||||||
int y = (height - bestHeight) / 2;
|
int y = (height - bestHeight) / 2;
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "WWindowPeer.getScaledIconData() result : " +
|
log.finer("WWindowPeer.getScaledIconData() result : " +
|
||||||
"w : " + width + " h : " + height +
|
"w : " + width + " h : " + height +
|
||||||
" iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) +
|
" iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) +
|
||||||
" sim : " + bestSimilarity + " sf : " + bestScaleFactor +
|
" sim : " + bestSimilarity + " sf : " + bestScaleFactor +
|
||||||
@ -1095,9 +1094,9 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
public static DataBufferInt getScaledIconData(java.util.List<Image> imageList, int width, int height) {
|
public static DataBufferInt getScaledIconData(java.util.List<Image> imageList, int width, int height) {
|
||||||
BufferedImage bimage = getScaledIconImage(imageList, width, height);
|
BufferedImage bimage = getScaledIconImage(imageList, width, height);
|
||||||
if (bimage == null) {
|
if (bimage == null) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "SunToolkit.getScaledIconData: " +
|
log.finer("SunToolkit.getScaledIconData: " +
|
||||||
"Perhaps the image passed into Java is broken. Skipping this icon.");
|
"Perhaps the image passed into Java is broken. Skipping this icon.");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1913,7 +1912,7 @@ public abstract class SunToolkit extends Toolkit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void dumpPeers(final Logger aLog) {
|
protected static void dumpPeers(final PlatformLogger aLog) {
|
||||||
AWTAutoShutdown.getInstance().dumpPeers(aLog);
|
AWTAutoShutdown.getInstance().dumpPeers(aLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ import java.awt.Window;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
@ -41,7 +40,7 @@ public class WindowAccessor {
|
|||||||
private static Field fieldIsAutoRequestFocus;
|
private static Field fieldIsAutoRequestFocus;
|
||||||
private static Field fieldIsTrayIconWindow;
|
private static Field fieldIsTrayIconWindow;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.WindowAccessor");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.WindowAccessor");
|
||||||
|
|
||||||
private WindowAccessor() {
|
private WindowAccessor() {
|
||||||
}
|
}
|
||||||
@ -57,9 +56,9 @@ public class WindowAccessor {
|
|||||||
fieldIsTrayIconWindow.setAccessible(true);
|
fieldIsTrayIconWindow.setAccessible(true);
|
||||||
|
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
|
log.fine("Unable to initialize WindowAccessor: ", e);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
|
log.fine("Unable to initialize WindowAccessor: ", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -71,7 +70,7 @@ public class WindowAccessor {
|
|||||||
return fieldIsAutoRequestFocus.getBoolean(w);
|
return fieldIsAutoRequestFocus.getBoolean(w);
|
||||||
|
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
log.log(Level.FINE, "Unable to access the Window object", e);
|
log.fine("Unable to access the Window object", e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -81,7 +80,7 @@ public class WindowAccessor {
|
|||||||
return fieldIsTrayIconWindow.getBoolean(w);
|
return fieldIsTrayIconWindow.getBoolean(w);
|
||||||
|
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
log.log(Level.FINE, "Unable to access the Window object", e);
|
log.fine("Unable to access the Window object", e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -91,7 +90,7 @@ public class WindowAccessor {
|
|||||||
fieldIsTrayIconWindow.set(w, isTrayIconWindow);
|
fieldIsTrayIconWindow.set(w, isTrayIconWindow);
|
||||||
|
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
log.log(Level.FINE, "Unable to access the Window object", e);
|
log.fine("Unable to access the Window object", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ import java.util.Stack;
|
|||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
@ -222,7 +222,7 @@ public abstract class DataTransferer {
|
|||||||
*/
|
*/
|
||||||
private static DataTransferer transferer;
|
private static DataTransferer transferer;
|
||||||
|
|
||||||
private static final Logger dtLog = Logger.getLogger("sun.awt.datatransfer.DataTransfer");
|
private static final PlatformLogger dtLog = PlatformLogger.getLogger("sun.awt.datatransfer.DataTransfer");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
Class tCharArrayClass = null, tByteArrayClass = null;
|
Class tCharArrayClass = null, tByteArrayClass = null;
|
||||||
@ -382,9 +382,9 @@ public abstract class DataTransferer {
|
|||||||
* "text".
|
* "text".
|
||||||
*/
|
*/
|
||||||
public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
|
public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
|
||||||
if (dtLog.isLoggable(Level.FINE)) {
|
if (dtLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (!"text".equals(flavor.getPrimaryType())) {
|
if (!"text".equals(flavor.getPrimaryType())) {
|
||||||
dtLog.log(Level.FINE, "Assertion (\"text\".equals(flavor.getPrimaryType())) failed");
|
dtLog.fine("Assertion (\"text\".equals(flavor.getPrimaryType())) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ import java.util.HashSet;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -99,7 +99,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
|
|||||||
|
|
||||||
protected static final Object _globalLock = new Object();
|
protected static final Object _globalLock = new Object();
|
||||||
|
|
||||||
private static final Logger dndLog = Logger.getLogger("sun.awt.dnd.SunDropTargetContextPeer");
|
private static final PlatformLogger dndLog = PlatformLogger.getLogger("sun.awt.dnd.SunDropTargetContextPeer");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a primitive mechanism for advertising intra-JVM Transferables
|
* a primitive mechanism for advertising intra-JVM Transferables
|
||||||
@ -845,8 +845,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
|
|||||||
|
|
||||||
void registerEvent(SunDropTargetEvent e) {
|
void registerEvent(SunDropTargetEvent e) {
|
||||||
handler.lock();
|
handler.lock();
|
||||||
if (!eventSet.add(e) && dndLog.isLoggable(Level.FINE)) {
|
if (!eventSet.add(e) && dndLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
dndLog.log(Level.FINE, "Event is already registered: " + e);
|
dndLog.fine("Event is already registered: " + e);
|
||||||
}
|
}
|
||||||
handler.unlock();
|
handler.unlock();
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,9 @@ import java.text.MessageFormat;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.*;
|
|
||||||
import java.util.prefs.BackingStoreException;
|
import java.util.prefs.BackingStoreException;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -67,7 +67,7 @@ import sun.awt.SunToolkit;
|
|||||||
|
|
||||||
public class InputContext extends java.awt.im.InputContext
|
public class InputContext extends java.awt.im.InputContext
|
||||||
implements ComponentListener, WindowListener {
|
implements ComponentListener, WindowListener {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.im.InputContext");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.im.InputContext");
|
||||||
// The current input method is represented by two objects:
|
// The current input method is represented by two objects:
|
||||||
// a locator is used to keep information about the selected
|
// a locator is used to keep information about the selected
|
||||||
// input method and locale until we actually need a real input
|
// input method and locale until we actually need a real input
|
||||||
@ -386,7 +386,7 @@ public class InputContext extends java.awt.im.InputContext
|
|||||||
}
|
}
|
||||||
previousInputMethod = null;
|
previousInputMethod = null;
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Current client component " + currentClientComponent);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Current client component " + currentClientComponent);
|
||||||
if (inputMethod instanceof InputMethodAdapter) {
|
if (inputMethod instanceof InputMethodAdapter) {
|
||||||
((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
|
((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
|
||||||
}
|
}
|
||||||
@ -889,7 +889,7 @@ public class InputContext extends java.awt.im.InputContext
|
|||||||
{inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
|
{inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
|
||||||
throwable.getLocalizedMessage()};
|
throwable.getLocalizedMessage()};
|
||||||
MessageFormat mf = new MessageFormat(errorTextFormat);
|
MessageFormat mf = new MessageFormat(errorTextFormat);
|
||||||
Logger logger = Logger.getLogger("sun.awt.im");
|
PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
|
||||||
logger.config(mf.format(args));
|
logger.config(mf.format(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,12 +31,11 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
|
|
||||||
import sun.security.action.GetPropertyAction;
|
import sun.security.action.GetPropertyAction;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of utility methods.
|
* A collection of utility methods.
|
||||||
@ -139,7 +138,7 @@ public final class FontUtilities {
|
|||||||
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
|
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
|
||||||
|
|
||||||
private static boolean debugFonts = false;
|
private static boolean debugFonts = false;
|
||||||
private static Logger logger = null;
|
private static PlatformLogger logger = null;
|
||||||
private static boolean logging;
|
private static boolean logging;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -149,17 +148,17 @@ public final class FontUtilities {
|
|||||||
|
|
||||||
if (debugLevel != null && !debugLevel.equals("false")) {
|
if (debugLevel != null && !debugLevel.equals("false")) {
|
||||||
debugFonts = true;
|
debugFonts = true;
|
||||||
logger = Logger.getLogger("sun.java2d");
|
logger = PlatformLogger.getLogger("sun.java2d");
|
||||||
if (debugLevel.equals("warning")) {
|
if (debugLevel.equals("warning")) {
|
||||||
logger.setLevel(Level.WARNING);
|
logger.setLevel(PlatformLogger.WARNING);
|
||||||
} else if (debugLevel.equals("severe")) {
|
} else if (debugLevel.equals("severe")) {
|
||||||
logger.setLevel(Level.SEVERE);
|
logger.setLevel(PlatformLogger.SEVERE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debugFonts) {
|
if (debugFonts) {
|
||||||
logger = Logger.getLogger("sun.java2d", null);
|
logger = PlatformLogger.getLogger("sun.java2d");
|
||||||
logging = logger.getLevel() != Level.OFF;
|
logging = logger.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -298,7 +297,7 @@ public final class FontUtilities {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Logger getLogger() {
|
public static PlatformLogger getLogger() {
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,14 +47,13 @@ import java.util.StringTokenizer;
|
|||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.FontConfiguration;
|
import sun.awt.FontConfiguration;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
import sun.java2d.FontSupport;
|
import sun.java2d.FontSupport;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of the {@link FontManager} interface. It implements
|
* The base implementation of the {@link FontManager} interface. It implements
|
||||||
@ -473,7 +472,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
logger.info("JRE font directory: " + jreFontDirName);
|
logger.info("JRE font directory: " + jreFontDirName);
|
||||||
logger.info("Extra font path: " + extraFontPath);
|
logger.info("Extra font path: " + extraFontPath);
|
||||||
logger.info("Debug font path: " + dbgFontPath);
|
logger.info("Debug font path: " + dbgFontPath);
|
||||||
@ -1615,7 +1614,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logPlatformFontInfo() {
|
private void logPlatformFontInfo() {
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
for (int i=0; i< pathDirs.length;i++) {
|
for (int i=0; i< pathDirs.length;i++) {
|
||||||
logger.info("fontdir="+pathDirs[i]);
|
logger.info("fontdir="+pathDirs[i]);
|
||||||
}
|
}
|
||||||
@ -2997,7 +2996,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
|||||||
registeredFontFiles.add(fullName);
|
registeredFontFiles.add(fullName);
|
||||||
|
|
||||||
if (FontUtilities.debugFonts()
|
if (FontUtilities.debugFonts()
|
||||||
&& FontUtilities.getLogger().isLoggable(Level.INFO)) {
|
&& FontUtilities.getLogger().isLoggable(PlatformLogger.INFO)) {
|
||||||
String message = "Registering font " + fullName;
|
String message = "Registering font " + fullName;
|
||||||
String[] natNames = getNativeNames(fullName, null);
|
String[] natNames = getNativeNames(fullName, null);
|
||||||
if (natNames == null) {
|
if (natNames == null) {
|
||||||
|
@ -43,7 +43,6 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.Level;
|
|
||||||
import sun.java2d.Disposer;
|
import sun.java2d.Disposer;
|
||||||
import sun.java2d.DisposerRecord;
|
import sun.java2d.DisposerRecord;
|
||||||
|
|
||||||
@ -405,7 +404,7 @@ public class TrueTypeFont extends FileFont {
|
|||||||
}
|
}
|
||||||
} catch (FontFormatException e) {
|
} catch (FontFormatException e) {
|
||||||
if (FontUtilities.isLogging()) {
|
if (FontUtilities.isLogging()) {
|
||||||
FontUtilities.getLogger().log(Level.SEVERE,
|
FontUtilities.getLogger().severe(
|
||||||
"While reading " + platName, e);
|
"While reading " + platName, e);
|
||||||
}
|
}
|
||||||
bread = -1; // signal EOF
|
bread = -1; // signal EOF
|
||||||
@ -426,7 +425,7 @@ public class TrueTypeFont extends FileFont {
|
|||||||
* file are handled as a FontFormatException.
|
* file are handled as a FontFormatException.
|
||||||
*/
|
*/
|
||||||
if (FontUtilities.isLogging()) {
|
if (FontUtilities.isLogging()) {
|
||||||
FontUtilities.getLogger().log(Level.SEVERE,
|
FontUtilities.getLogger().severe(
|
||||||
"While reading " + platName, e);
|
"While reading " + platName, e);
|
||||||
}
|
}
|
||||||
if (bread == 0) {
|
if (bread == 0) {
|
||||||
|
@ -55,8 +55,6 @@ import java.util.StringTokenizer;
|
|||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.DisplayChangedListener;
|
import sun.awt.DisplayChangedListener;
|
||||||
import sun.awt.FontConfiguration;
|
import sun.awt.FontConfiguration;
|
||||||
@ -80,7 +78,6 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
|
|||||||
|
|
||||||
public static boolean isOpenSolaris;
|
public static boolean isOpenSolaris;
|
||||||
private static Font defaultFont;
|
private static Font defaultFont;
|
||||||
protected static Logger logger = null;
|
|
||||||
|
|
||||||
public SunGraphicsEnvironment() {
|
public SunGraphicsEnvironment() {
|
||||||
java.security.AccessController.doPrivileged(
|
java.security.AccessController.doPrivileged(
|
||||||
|
@ -31,8 +31,6 @@ import java.awt.peer.TrayIconPeer;
|
|||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
import java.awt.image.*;
|
import java.awt.image.*;
|
||||||
import java.text.BreakIterator;
|
import java.text.BreakIterator;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import sun.awt.motif.X11FontMetrics;
|
import sun.awt.motif.X11FontMetrics;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
// FIXME: implement multi-select
|
// FIXME: implement multi-select
|
||||||
/*
|
/*
|
||||||
@ -43,7 +43,7 @@ import java.util.logging.*;
|
|||||||
* posting of Item or ActionEvents
|
* posting of Item or ActionEvents
|
||||||
*/
|
*/
|
||||||
public class ListHelper implements XScrollbarClient {
|
public class ListHelper implements XScrollbarClient {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.ListHelper");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.ListHelper");
|
||||||
|
|
||||||
private final int FOCUS_INSET = 1;
|
private final int FOCUS_INSET = 1;
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ public class ListHelper implements XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int y2index(int y) {
|
public int y2index(int y) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("y=" + y +", firstIdx=" + firstDisplayedIndex() +", itemHeight=" + getItemHeight()
|
log.fine("y=" + y +", firstIdx=" + firstDisplayedIndex() +", itemHeight=" + getItemHeight()
|
||||||
+ ",item_margin=" + ITEM_MARGIN);
|
+ ",item_margin=" + ITEM_MARGIN);
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.UnsafeXDisposerRecord");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.UnsafeXDisposerRecord");
|
||||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||||
final long[] unsafe_ptrs, x_ptrs;
|
final long[] unsafe_ptrs, x_ptrs;
|
||||||
final String name;
|
final String name;
|
||||||
@ -59,11 +59,11 @@ class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
|||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
if (!disposed) {
|
if (!disposed) {
|
||||||
if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(Level.WARNING)) {
|
if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(PlatformLogger.WARNING)) {
|
||||||
if (place != null) {
|
if (place != null) {
|
||||||
log.log(Level.WARNING, name + " object was not disposed before finalization!", place);
|
log.warning(name + " object was not disposed before finalization!", place);
|
||||||
} else {
|
} else {
|
||||||
log.log(Level.WARNING, name + " object was not disposed before finalization!");
|
log.warning(name + " object was not disposed before finalization!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,15 +35,14 @@ package sun.awt.X11;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import sun.awt.XSettings;
|
import sun.awt.XSettings;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class XAWTXSettings extends XSettings implements XMSelectionListener {
|
class XAWTXSettings extends XSettings implements XMSelectionListener {
|
||||||
|
|
||||||
private final XAtom xSettingsPropertyAtom = XAtom.get("_XSETTINGS_SETTINGS");
|
private final XAtom xSettingsPropertyAtom = XAtom.get("_XSETTINGS_SETTINGS");
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XAWTXSettings");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XAWTXSettings");
|
||||||
|
|
||||||
/* The maximal length of the property data. */
|
/* The maximal length of the property data. */
|
||||||
public static final long MAX_LENGTH = 1000000;
|
public static final long MAX_LENGTH = 1000000;
|
||||||
@ -56,7 +55,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initXSettings() {
|
void initXSettings() {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Initializing XAWT XSettings");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Initializing XAWT XSettings");
|
||||||
settings = new XMSelection("_XSETTINGS");
|
settings = new XMSelection("_XSETTINGS");
|
||||||
settings.addSelectionListener(this);
|
settings.addSelectionListener(this);
|
||||||
initPerScreenXSettings();
|
initPerScreenXSettings();
|
||||||
@ -67,12 +66,12 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ownerDeath(int screen, XMSelection sel, long deadOwner) {
|
public void ownerDeath(int screen, XMSelection sel, long deadOwner) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
|
public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen );
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectionChanged(int screen, XMSelection sel, long owner , XPropertyEvent event) {
|
public void selectionChanged(int screen, XMSelection sel, long owner , XPropertyEvent event) {
|
||||||
@ -81,7 +80,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initPerScreenXSettings() {
|
void initPerScreenXSettings() {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Updating Per XSettings changes");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Updating Per XSettings changes");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As toolkit cannot yet cope with per-screen desktop properties,
|
* As toolkit cannot yet cope with per-screen desktop properties,
|
||||||
@ -115,7 +114,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map getUpdatedSettings(final long owner) {
|
private Map getUpdatedSettings(final long owner) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("owner =" + owner);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("owner =" + owner);
|
||||||
if (0 == owner) {
|
if (0 == owner) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -129,13 +128,13 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
|||||||
int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
|
int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
|
||||||
|
|
||||||
if (status != XConstants.Success || getter.getData() == 0) {
|
if (status != XConstants.Success || getter.getData() == 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("OH OH : getter failed status = " + status );
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("OH OH : getter failed status = " + status );
|
||||||
settings = null;
|
settings = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
long ptr = getter.getData();
|
long ptr = getter.getData();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("noItems = " + getter.getNumberOfItems());
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("noItems = " + getter.getNumberOfItems());
|
||||||
byte array[] = Native.toBytes(ptr,getter.getNumberOfItems());
|
byte array[] = Native.toBytes(ptr,getter.getNumberOfItems());
|
||||||
if (array != null) {
|
if (array != null) {
|
||||||
settings = update(array);
|
settings = update(array);
|
||||||
|
@ -33,7 +33,7 @@ import sun.awt.*;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import sun.java2d.SurfaceData;
|
import sun.java2d.SurfaceData;
|
||||||
import sun.java2d.SunGraphics2D;
|
import sun.java2d.SunGraphics2D;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XBaseMenuWindow");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XBaseMenuWindow");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Colors are calculated using MotifColorUtilities class
|
* Colors are calculated using MotifColorUtilities class
|
||||||
@ -330,7 +330,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
items.add(mp);
|
items.add(mp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("WARNING: Attempt to add menu item without a peer");
|
log.fine("WARNING: Attempt to add menu item without a peer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -351,7 +351,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
if (index < items.size()) {
|
if (index < items.size()) {
|
||||||
items.remove(index);
|
items.remove(index);
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("WARNING: Attempt to remove non-existing menu item, index : " + index + ", item count : " + items.size());
|
log.fine("WARNING: Attempt to remove non-existing menu item, index : " + index + ", item count : " + items.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
XMenuPeer showingSubmenu = getShowingSubmenu();
|
XMenuPeer showingSubmenu = getShowingSubmenu();
|
||||||
int newSelectedIndex = (item != null) ? items.indexOf(item) : -1;
|
int newSelectedIndex = (item != null) ? items.indexOf(item) : -1;
|
||||||
if (this.selectedIndex != newSelectedIndex) {
|
if (this.selectedIndex != newSelectedIndex) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("Selected index changed, was : " + this.selectedIndex + ", new : " + newSelectedIndex);
|
log.finest("Selected index changed, was : " + this.selectedIndex + ", new : " + newSelectedIndex);
|
||||||
}
|
}
|
||||||
this.selectedIndex = newSelectedIndex;
|
this.selectedIndex = newSelectedIndex;
|
||||||
@ -426,7 +426,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
try {
|
try {
|
||||||
synchronized(getMenuTreeLock()) {
|
synchronized(getMenuTreeLock()) {
|
||||||
if (showingSubmenu != submenuToShow) {
|
if (showingSubmenu != submenuToShow) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finest("Changing showing submenu");
|
log.finest("Changing showing submenu");
|
||||||
}
|
}
|
||||||
if (showingSubmenu != null) {
|
if (showingSubmenu != null) {
|
||||||
@ -1122,7 +1122,7 @@ abstract public class XBaseMenuWindow extends XWindow {
|
|||||||
* that grabs input focus
|
* that grabs input focus
|
||||||
*/
|
*/
|
||||||
void doHandleJavaKeyEvent(KeyEvent event) {
|
void doHandleJavaKeyEvent(KeyEvent event) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer(event.toString());
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer(event.toString());
|
||||||
if (event.getID() != KeyEvent.KEY_PRESSED) {
|
if (event.getID() != KeyEvent.KEY_PRESSED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,15 +27,15 @@ package sun.awt.X11;
|
|||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
import java.util.logging.*;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class XBaseWindow {
|
public class XBaseWindow {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XBaseWindow");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XBaseWindow");
|
||||||
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XBaseWindow");
|
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XBaseWindow");
|
||||||
private static final Logger eventLog = Logger.getLogger("sun.awt.X11.event.XBaseWindow");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("sun.awt.X11.event.XBaseWindow");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XBaseWindow");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XBaseWindow");
|
||||||
private static final Logger grabLog = Logger.getLogger("sun.awt.X11.grab.XBaseWindow");
|
private static final PlatformLogger grabLog = PlatformLogger.getLogger("sun.awt.X11.grab.XBaseWindow");
|
||||||
|
|
||||||
public static final String
|
public static final String
|
||||||
PARENT_WINDOW = "parent window", // parent window, Long
|
PARENT_WINDOW = "parent window", // parent window, Long
|
||||||
@ -160,7 +160,7 @@ public class XBaseWindow {
|
|||||||
* with class-specific values and perform post-initialization actions.
|
* with class-specific values and perform post-initialization actions.
|
||||||
*/
|
*/
|
||||||
void postInit(XCreateWindowParams params) {
|
void postInit(XCreateWindowParams params) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("WM name is " + getWMName());
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("WM name is " + getWMName());
|
||||||
updateWMName();
|
updateWMName();
|
||||||
|
|
||||||
// Set WM_CLIENT_LEADER property
|
// Set WM_CLIENT_LEADER property
|
||||||
@ -198,7 +198,7 @@ public class XBaseWindow {
|
|||||||
awtUnlock();
|
awtUnlock();
|
||||||
throw re;
|
throw re;
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.log(Level.WARNING, "Exception during peer initialization", t);
|
log.warning("Exception during peer initialization", t);
|
||||||
awtLock();
|
awtLock();
|
||||||
initialising = InitialiseState.FAILED_INITIALISATION;
|
initialising = InitialiseState.FAILED_INITIALISATION;
|
||||||
awtLockNotifyAll();
|
awtLockNotifyAll();
|
||||||
@ -360,7 +360,7 @@ public class XBaseWindow {
|
|||||||
value_mask |= XConstants.CWBitGravity;
|
value_mask |= XConstants.CWBitGravity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("Creating window for " + this + " with the following attributes: \n" + params);
|
log.fine("Creating window for " + this + " with the following attributes: \n" + params);
|
||||||
}
|
}
|
||||||
window = XlibWrapper.XCreateWindow(XToolkit.getDisplay(),
|
window = XlibWrapper.XCreateWindow(XToolkit.getDisplay(),
|
||||||
@ -480,7 +480,7 @@ public class XBaseWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setSizeHints(long flags, int x, int y, int width, int height) {
|
public void setSizeHints(long flags, int x, int y, int width, int height) {
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags));
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags));
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XSizeHints hints = getHints();
|
XSizeHints hints = getHints();
|
||||||
@ -541,7 +541,7 @@ public class XBaseWindow {
|
|||||||
flags |= XUtilConstants.PWinGravity;
|
flags |= XUtilConstants.PWinGravity;
|
||||||
hints.set_flags(flags);
|
hints.set_flags(flags);
|
||||||
hints.set_win_gravity((int)XConstants.NorthWestGravity);
|
hints.set_win_gravity((int)XConstants.NorthWestGravity);
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
|
||||||
", values " + hints);
|
", values " + hints);
|
||||||
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
|
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
|
||||||
} finally {
|
} finally {
|
||||||
@ -593,7 +593,7 @@ public class XBaseWindow {
|
|||||||
public void xRequestFocus(long time) {
|
public void xRequestFocus(long time) {
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()) + " with time " + time);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()) + " with time " + time);
|
||||||
XlibWrapper.XSetInputFocus2(XToolkit.getDisplay(), getWindow(), time);
|
XlibWrapper.XSetInputFocus2(XToolkit.getDisplay(), getWindow(), time);
|
||||||
} finally {
|
} finally {
|
||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
@ -602,7 +602,7 @@ public class XBaseWindow {
|
|||||||
public void xRequestFocus() {
|
public void xRequestFocus() {
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()));
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()));
|
||||||
XlibWrapper.XSetInputFocus(XToolkit.getDisplay(), getWindow());
|
XlibWrapper.XSetInputFocus(XToolkit.getDisplay(), getWindow());
|
||||||
} finally {
|
} finally {
|
||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
@ -619,7 +619,7 @@ public class XBaseWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void xSetVisible(boolean visible) {
|
public void xSetVisible(boolean visible) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting visible on " + this + " to " + visible);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting visible on " + this + " to " + visible);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
this.visible = visible;
|
this.visible = visible;
|
||||||
@ -824,7 +824,7 @@ public class XBaseWindow {
|
|||||||
* The active grab overrides activated automatic grab.
|
* The active grab overrides activated automatic grab.
|
||||||
*/
|
*/
|
||||||
public boolean grabInput() {
|
public boolean grabInput() {
|
||||||
grabLog.log(Level.FINE, "Grab input on {0}", new Object[] {this});
|
grabLog.fine("Grab input on {0}", this);
|
||||||
|
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
@ -887,7 +887,7 @@ public class XBaseWindow {
|
|||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XBaseWindow grabWindow = XAwtState.getGrabWindow();
|
XBaseWindow grabWindow = XAwtState.getGrabWindow();
|
||||||
grabLog.log(Level.FINE, "UnGrab input on {0}", new Object[] {grabWindow});
|
grabLog.fine("UnGrab input on {0}", grabWindow);
|
||||||
if (grabWindow != null) {
|
if (grabWindow != null) {
|
||||||
grabWindow.ungrabInputImpl();
|
grabWindow.ungrabInputImpl();
|
||||||
if (!XToolkit.getSunAwtDisableGrab()) {
|
if (!XToolkit.getSunAwtDisableGrab()) {
|
||||||
@ -929,7 +929,7 @@ public class XBaseWindow {
|
|||||||
mapped = false;
|
mapped = false;
|
||||||
}
|
}
|
||||||
public void handleReparentNotifyEvent(XEvent xev) {
|
public void handleReparentNotifyEvent(XEvent xev) {
|
||||||
if (eventLog.isLoggable(Level.FINER)) {
|
if (eventLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
XReparentEvent msg = xev.get_xreparent();
|
XReparentEvent msg = xev.get_xreparent();
|
||||||
eventLog.finer(msg.toString());
|
eventLog.finer(msg.toString());
|
||||||
}
|
}
|
||||||
@ -939,8 +939,8 @@ public class XBaseWindow {
|
|||||||
if (XPropertyCache.isCachingSupported()) {
|
if (XPropertyCache.isCachingSupported()) {
|
||||||
XPropertyCache.clearCache(window, XAtom.get(msg.get_atom()));
|
XPropertyCache.clearCache(window, XAtom.get(msg.get_atom()));
|
||||||
}
|
}
|
||||||
if (eventLog.isLoggable(Level.FINER)) {
|
if (eventLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
eventLog.log(Level.FINER, "{0}", new Object[] {msg});
|
eventLog.finer("{0}", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -969,7 +969,7 @@ public class XBaseWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void handleClientMessage(XEvent xev) {
|
public void handleClientMessage(XEvent xev) {
|
||||||
if (eventLog.isLoggable(Level.FINER)) {
|
if (eventLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
XClientMessageEvent msg = xev.get_xclient();
|
XClientMessageEvent msg = xev.get_xclient();
|
||||||
eventLog.finer(msg.toString());
|
eventLog.finer(msg.toString());
|
||||||
}
|
}
|
||||||
@ -1021,8 +1021,7 @@ public class XBaseWindow {
|
|||||||
}
|
}
|
||||||
public void handleConfigureNotifyEvent(XEvent xev) {
|
public void handleConfigureNotifyEvent(XEvent xev) {
|
||||||
XConfigureEvent xe = xev.get_xconfigure();
|
XConfigureEvent xe = xev.get_xconfigure();
|
||||||
insLog.log(Level.FINER, "Configure, {0}",
|
insLog.finer("Configure, {0}", xe);
|
||||||
new Object[] {xe});
|
|
||||||
x = xe.get_x();
|
x = xe.get_x();
|
||||||
y = xe.get_y();
|
y = xe.get_y();
|
||||||
width = xe.get_width();
|
width = xe.get_width();
|
||||||
@ -1073,7 +1072,7 @@ public class XBaseWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dispatchEvent(XEvent xev) {
|
public void dispatchEvent(XEvent xev) {
|
||||||
if (eventLog.isLoggable(Level.FINEST)) eventLog.finest(xev.toString());
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest(xev.toString());
|
||||||
int type = xev.get_type();
|
int type = xev.get_type();
|
||||||
|
|
||||||
if (isDisposed()) {
|
if (isDisposed()) {
|
||||||
|
@ -29,8 +29,6 @@ import java.awt.*;
|
|||||||
import java.awt.peer.*;
|
import java.awt.peer.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
@ -42,8 +40,6 @@ class XCheckboxMenuItemPeer extends XMenuItemPeer implements CheckboxMenuItemPee
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XCheckboxMenuItemPeer");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CheckboxMenuItem's fields
|
* CheckboxMenuItem's fields
|
||||||
*/
|
*/
|
||||||
|
@ -32,11 +32,11 @@ import java.awt.image.BufferedImage;
|
|||||||
import javax.swing.plaf.basic.BasicGraphicsUtils;
|
import javax.swing.plaf.basic.BasicGraphicsUtils;
|
||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XCheckboxPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XCheckboxPeer");
|
||||||
|
|
||||||
private static final Insets focusInsets = new Insets(0,0,0,0);
|
private static final Insets focusInsets = new Insets(0,0,0,0);
|
||||||
private static final Insets borderInsets = new Insets(2,2,2,2);
|
private static final Insets borderInsets = new Insets(2,2,2,2);
|
||||||
@ -172,7 +172,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
|||||||
Checkbox cb = (Checkbox) e.getSource();
|
Checkbox cb = (Checkbox) e.getSource();
|
||||||
|
|
||||||
if (cb.contains(e.getX(), e.getY())) {
|
if (cb.contains(e.getX(), e.getY())) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("mousePressed() on " + target.getName() + " : armed = " + armed + ", pressed = " + pressed
|
log.finer("mousePressed() on " + target.getName() + " : armed = " + armed + ", pressed = " + pressed
|
||||||
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("mouseReleased() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
log.finer("mouseReleased() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
||||||
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void mouseEntered(MouseEvent e) {
|
public void mouseEntered(MouseEvent e) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("mouseEntered() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
log.finer("mouseEntered() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
||||||
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void mouseExited(MouseEvent e) {
|
public void mouseExited(MouseEvent e) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("mouseExited() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
log.finer("mouseExited() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed
|
||||||
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
+ ", selected = " + selected + ", enabled = " + isEnabled());
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ package sun.awt.X11;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.peer.*;
|
import java.awt.peer.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
// FIXME: tab traversal should be disabled when mouse is captured (4816336)
|
// FIXME: tab traversal should be disabled when mouse is captured (4816336)
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ import java.util.logging.*;
|
|||||||
// TODO: make painting more efficient (i.e. when down arrow is pressed, only two items should need to be repainted.
|
// TODO: make painting more efficient (i.e. when down arrow is pressed, only two items should need to be repainted.
|
||||||
|
|
||||||
public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelStateListener {
|
public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelStateListener {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XChoicePeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XChoicePeer");
|
||||||
|
|
||||||
private static final int MAX_UNFURLED_ITEMS = 10; // Maximum number of
|
private static final int MAX_UNFURLED_ITEMS = 10; // Maximum number of
|
||||||
// items to be displayed
|
// items to be displayed
|
||||||
@ -892,7 +892,7 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS
|
|||||||
if (transX > 0 && transX < width &&
|
if (transX > 0 && transX < width &&
|
||||||
transY > 0 && transY < height) {
|
transY > 0 && transY < height) {
|
||||||
int newIdx = helper.y2index(transY);
|
int newIdx = helper.y2index(transY);
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("transX=" + transX + ", transY=" + transY
|
log.fine("transX=" + transX + ", transY=" + transY
|
||||||
+ ",width=" + width + ", height=" + height
|
+ ",width=" + width + ", height=" + height
|
||||||
+ ", newIdx=" + newIdx + " on " + target);
|
+ ", newIdx=" + newIdx + " on " + target);
|
||||||
|
@ -66,7 +66,8 @@ import java.util.Collection;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
import sun.awt.event.IgnorePaintEvent;
|
import sun.awt.event.IgnorePaintEvent;
|
||||||
import sun.awt.image.SunVolatileImage;
|
import sun.awt.image.SunVolatileImage;
|
||||||
@ -77,12 +78,12 @@ import sun.java2d.pipe.Region;
|
|||||||
public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer,
|
public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer,
|
||||||
BackBufferCapsProvider
|
BackBufferCapsProvider
|
||||||
{
|
{
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XComponentPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XComponentPeer");
|
||||||
private static final Logger buffersLog = Logger.getLogger("sun.awt.X11.XComponentPeer.multibuffer");
|
private static final PlatformLogger buffersLog = PlatformLogger.getLogger("sun.awt.X11.XComponentPeer.multibuffer");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XComponentPeer");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XComponentPeer");
|
||||||
private static final Logger fontLog = Logger.getLogger("sun.awt.X11.font.XComponentPeer");
|
private static final PlatformLogger fontLog = PlatformLogger.getLogger("sun.awt.X11.font.XComponentPeer");
|
||||||
private static final Logger enableLog = Logger.getLogger("sun.awt.X11.enable.XComponentPeer");
|
private static final PlatformLogger enableLog = PlatformLogger.getLogger("sun.awt.X11.enable.XComponentPeer");
|
||||||
private static final Logger shapeLog = Logger.getLogger("sun.awt.X11.shape.XComponentPeer");
|
private static final PlatformLogger shapeLog = PlatformLogger.getLogger("sun.awt.X11.shape.XComponentPeer");
|
||||||
|
|
||||||
boolean paintPending = false;
|
boolean paintPending = false;
|
||||||
boolean isLayouting = false;
|
boolean isLayouting = false;
|
||||||
@ -159,7 +160,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enableLog.log(Level.FINE, "Initial enable state: {0}", new Object[] {Boolean.valueOf(enabled)});
|
enableLog.fine("Initial enable state: {0}", Boolean.valueOf(enabled));
|
||||||
|
|
||||||
if (target.isVisible()) {
|
if (target.isVisible()) {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
@ -253,7 +254,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
* Called when component receives focus
|
* Called when component receives focus
|
||||||
*/
|
*/
|
||||||
public void focusGained(FocusEvent e) {
|
public void focusGained(FocusEvent e) {
|
||||||
focusLog.log(Level.FINE, "{0}", new Object[] {e});
|
focusLog.fine("{0}", e);
|
||||||
bHasFocus = true;
|
bHasFocus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +262,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
* Called when component loses focus
|
* Called when component loses focus
|
||||||
*/
|
*/
|
||||||
public void focusLost(FocusEvent e) {
|
public void focusLost(FocusEvent e) {
|
||||||
focusLog.log(Level.FINE, "{0}", new Object[] {e});
|
focusLog.fine("{0}", e);
|
||||||
bHasFocus = false;
|
bHasFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +334,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
|
case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
|
||||||
// Currently we just generate focus events like we deal with lightweight instead of calling
|
// Currently we just generate focus events like we deal with lightweight instead of calling
|
||||||
// XSetInputFocus on native window
|
// XSetInputFocus on native window
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Proceeding with request to " +
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Proceeding with request to " +
|
||||||
lightweightChild + " in " + target);
|
lightweightChild + " in " + target);
|
||||||
/**
|
/**
|
||||||
* The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
|
* The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
|
||||||
@ -358,7 +359,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
*/
|
*/
|
||||||
boolean res = wpeer.requestWindowFocus(null);
|
boolean res = wpeer.requestWindowFocus(null);
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Requested window focus: " + res);
|
||||||
// If parent window can be made focused and has been made focused(synchronously)
|
// If parent window can be made focused and has been made focused(synchronously)
|
||||||
// then we can proceed with children, otherwise we retreat.
|
// then we can proceed with children, otherwise we retreat.
|
||||||
if (!(res && parentWindow.isFocused())) {
|
if (!(res && parentWindow.isFocused())) {
|
||||||
@ -378,13 +379,13 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean rejectFocusRequestHelper(String logMsg) {
|
private boolean rejectFocusRequestHelper(String logMsg) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer(logMsg);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(logMsg);
|
||||||
XKeyboardFocusManagerPeer.removeLastFocusRequest(target);
|
XKeyboardFocusManagerPeer.removeLastFocusRequest(target);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleJavaFocusEvent(AWTEvent e) {
|
void handleJavaFocusEvent(AWTEvent e) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer(e.toString());
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(e.toString());
|
||||||
if (e.getID() == FocusEvent.FOCUS_GAINED) {
|
if (e.getID() == FocusEvent.FOCUS_GAINED) {
|
||||||
focusGained((FocusEvent)e);
|
focusGained((FocusEvent)e);
|
||||||
} else {
|
} else {
|
||||||
@ -414,7 +415,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
* @see java.awt.peer.ComponentPeer
|
* @see java.awt.peer.ComponentPeer
|
||||||
*/
|
*/
|
||||||
public void setEnabled(boolean value) {
|
public void setEnabled(boolean value) {
|
||||||
enableLog.log(Level.FINE, "{0}ing {1}", new Object[] {(value?"Enabl":"Disabl"), this});
|
enableLog.fine("{0}ing {1}", (value?"Enabl":"Disabl"), this);
|
||||||
boolean repaintNeeded = (enabled != value);
|
boolean repaintNeeded = (enabled != value);
|
||||||
enabled = value;
|
enabled = value;
|
||||||
if (target instanceof Container) {
|
if (target instanceof Container) {
|
||||||
@ -690,7 +691,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBackground(Color c) {
|
public void setBackground(Color c) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Set background to " + c);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Set background to " + c);
|
||||||
synchronized (getStateLock()) {
|
synchronized (getStateLock()) {
|
||||||
background = c;
|
background = c;
|
||||||
}
|
}
|
||||||
@ -699,7 +700,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setForeground(Color c) {
|
public void setForeground(Color c) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Set foreground to " + c);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Set foreground to " + c);
|
||||||
synchronized (getStateLock()) {
|
synchronized (getStateLock()) {
|
||||||
foreground = c;
|
foreground = c;
|
||||||
}
|
}
|
||||||
@ -718,7 +719,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
* @since JDK1.0
|
* @since JDK1.0
|
||||||
*/
|
*/
|
||||||
public FontMetrics getFontMetrics(Font font) {
|
public FontMetrics getFontMetrics(Font font) {
|
||||||
if (fontLog.isLoggable(Level.FINE)) fontLog.fine("Getting font metrics for " + font);
|
if (fontLog.isLoggable(PlatformLogger.FINE)) fontLog.fine("Getting font metrics for " + font);
|
||||||
return sun.font.FontDesignMetrics.getMetrics(font);
|
return sun.font.FontDesignMetrics.getMetrics(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1188,7 +1189,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
public void createBuffers(int numBuffers, BufferCapabilities caps)
|
public void createBuffers(int numBuffers, BufferCapabilities caps)
|
||||||
throws AWTException
|
throws AWTException
|
||||||
{
|
{
|
||||||
if (buffersLog.isLoggable(Level.FINE)) {
|
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")");
|
buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")");
|
||||||
}
|
}
|
||||||
// set the caps first, they're used when creating the bb
|
// set the caps first, they're used when creating the bb
|
||||||
@ -1206,7 +1207,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
public void flip(int x1, int y1, int x2, int y2,
|
public void flip(int x1, int y1, int x2, int y2,
|
||||||
BufferCapabilities.FlipContents flipAction)
|
BufferCapabilities.FlipContents flipAction)
|
||||||
{
|
{
|
||||||
if (buffersLog.isLoggable(Level.FINE)) {
|
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
buffersLog.fine("flip(" + flipAction + ")");
|
buffersLog.fine("flip(" + flipAction + ")");
|
||||||
}
|
}
|
||||||
if (backBuffer == 0) {
|
if (backBuffer == 0) {
|
||||||
@ -1217,7 +1218,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Image getBackBuffer() {
|
public Image getBackBuffer() {
|
||||||
if (buffersLog.isLoggable(Level.FINE)) {
|
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
buffersLog.fine("getBackBuffer()");
|
buffersLog.fine("getBackBuffer()");
|
||||||
}
|
}
|
||||||
if (backBuffer == 0) {
|
if (backBuffer == 0) {
|
||||||
@ -1227,7 +1228,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void destroyBuffers() {
|
public void destroyBuffers() {
|
||||||
if (buffersLog.isLoggable(Level.FINE)) {
|
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
buffersLog.fine("destroyBuffers()");
|
buffersLog.fine("destroyBuffers()");
|
||||||
}
|
}
|
||||||
graphicsConfig.destroyBackBuffer(backBuffer);
|
graphicsConfig.destroyBackBuffer(backBuffer);
|
||||||
@ -1262,7 +1263,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
* ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
|
* ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
|
||||||
*/
|
*/
|
||||||
protected boolean isEventDisabled(XEvent e) {
|
protected boolean isEventDisabled(XEvent e) {
|
||||||
enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}", new Object[] {e, (isEnabled()?"enabled":"disable")});
|
enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable"));
|
||||||
if (!isEnabled()) {
|
if (!isEnabled()) {
|
||||||
switch (e.get_type()) {
|
switch (e.get_type()) {
|
||||||
case XConstants.ButtonPress:
|
case XConstants.ButtonPress:
|
||||||
@ -1272,7 +1273,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
case XConstants.EnterNotify:
|
case XConstants.EnterNotify:
|
||||||
case XConstants.LeaveNotify:
|
case XConstants.LeaveNotify:
|
||||||
case XConstants.MotionNotify:
|
case XConstants.MotionNotify:
|
||||||
enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
|
enableLog.finer("Event {0} is disable", e);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1393,7 +1394,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
*/
|
*/
|
||||||
public void applyShape(Region shape) {
|
public void applyShape(Region shape) {
|
||||||
if (XlibUtil.isShapingSupported()) {
|
if (XlibUtil.isShapingSupported()) {
|
||||||
if (shapeLog.isLoggable(Level.FINER)) {
|
if (shapeLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
shapeLog.finer(
|
shapeLog.finer(
|
||||||
"*** INFO: Setting shape: PEER: " + this
|
"*** INFO: Setting shape: PEER: " + this
|
||||||
+ "; WINDOW: " + getWindow()
|
+ "; WINDOW: " + getWindow()
|
||||||
@ -1423,7 +1424,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
|||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (shapeLog.isLoggable(Level.FINER)) {
|
if (shapeLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
shapeLog.finer("*** WARNING: Shaping is NOT supported!");
|
shapeLog.finer("*** WARNING: Shaping is NOT supported!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@ import java.awt.Insets;
|
|||||||
|
|
||||||
import java.awt.event.ComponentEvent;
|
import java.awt.event.ComponentEvent;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ import sun.awt.ComponentAccessor;
|
|||||||
* decorated window. So coordinates in it would be the same as java coordinates.
|
* decorated window. So coordinates in it would be the same as java coordinates.
|
||||||
*/
|
*/
|
||||||
public final class XContentWindow extends XWindow {
|
public final class XContentWindow extends XWindow {
|
||||||
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XContentWindow");
|
private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XContentWindow");
|
||||||
|
|
||||||
static XContentWindow createContent(XDecoratedPeer parentFrame) {
|
static XContentWindow createContent(XDecoratedPeer parentFrame) {
|
||||||
final WindowDimensions dims = parentFrame.getDimensions();
|
final WindowDimensions dims = parentFrame.getDimensions();
|
||||||
@ -116,8 +115,8 @@ public final class XContentWindow extends XWindow {
|
|||||||
if (in != null) {
|
if (in != null) {
|
||||||
newBounds.setLocation(-in.left, -in.top);
|
newBounds.setLocation(-in.left, -in.top);
|
||||||
}
|
}
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting content bounds {0}, old bounds {1}",
|
||||||
new Object[] {newBounds, getBounds()});
|
newBounds, getBounds());
|
||||||
// Fix for 5023533:
|
// Fix for 5023533:
|
||||||
// Change in the size of the content window means, well, change of the size
|
// Change in the size of the content window means, well, change of the size
|
||||||
// Change in the location of the content window means change in insets
|
// Change in the location of the content window means change in insets
|
||||||
|
@ -30,17 +30,16 @@ import java.awt.event.ComponentEvent;
|
|||||||
import java.awt.event.InvocationEvent;
|
import java.awt.event.InvocationEvent;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
abstract class XDecoratedPeer extends XWindowPeer {
|
abstract class XDecoratedPeer extends XWindowPeer {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XDecoratedPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XDecoratedPeer");
|
||||||
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
|
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
|
||||||
private static final Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
|
private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
|
||||||
|
|
||||||
// Set to true when we get the first ConfigureNotify after being
|
// Set to true when we get the first ConfigureNotify after being
|
||||||
// reparented - indicates that WM has adopted the top-level.
|
// reparented - indicates that WM has adopted the top-level.
|
||||||
@ -79,7 +78,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
Rectangle bounds = (Rectangle)params.get(BOUNDS);
|
Rectangle bounds = (Rectangle)params.get(BOUNDS);
|
||||||
dimensions = new WindowDimensions(bounds, getRealInsets(), false);
|
dimensions = new WindowDimensions(bounds, getRealInsets(), false);
|
||||||
params.put(BOUNDS, dimensions.getClientRect());
|
params.put(BOUNDS, dimensions.getClientRect());
|
||||||
insLog.log(Level.FINE, "Initial dimensions {0}", new Object[] { dimensions });
|
insLog.fine("Initial dimensions {0}", dimensions);
|
||||||
|
|
||||||
// Deny default processing of these events on the shell - proxy will take care of
|
// Deny default processing of these events on the shell - proxy will take care of
|
||||||
// them instead
|
// them instead
|
||||||
@ -175,7 +174,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
public void setTitle(String title) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Title is " + title);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Title is " + title);
|
||||||
winAttr.title = title;
|
winAttr.title = title;
|
||||||
updateWMName();
|
updateWMName();
|
||||||
}
|
}
|
||||||
@ -265,7 +264,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
|
wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
|
||||||
}
|
}
|
||||||
|
|
||||||
insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
|
insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
|
||||||
|
|
||||||
if (wm_set_insets != null) {
|
if (wm_set_insets != null) {
|
||||||
wm_set_insets = copy(wm_set_insets);
|
wm_set_insets = copy(wm_set_insets);
|
||||||
@ -292,7 +291,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
|
|
||||||
public void handleReparentNotifyEvent(XEvent xev) {
|
public void handleReparentNotifyEvent(XEvent xev) {
|
||||||
XReparentEvent xe = xev.get_xreparent();
|
XReparentEvent xe = xev.get_xreparent();
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine(xe.toString());
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine(xe.toString());
|
||||||
reparent_serial = xe.get_serial();
|
reparent_serial = xe.get_serial();
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
@ -331,7 +330,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
// Check if we have insets provided by the WM
|
// Check if we have insets provided by the WM
|
||||||
Insets correctWM = getWMSetInsets(null);
|
Insets correctWM = getWMSetInsets(null);
|
||||||
if (correctWM != null) {
|
if (correctWM != null) {
|
||||||
insLog.log(Level.FINER, "wm-provided insets {0}", new Object[]{correctWM});
|
insLog.finer("wm-provided insets {0}", correctWM);
|
||||||
// If these insets are equal to our current insets - no actions are necessary
|
// If these insets are equal to our current insets - no actions are necessary
|
||||||
Insets dimInsets = dimensions.getInsets();
|
Insets dimInsets = dimensions.getInsets();
|
||||||
if (correctWM.equals(dimInsets)) {
|
if (correctWM.equals(dimInsets)) {
|
||||||
@ -345,9 +344,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
|
correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
|
||||||
|
|
||||||
if (correctWM != null) {
|
if (correctWM != null) {
|
||||||
insLog.log(Level.FINER, "correctWM {0}", new Object[] {correctWM});
|
insLog.finer("correctWM {0}", correctWM);
|
||||||
} else {
|
} else {
|
||||||
insLog.log(Level.FINER, "correctWM insets are not available, waiting for configureNotify");
|
insLog.finer("correctWM insets are not available, waiting for configureNotify");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +367,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
* initial insets were wrong (most likely they were).
|
* initial insets were wrong (most likely they were).
|
||||||
*/
|
*/
|
||||||
Insets correction = difference(correctWM, currentInsets);
|
Insets correction = difference(correctWM, currentInsets);
|
||||||
insLog.log(Level.FINEST, "Corrention {0}", new Object[] {correction});
|
insLog.finest("Corrention {0}", correction);
|
||||||
if (!isNull(correction)) {
|
if (!isNull(correction)) {
|
||||||
currentInsets = copy(correctWM);
|
currentInsets = copy(correctWM);
|
||||||
applyGuessedInsets();
|
applyGuessedInsets();
|
||||||
@ -378,7 +377,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
//update minimum size hints
|
//update minimum size hints
|
||||||
updateMinSizeHints();
|
updateMinSizeHints();
|
||||||
}
|
}
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
|
||||||
|
|
||||||
dimensions.setInsets(getRealInsets());
|
dimensions.setInsets(getRealInsets());
|
||||||
insets_corrected = true;
|
insets_corrected = true;
|
||||||
@ -452,8 +451,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
public Insets getInsets() {
|
public Insets getInsets() {
|
||||||
Insets in = copy(getRealInsets());
|
Insets in = copy(getRealInsets());
|
||||||
in.top += getMenuBarHeight();
|
in.top += getMenuBarHeight();
|
||||||
if (insLog.isLoggable(Level.FINEST)) {
|
if (insLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
|
insLog.finest("Get insets returns {0}", in);
|
||||||
}
|
}
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
@ -482,7 +481,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
public void reshape(WindowDimensions newDimensions, int op,
|
public void reshape(WindowDimensions newDimensions, int op,
|
||||||
boolean userReshape)
|
boolean userReshape)
|
||||||
{
|
{
|
||||||
if (insLog.isLoggable(Level.FINE)) {
|
if (insLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
insLog.fine("Reshaping " + this + " to " + newDimensions + " op " + op + " user reshape " + userReshape);
|
insLog.fine("Reshaping " + this + " to " + newDimensions + " op " + op + " user reshape " + userReshape);
|
||||||
}
|
}
|
||||||
if (userReshape) {
|
if (userReshape) {
|
||||||
@ -503,8 +502,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
if (!isReparented() || !isVisible()) {
|
if (!isReparented() || !isVisible()) {
|
||||||
insLog.log(Level.FINE, "- not reparented({0}) or not visible({1}), default reshape",
|
insLog.fine("- not reparented({0}) or not visible({1}), default reshape",
|
||||||
new Object[] {Boolean.valueOf(isReparented()), Boolean.valueOf(visible)});
|
Boolean.valueOf(isReparented()), Boolean.valueOf(visible));
|
||||||
|
|
||||||
// Fix for 6323293.
|
// Fix for 6323293.
|
||||||
// This actually is needed to preserve compatibility with previous releases -
|
// This actually is needed to preserve compatibility with previous releases -
|
||||||
@ -609,8 +608,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
dims.setSize(width, height);
|
dims.setSize(width, height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "For the operation {0} new dimensions are {1}",
|
if (insLog.isLoggable(PlatformLogger.FINE))
|
||||||
new Object[] {operationToString(operation), dims});
|
insLog.fine("For the operation {0} new dimensions are {1}",
|
||||||
|
operationToString(operation), dims);
|
||||||
|
|
||||||
reshape(dims, operation, userReshape);
|
reshape(dims, operation, userReshape);
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
public void handleConfigureNotifyEvent(XEvent xev) {
|
public void handleConfigureNotifyEvent(XEvent xev) {
|
||||||
assert (SunToolkit.isAWTLockHeldByCurrentThread());
|
assert (SunToolkit.isAWTLockHeldByCurrentThread());
|
||||||
XConfigureEvent xe = xev.get_xconfigure();
|
XConfigureEvent xe = xev.get_xconfigure();
|
||||||
insLog.log(Level.FINE, "Configure notify {0}", new Object[] {xe});
|
insLog.fine("Configure notify {0}", xe);
|
||||||
|
|
||||||
// XXX: should really only consider synthetic events, but
|
// XXX: should really only consider synthetic events, but
|
||||||
if (isReparented()) {
|
if (isReparented()) {
|
||||||
@ -677,9 +677,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
* it!!!! or we wind up in a bogus location.
|
* it!!!! or we wind up in a bogus location.
|
||||||
*/
|
*/
|
||||||
int runningWM = XWM.getWMID();
|
int runningWM = XWM.getWMID();
|
||||||
if (insLog.isLoggable(Level.FINE)) {
|
if (insLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
insLog.log(Level.FINE, "reparented={0}, visible={1}, WM={2}, decorations={3}",
|
insLog.fine("reparented={0}, visible={1}, WM={2}, decorations={3}",
|
||||||
new Object[] {isReparented(), isVisible(), runningWM, getDecorations()});
|
isReparented(), isVisible(), runningWM, getDecorations());
|
||||||
}
|
}
|
||||||
if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
|
if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
|
||||||
&& !XWM.isNonReparentingWM()
|
&& !XWM.isNonReparentingWM()
|
||||||
@ -691,7 +691,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
|
if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
|
||||||
long parent = XlibUtil.getParentWindow(window);
|
long parent = XlibUtil.getParentWindow(window);
|
||||||
Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
|
Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
|
||||||
if (insLog.isLoggable(Level.FINER)) {
|
if (insLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
if (correctWM != null) {
|
if (correctWM != null) {
|
||||||
insLog.finer("Configure notify - insets : " + correctWM);
|
insLog.finer("Configure notify - insets : " + correctWM);
|
||||||
} else {
|
} else {
|
||||||
@ -732,7 +732,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
case XWM.SAWFISH_WM:
|
case XWM.SAWFISH_WM:
|
||||||
{
|
{
|
||||||
Point xlocation = queryXLocation();
|
Point xlocation = queryXLocation();
|
||||||
if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "New X location: {0}", new Object[]{xlocation});
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation);
|
||||||
if (xlocation != null) {
|
if (xlocation != null) {
|
||||||
newLocation = xlocation;
|
newLocation = xlocation;
|
||||||
}
|
}
|
||||||
@ -749,8 +749,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
copy(currentInsets),
|
copy(currentInsets),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
insLog.log(Level.FINER, "Insets are {0}, new dimensions {1}",
|
insLog.finer("Insets are {0}, new dimensions {1}",
|
||||||
new Object[] {currentInsets, newDimensions});
|
currentInsets, newDimensions);
|
||||||
|
|
||||||
checkIfOnNewScreen(newDimensions.getBounds());
|
checkIfOnNewScreen(newDimensions.getBounds());
|
||||||
|
|
||||||
@ -789,8 +789,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setShellBounds(Rectangle rec) {
|
public void setShellBounds(Rectangle rec) {
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell bounds on " +
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell bounds on " +
|
||||||
this + " to " + rec);
|
this + " to " + rec);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
||||||
@ -802,8 +802,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void setShellSize(Rectangle rec) {
|
public void setShellSize(Rectangle rec) {
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell size on " +
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell size on " +
|
||||||
this + " to " + rec);
|
this + " to " + rec);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
||||||
@ -814,8 +814,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void setShellPosition(Rectangle rec) {
|
public void setShellPosition(Rectangle rec) {
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell position on " +
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell position on " +
|
||||||
this + " to " + rec);
|
this + " to " + rec);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
||||||
@ -915,9 +915,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
return toGlobal(0,0);
|
return toGlobal(0,0);
|
||||||
} else {
|
} else {
|
||||||
Point location = target.getLocation();
|
Point location = target.getLocation();
|
||||||
if (insLog.isLoggable(Level.FINE))
|
if (insLog.isLoggable(PlatformLogger.FINE))
|
||||||
insLog.log(Level.FINE, "getLocationOnScreen {0} not reparented: {1} ",
|
insLog.fine("getLocationOnScreen {0} not reparented: {1} ",
|
||||||
new Object[] {this, location});
|
this, location);
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@ -954,7 +954,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setVisible(boolean vis) {
|
public void setVisible(boolean vis) {
|
||||||
log.log(Level.FINER, "Setting {0} to visible {1}", new Object[] {this, Boolean.valueOf(vis)});
|
log.finer("Setting {0} to visible {1}", this, Boolean.valueOf(vis));
|
||||||
if (vis && !isVisible()) {
|
if (vis && !isVisible()) {
|
||||||
XWM.setShellDecor(this);
|
XWM.setShellDecor(this);
|
||||||
super.setVisible(vis);
|
super.setVisible(vis);
|
||||||
@ -1005,7 +1005,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleWmTakeFocus(XClientMessageEvent cl) {
|
private void handleWmTakeFocus(XClientMessageEvent cl) {
|
||||||
focusLog.log(Level.FINE, "WM_TAKE_FOCUS on {0}", new Object[]{this});
|
focusLog.fine("WM_TAKE_FOCUS on {0}", this);
|
||||||
requestWindowFocus(cl.get_data(1), true);
|
requestWindowFocus(cl.get_data(1), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1018,9 +1018,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
// by "proxy" - invisible mapped window. When we want to set X input focus to
|
// by "proxy" - invisible mapped window. When we want to set X input focus to
|
||||||
// toplevel set it on proxy instead.
|
// toplevel set it on proxy instead.
|
||||||
if (focusProxy == null) {
|
if (focusProxy == null) {
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.warning("Focus proxy is null for " + this);
|
if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.warning("Focus proxy is null for " + this);
|
||||||
} else {
|
} else {
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Requesting focus to proxy: " + focusProxy);
|
if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Requesting focus to proxy: " + focusProxy);
|
||||||
if (timeProvided) {
|
if (timeProvided) {
|
||||||
focusProxy.xRequestFocus(time);
|
focusProxy.xRequestFocus(time);
|
||||||
} else {
|
} else {
|
||||||
@ -1111,9 +1111,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
|||||||
Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
|
Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
|
||||||
Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
|
Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
|
||||||
|
|
||||||
focusLog.log(Level.FINER, "Current window is: active={0}, focused={1}",
|
focusLog.finer("Current window is: active={0}, focused={1}",
|
||||||
new Object[]{ Boolean.valueOf(target == activeWindow),
|
Boolean.valueOf(target == activeWindow),
|
||||||
Boolean.valueOf(target == focusedWindow)});
|
Boolean.valueOf(target == focusedWindow));
|
||||||
|
|
||||||
XWindowPeer toFocus = this;
|
XWindowPeer toFocus = this;
|
||||||
while (toFocus.nextTransientFor != null) {
|
while (toFocus.nextTransientFor != null) {
|
||||||
|
@ -32,7 +32,7 @@ import java.awt.dnd.InvalidDnDOperationException;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ import sun.misc.Unsafe;
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
|
||||||
|
|
||||||
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" sourceWindow=" + sourceWindow +
|
logger.finest(" sourceWindow=" + sourceWindow +
|
||||||
" get_window=" + xclient.get_window() +
|
" get_window=" + xclient.get_window() +
|
||||||
" xclient=" + xclient);
|
" xclient=" + xclient);
|
||||||
|
@ -33,7 +33,7 @@ import java.awt.event.MouseEvent;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
@ -43,8 +43,8 @@ import sun.misc.Unsafe;
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDropTargetProtocol");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDropTargetProtocol");
|
||||||
|
|
||||||
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
||||||
|
|
||||||
@ -999,7 +999,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
if (sourceFormats != null && sourceFormats.length > 3) {
|
if (sourceFormats != null && sourceFormats.length > 3) {
|
||||||
data1 |= XDnDConstants.XDND_DATA_TYPES_BIT;
|
data1 |= XDnDConstants.XDND_DATA_TYPES_BIT;
|
||||||
}
|
}
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" "
|
logger.finest(" "
|
||||||
+ " entryVersion=" + version
|
+ " entryVersion=" + version
|
||||||
+ " sourceProtocolVersion=" +
|
+ " sourceProtocolVersion=" +
|
||||||
@ -1058,7 +1058,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
|
|
||||||
public boolean forwardEventToEmbedded(long embedded, long ctxt,
|
public boolean forwardEventToEmbedded(long embedded, long ctxt,
|
||||||
int eventID) {
|
int eventID) {
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" ctxt=" + ctxt +
|
logger.finest(" ctxt=" + ctxt +
|
||||||
" type=" + (ctxt != 0 ?
|
" type=" + (ctxt != 0 ?
|
||||||
getMessageType(new
|
getMessageType(new
|
||||||
@ -1086,7 +1086,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
long data3 = Native.getLong(ctxt + size + 2 * Native.getLongSize());
|
long data3 = Native.getLong(ctxt + size + 2 * Native.getLongSize());
|
||||||
long data4 = Native.getLong(ctxt + size + 3 * Native.getLongSize());
|
long data4 = Native.getLong(ctxt + size + 3 * Native.getLongSize());
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" 1 "
|
logger.finest(" 1 "
|
||||||
+ " embedded=" + embedded
|
+ " embedded=" + embedded
|
||||||
+ " source=" + xclient.get_data(0)
|
+ " source=" + xclient.get_data(0)
|
||||||
@ -1120,7 +1120,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
|
|
||||||
if (XToolkit.saved_error != null &&
|
if (XToolkit.saved_error != null &&
|
||||||
XToolkit.saved_error.get_error_code() != XConstants.Success) {
|
XToolkit.saved_error.get_error_code() != XConstants.Success) {
|
||||||
if (logger.isLoggable(Level.WARNING)) {
|
if (logger.isLoggable(PlatformLogger.WARNING)) {
|
||||||
logger.warning("Cannot set XdndTypeList on the proxy window");
|
logger.warning("Cannot set XdndTypeList on the proxy window");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1128,7 +1128,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (logger.isLoggable(Level.WARNING)) {
|
if (logger.isLoggable(PlatformLogger.WARNING)) {
|
||||||
logger.warning("Cannot read XdndTypeList from the source window");
|
logger.warning("Cannot read XdndTypeList from the source window");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1143,7 +1143,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
|||||||
overXEmbedClient = true;
|
overXEmbedClient = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" 2 "
|
logger.finest(" 2 "
|
||||||
+ " embedded=" + embedded
|
+ " embedded=" + embedded
|
||||||
+ " xclient=" + xclient);
|
+ " xclient=" + xclient);
|
||||||
|
@ -37,7 +37,8 @@ import java.awt.dnd.InvalidDnDOperationException;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
|
|
||||||
import sun.awt.dnd.SunDragSourceContextPeer;
|
import sun.awt.dnd.SunDragSourceContextPeer;
|
||||||
@ -52,8 +53,8 @@ import sun.awt.SunToolkit;
|
|||||||
*/
|
*/
|
||||||
public final class XDragSourceContextPeer
|
public final class XDragSourceContextPeer
|
||||||
extends SunDragSourceContextPeer implements XDragSourceProtocolListener {
|
extends SunDragSourceContextPeer implements XDragSourceProtocolListener {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
|
||||||
|
|
||||||
/* The events selected on the root window when the drag begins. */
|
/* The events selected on the root window when the drag begins. */
|
||||||
private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
|
private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
|
||||||
@ -542,7 +543,7 @@ public final class XDragSourceContextPeer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.finest(" proxyModeSourceWindow=" +
|
logger.finest(" proxyModeSourceWindow=" +
|
||||||
getProxyModeSourceWindow() +
|
getProxyModeSourceWindow() +
|
||||||
" ev=" + ev);
|
" ev=" + ev);
|
||||||
|
@ -31,7 +31,8 @@ import java.awt.peer.ComponentPeer;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.logging.*;
|
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
@ -48,8 +49,8 @@ import sun.misc.Unsafe;
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetContextPeer");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetContextPeer");
|
||||||
|
|
||||||
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
||||||
|
|
||||||
@ -198,7 +199,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
|||||||
structure. */
|
structure. */
|
||||||
long ctxt = getNativeDragContext();
|
long ctxt = getNativeDragContext();
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINER)) {
|
if (logger.isLoggable(PlatformLogger.FINER)) {
|
||||||
logger.finer(" processing " + event + " ctxt=" + ctxt +
|
logger.finer(" processing " + event + " ctxt=" + ctxt +
|
||||||
" consumed=" + event.isConsumed());
|
" consumed=" + event.isConsumed());
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract class for drop protocols on X11 systems.
|
* An abstract class for drop protocols on X11 systems.
|
||||||
@ -38,8 +38,8 @@ import java.util.logging.*;
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
abstract class XDropTargetProtocol {
|
abstract class XDropTargetProtocol {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetProtocol");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetProtocol");
|
||||||
|
|
||||||
private final XDropTargetProtocolListener listener;
|
private final XDropTargetProtocolListener listener;
|
||||||
|
|
||||||
@ -116,16 +116,16 @@ abstract class XDropTargetProtocol {
|
|||||||
XClientMessageEvent xclient) {
|
XClientMessageEvent xclient) {
|
||||||
EmbedderRegistryEntry entry = getEmbedderRegistryEntry(toplevel);
|
EmbedderRegistryEntry entry = getEmbedderRegistryEntry(toplevel);
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.log(Level.FINEST, " entry={0}", new Object[] {entry});
|
logger.finest(" entry={0}", entry);
|
||||||
}
|
}
|
||||||
// Window not registered as an embedder for this protocol.
|
// Window not registered as an embedder for this protocol.
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.log(Level.FINEST, " entry.isOverriden()={0}", new Object[] {entry.isOverriden()});
|
logger.finest(" entry.isOverriden()={0}", entry.isOverriden());
|
||||||
}
|
}
|
||||||
// Window didn't have an associated drop site, so there is no need
|
// Window didn't have an associated drop site, so there is no need
|
||||||
// to forward the message.
|
// to forward the message.
|
||||||
@ -137,8 +137,8 @@ abstract class XDropTargetProtocol {
|
|||||||
|
|
||||||
long proxy = entry.getProxy();
|
long proxy = entry.getProxy();
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINEST)) {
|
if (logger.isLoggable(PlatformLogger.FINEST)) {
|
||||||
logger.log(Level.FINEST, " proxy={0} toplevel={1}", new Object[] {proxy, toplevel});
|
logger.finest(" proxy={0} toplevel={1}", proxy, toplevel);
|
||||||
}
|
}
|
||||||
if (proxy == 0) {
|
if (proxy == 0) {
|
||||||
proxy = toplevel;
|
proxy = toplevel;
|
||||||
|
@ -31,7 +31,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ import java.awt.Point;
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
final class XDropTargetRegistry {
|
final class XDropTargetRegistry {
|
||||||
private static final Logger logger =
|
private static final PlatformLogger logger =
|
||||||
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetRegistry");
|
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetRegistry");
|
||||||
|
|
||||||
private static final long DELAYED_REGISTRATION_PERIOD = 200;
|
private static final long DELAYED_REGISTRATION_PERIOD = 200;
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ final class XDropTargetRegistry {
|
|||||||
if (info != null &&
|
if (info != null &&
|
||||||
info.getProtocolVersion() >= XDnDConstants.XDND_MIN_PROTOCOL_VERSION) {
|
info.getProtocolVersion() >= XDnDConstants.XDND_MIN_PROTOCOL_VERSION) {
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (logger.isLoggable(PlatformLogger.FINE)) {
|
||||||
logger.fine(" XEmbed drop site will be registered for " + Long.toHexString(clientWindow));
|
logger.fine(" XEmbed drop site will be registered for " + Long.toHexString(clientWindow));
|
||||||
}
|
}
|
||||||
registerEmbeddedDropSite(canvasWindow, clientWindow);
|
registerEmbeddedDropSite(canvasWindow, clientWindow);
|
||||||
@ -628,14 +628,14 @@ final class XDropTargetRegistry {
|
|||||||
dropTargetProtocol.registerEmbeddedDropSite(clientWindow);
|
dropTargetProtocol.registerEmbeddedDropSite(clientWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (logger.isLoggable(PlatformLogger.FINE)) {
|
||||||
logger.fine(" XEmbed drop site has been registered for " + Long.toHexString(clientWindow));
|
logger.fine(" XEmbed drop site has been registered for " + Long.toHexString(clientWindow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unregisterXEmbedClient(long canvasWindow, long clientWindow) {
|
public void unregisterXEmbedClient(long canvasWindow, long clientWindow) {
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (logger.isLoggable(PlatformLogger.FINE)) {
|
||||||
logger.fine(" XEmbed drop site will be unregistered for " + Long.toHexString(clientWindow));
|
logger.fine(" XEmbed drop site will be unregistered for " + Long.toHexString(clientWindow));
|
||||||
}
|
}
|
||||||
Iterator dropTargetProtocols =
|
Iterator dropTargetProtocols =
|
||||||
@ -649,7 +649,7 @@ final class XDropTargetRegistry {
|
|||||||
|
|
||||||
unregisterEmbeddedDropSite(canvasWindow, clientWindow);
|
unregisterEmbeddedDropSite(canvasWindow, clientWindow);
|
||||||
|
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (logger.isLoggable(PlatformLogger.FINE)) {
|
||||||
logger.fine(" XEmbed drop site has beed unregistered for " + Long.toHexString(clientWindow));
|
logger.fine(" XEmbed drop site has beed unregistered for " + Long.toHexString(clientWindow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ import java.awt.peer.*;
|
|||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
import sun.awt.motif.X11FontMetrics;
|
import sun.awt.motif.X11FontMetrics;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import static sun.awt.X11.XEmbedHelper.*;
|
import static sun.awt.X11.XEmbedHelper.*;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ import java.security.AccessController;
|
|||||||
import sun.security.action.GetBooleanAction;
|
import sun.security.action.GetBooleanAction;
|
||||||
|
|
||||||
public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener, KeyEventPostProcessor, ModalityListener, WindowIDProvider {
|
public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener, KeyEventPostProcessor, ModalityListener, WindowIDProvider {
|
||||||
private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed.XEmbedCanvasPeer");
|
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedCanvasPeer");
|
||||||
|
|
||||||
boolean applicationActive; // Whether the application is active(has focus)
|
boolean applicationActive; // Whether the application is active(has focus)
|
||||||
XEmbedServer xembed = new XEmbedServer(); // Helper object, contains XEmbed intrinsics
|
XEmbedServer xembed = new XEmbedServer(); // Helper object, contains XEmbed intrinsics
|
||||||
@ -129,7 +129,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initDispatching() {
|
void initDispatching() {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle));
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XToolkit.addEventDispatcher(xembed.handle, xembed);
|
XToolkit.addEventDispatcher(xembed.handle, xembed);
|
||||||
@ -196,10 +196,10 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
switch (ev.get_type()) {
|
switch (ev.get_type()) {
|
||||||
case XConstants.CreateNotify:
|
case XConstants.CreateNotify:
|
||||||
XCreateWindowEvent cr = ev.get_xcreatewindow();
|
XCreateWindowEvent cr = ev.get_xcreatewindow();
|
||||||
if (xembedLog.isLoggable(Level.FINEST)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
xembedLog.finest("Message on embedder: " + cr);
|
xembedLog.finest("Message on embedder: " + cr);
|
||||||
}
|
}
|
||||||
if (xembedLog.isLoggable(Level.FINER)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
xembedLog.finer("Create notify for parent " + Long.toHexString(cr.get_parent()) +
|
xembedLog.finer("Create notify for parent " + Long.toHexString(cr.get_parent()) +
|
||||||
", window " + Long.toHexString(cr.get_window()));
|
", window " + Long.toHexString(cr.get_window()));
|
||||||
}
|
}
|
||||||
@ -207,20 +207,20 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
break;
|
break;
|
||||||
case XConstants.DestroyNotify:
|
case XConstants.DestroyNotify:
|
||||||
XDestroyWindowEvent dn = ev.get_xdestroywindow();
|
XDestroyWindowEvent dn = ev.get_xdestroywindow();
|
||||||
if (xembedLog.isLoggable(Level.FINEST)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
xembedLog.finest("Message on embedder: " + dn);
|
xembedLog.finest("Message on embedder: " + dn);
|
||||||
}
|
}
|
||||||
if (xembedLog.isLoggable(Level.FINER)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
xembedLog.finer("Destroy notify for parent: " + dn);
|
xembedLog.finer("Destroy notify for parent: " + dn);
|
||||||
}
|
}
|
||||||
childDestroyed();
|
childDestroyed();
|
||||||
break;
|
break;
|
||||||
case XConstants.ReparentNotify:
|
case XConstants.ReparentNotify:
|
||||||
XReparentEvent rep = ev.get_xreparent();
|
XReparentEvent rep = ev.get_xreparent();
|
||||||
if (xembedLog.isLoggable(Level.FINEST)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
xembedLog.finest("Message on embedder: " + rep);
|
xembedLog.finest("Message on embedder: " + rep);
|
||||||
}
|
}
|
||||||
if (xembedLog.isLoggable(Level.FINER)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
xembedLog.finer("Reparent notify for parent " + Long.toHexString(rep.get_parent()) +
|
xembedLog.finer("Reparent notify for parent " + Long.toHexString(rep.get_parent()) +
|
||||||
", window " + Long.toHexString(rep.get_window()) +
|
", window " + Long.toHexString(rep.get_window()) +
|
||||||
", event " + Long.toHexString(rep.get_event()));
|
", event " + Long.toHexString(rep.get_event()));
|
||||||
@ -323,7 +323,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
void childResized() {
|
void childResized() {
|
||||||
if (xembedLog.isLoggable(Level.FINER)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
Rectangle bounds = getClientBounds();
|
Rectangle bounds = getClientBounds();
|
||||||
xembedLog.finer("Child resized: " + bounds);
|
xembedLog.finer("Child resized: " + bounds);
|
||||||
// It is not required to update embedder's size when client size changes
|
// It is not required to update embedder's size when client size changes
|
||||||
@ -388,7 +388,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
void detachChild() {
|
void detachChild() {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle));
|
||||||
/**
|
/**
|
||||||
* XEmbed specification:
|
* XEmbed specification:
|
||||||
* "The embedder can unmap the client and reparent the client window to the root window. If the
|
* "The embedder can unmap the client and reparent the client window to the root window. If the
|
||||||
@ -477,7 +477,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
try {
|
try {
|
||||||
XKeyEvent ke = new XKeyEvent(data);
|
XKeyEvent ke = new XKeyEvent(data);
|
||||||
ke.set_window(xembed.handle);
|
ke.set_window(xembed.handle);
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
|
XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
|
||||||
@ -508,7 +508,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
postEvent(new InvocationEvent(target, new Runnable() {
|
postEvent(new InvocationEvent(target, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
GrabbedKey grab = new GrabbedKey(keysym, modifiers);
|
GrabbedKey grab = new GrabbedKey(keysym, modifiers);
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Grabbing key: " + grab);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Grabbing key: " + grab);
|
||||||
synchronized(GRAB_LOCK) {
|
synchronized(GRAB_LOCK) {
|
||||||
grabbed_keys.add(grab);
|
grabbed_keys.add(grab);
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
postEvent(new InvocationEvent(target, new Runnable() {
|
postEvent(new InvocationEvent(target, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
GrabbedKey grab = new GrabbedKey(keysym, modifiers);
|
GrabbedKey grab = new GrabbedKey(keysym, modifiers);
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("UnGrabbing key: " + grab);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("UnGrabbing key: " + grab);
|
||||||
synchronized(GRAB_LOCK) {
|
synchronized(GRAB_LOCK) {
|
||||||
grabbed_keys.remove(grab);
|
grabbed_keys.remove(grab);
|
||||||
}
|
}
|
||||||
@ -533,7 +533,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
public void run() {
|
public void run() {
|
||||||
AWTKeyStroke stroke = xembed.getKeyStrokeForKeySym(keysym, modifiers);
|
AWTKeyStroke stroke = xembed.getKeyStrokeForKeySym(keysym, modifiers);
|
||||||
if (stroke != null) {
|
if (stroke != null) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Registering accelerator " + accel_id + " for " + stroke);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Registering accelerator " + accel_id + " for " + stroke);
|
||||||
synchronized(ACCEL_LOCK) {
|
synchronized(ACCEL_LOCK) {
|
||||||
accelerators.put(accel_id, stroke);
|
accelerators.put(accel_id, stroke);
|
||||||
accel_lookup.put(stroke, accel_id);
|
accel_lookup.put(stroke, accel_id);
|
||||||
@ -551,7 +551,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
synchronized(ACCEL_LOCK) {
|
synchronized(ACCEL_LOCK) {
|
||||||
stroke = accelerators.get(accel_id);
|
stroke = accelerators.get(accel_id);
|
||||||
if (stroke != null) {
|
if (stroke != null) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Unregistering accelerator: " + accel_id);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Unregistering accelerator: " + accel_id);
|
||||||
accelerators.remove(accel_id);
|
accelerators.remove(accel_id);
|
||||||
accel_lookup.remove(stroke); // FIXME: How about several accelerators with the same stroke?
|
accel_lookup.remove(stroke); // FIXME: How about several accelerators with the same stroke?
|
||||||
}
|
}
|
||||||
@ -597,7 +597,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
|
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Post-processing event " + e);
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Post-processing event " + e);
|
||||||
|
|
||||||
// Process ACCELERATORS
|
// Process ACCELERATORS
|
||||||
AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
|
AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
|
||||||
@ -610,7 +610,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (exists) {
|
if (exists) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Activating accelerator " + accel_id);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Activating accelerator " + accel_id);
|
||||||
xembed.sendMessage(xembed.handle, XEMBED_ACTIVATE_ACCELERATOR, accel_id, 0, 0); // FIXME: How about overloaded?
|
xembed.sendMessage(xembed.handle, XEMBED_ACTIVATE_ACCELERATOR, accel_id, 0, 0); // FIXME: How about overloaded?
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
@ -622,7 +622,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
exists = grabbed_keys.contains(key);
|
exists = grabbed_keys.contains(key);
|
||||||
}
|
}
|
||||||
if (exists) {
|
if (exists) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Forwarding grabbed key " + e);
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Forwarding grabbed key " + e);
|
||||||
forwardKeyEvent(e);
|
forwardKeyEvent(e);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
@ -641,9 +641,9 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
public void handleClientMessage(XEvent xev) {
|
public void handleClientMessage(XEvent xev) {
|
||||||
super.handleClientMessage(xev);
|
super.handleClientMessage(xev);
|
||||||
XClientMessageEvent msg = xev.get_xclient();
|
XClientMessageEvent msg = xev.get_xclient();
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Client message to embedder: " + msg);
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Client message to embedder: " + msg);
|
||||||
if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
|
if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine(xembed.XEmbedMessageToString(msg));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine(xembed.XEmbedMessageToString(msg));
|
||||||
}
|
}
|
||||||
if (isXEmbedActive()) {
|
if (isXEmbedActive()) {
|
||||||
switch ((int)msg.get_data(1)) {
|
switch ((int)msg.get_data(1)) {
|
||||||
@ -709,7 +709,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean processXEmbedDnDEvent(long ctxt, int eventID) {
|
public boolean processXEmbedDnDEvent(long ctxt, int eventID) {
|
||||||
if (xembedLog.isLoggable(Level.FINEST)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
xembedLog.finest(" Drop target=" + target.getDropTarget());
|
xembedLog.finest(" Drop target=" + target.getDropTarget());
|
||||||
}
|
}
|
||||||
if (target.getDropTarget() instanceof XEmbedDropTarget) {
|
if (target.getDropTarget() instanceof XEmbedDropTarget) {
|
||||||
@ -744,7 +744,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
|
boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
|
||||||
boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
|
boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
|
||||||
if (new_mapped != currently_mapped) {
|
if (new_mapped != currently_mapped) {
|
||||||
if (xembedLog.isLoggable(Level.FINER))
|
if (xembedLog.isLoggable(PlatformLogger.FINER))
|
||||||
xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
|
xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
|
||||||
if (new_mapped) {
|
if (new_mapped) {
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
@ -773,7 +773,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
public void handlePropertyNotify(XEvent xev) {
|
public void handlePropertyNotify(XEvent xev) {
|
||||||
if (isXEmbedActive()) {
|
if (isXEmbedActive()) {
|
||||||
XPropertyEvent ev = xev.get_xproperty();
|
XPropertyEvent ev = xev.get_xproperty();
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Property change on client: " + ev);
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Property change on client: " + ev);
|
||||||
if (ev.get_atom() == XAtom.XA_WM_NORMAL_HINTS) {
|
if (ev.get_atom() == XAtom.XA_WM_NORMAL_HINTS) {
|
||||||
childResized();
|
childResized();
|
||||||
} else if (ev.get_atom() == XEmbedInfo.getAtom()) {
|
} else if (ev.get_atom() == XEmbedInfo.getAtom()) {
|
||||||
@ -794,7 +794,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
void handleConfigureNotify(XEvent xev) {
|
void handleConfigureNotify(XEvent xev) {
|
||||||
if (isXEmbedActive()) {
|
if (isXEmbedActive()) {
|
||||||
XConfigureEvent ev = xev.get_xconfigure();
|
XConfigureEvent ev = xev.get_xconfigure();
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Bounds change on client: " + ev);
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Bounds change on client: " + ev);
|
||||||
if (xev.get_xany().get_window() == handle) {
|
if (xev.get_xany().get_window() == handle) {
|
||||||
childResized();
|
childResized();
|
||||||
}
|
}
|
||||||
@ -845,7 +845,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
|||||||
|
|
||||||
// We recognize only these masks
|
// We recognize only these masks
|
||||||
modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
|
modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
|
||||||
if (xembedLog.isLoggable(Level.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
|
if (xembedLog.isLoggable(PlatformLogger.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
|
||||||
} finally {
|
} finally {
|
||||||
XlibWrapper.unsafe.freeMemory(data);
|
XlibWrapper.unsafe.freeMemory(data);
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.awt.AWTKeyStroke;
|
import java.awt.AWTKeyStroke;
|
||||||
import java.util.logging.*;
|
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.X11GraphicsConfig;
|
import sun.awt.X11GraphicsConfig;
|
||||||
import sun.awt.X11GraphicsDevice;
|
import sun.awt.X11GraphicsDevice;
|
||||||
@ -40,7 +40,7 @@ import sun.awt.X11GraphicsDevice;
|
|||||||
* call install and forward all XClientMessageEvents to it.
|
* call install and forward all XClientMessageEvents to it.
|
||||||
*/
|
*/
|
||||||
public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher {
|
public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher {
|
||||||
private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed.XEmbedClientHelper");
|
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedClientHelper");
|
||||||
|
|
||||||
private XEmbeddedFramePeer embedded; // XEmbed client
|
private XEmbeddedFramePeer embedded; // XEmbed client
|
||||||
private long server; // XEmbed server
|
private long server; // XEmbed server
|
||||||
@ -53,7 +53,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setClient(XEmbeddedFramePeer client) {
|
void setClient(XEmbeddedFramePeer client) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
xembedLog.fine("XEmbed client: " + client);
|
xembedLog.fine("XEmbed client: " + client);
|
||||||
}
|
}
|
||||||
if (embedded != null) {
|
if (embedded != null) {
|
||||||
@ -67,7 +67,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
void install() {
|
void install() {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
xembedLog.fine("Installing xembedder on " + embedded);
|
xembedLog.fine("Installing xembedder on " + embedded);
|
||||||
}
|
}
|
||||||
long[] info = new long[] { XEMBED_VERSION, XEMBED_MAPPED };
|
long[] info = new long[] { XEMBED_VERSION, XEMBED_MAPPED };
|
||||||
@ -95,9 +95,9 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
|
|||||||
|
|
||||||
void handleClientMessage(XEvent xev) {
|
void handleClientMessage(XEvent xev) {
|
||||||
XClientMessageEvent msg = xev.get_xclient();
|
XClientMessageEvent msg = xev.get_xclient();
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine(msg.toString());
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine(msg.toString());
|
||||||
if (msg.get_message_type() == XEmbed.getAtom()) {
|
if (msg.get_message_type() == XEmbed.getAtom()) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Embedded message: " + msgidToString((int)msg.get_data(1)));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Embedded message: " + msgidToString((int)msg.get_data(1)));
|
||||||
switch ((int)msg.get_data(1)) {
|
switch ((int)msg.get_data(1)) {
|
||||||
case XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
|
case XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
|
||||||
active = true;
|
active = true;
|
||||||
|
@ -27,7 +27,8 @@ package sun.awt.X11;
|
|||||||
|
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import java.awt.AWTKeyStroke;
|
import java.awt.AWTKeyStroke;
|
||||||
import java.awt.event.InputEvent;
|
import java.awt.event.InputEvent;
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ import java.awt.event.InputEvent;
|
|||||||
* Contains constant definitions and helper routines.
|
* Contains constant definitions and helper routines.
|
||||||
*/
|
*/
|
||||||
public class XEmbedHelper {
|
public class XEmbedHelper {
|
||||||
private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed");
|
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed");
|
||||||
final static Unsafe unsafe = Unsafe.getUnsafe();
|
final static Unsafe unsafe = Unsafe.getUnsafe();
|
||||||
|
|
||||||
final static int XEMBED_VERSION = 0,
|
final static int XEMBED_VERSION = 0,
|
||||||
@ -81,11 +82,11 @@ public class XEmbedHelper {
|
|||||||
XEmbedHelper() {
|
XEmbedHelper() {
|
||||||
if (XEmbed == null) {
|
if (XEmbed == null) {
|
||||||
XEmbed = XAtom.get("_XEMBED");
|
XEmbed = XAtom.get("_XEMBED");
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Created atom " + XEmbed.toString());
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Created atom " + XEmbed.toString());
|
||||||
}
|
}
|
||||||
if (XEmbedInfo == null) {
|
if (XEmbedInfo == null) {
|
||||||
XEmbedInfo = XAtom.get("_XEMBED_INFO");
|
XEmbedInfo = XAtom.get("_XEMBED_INFO");
|
||||||
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Created atom " + XEmbedInfo.toString());
|
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Created atom " + XEmbedInfo.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ public class XEmbedHelper {
|
|||||||
msg.set_data(4, data2);
|
msg.set_data(4, data2);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
|
||||||
XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
|
XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
@ -28,7 +28,7 @@ package sun.awt.X11;
|
|||||||
//import static sun.awt.X11.XEmbed.*;
|
//import static sun.awt.X11.XEmbed.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import static sun.awt.X11.XConstants.*;
|
import static sun.awt.X11.XConstants.*;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ import java.util.LinkedList;
|
|||||||
* specification and references.
|
* specification and references.
|
||||||
*/
|
*/
|
||||||
public class XEmbedServerTester implements XEventDispatcher {
|
public class XEmbedServerTester implements XEventDispatcher {
|
||||||
private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed.XEmbedServerTester");
|
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedServerTester");
|
||||||
private final Object EVENT_LOCK = new Object();
|
private final Object EVENT_LOCK = new Object();
|
||||||
static final int SYSTEM_EVENT_MASK = 0x8000;
|
static final int SYSTEM_EVENT_MASK = 0x8000;
|
||||||
int my_version, server_version;
|
int my_version, server_version;
|
||||||
@ -544,7 +544,7 @@ public class XEmbedServerTester implements XEventDispatcher {
|
|||||||
try {
|
try {
|
||||||
EVENT_LOCK.wait(3000);
|
EVENT_LOCK.wait(3000);
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
xembedLog.log(Level.WARNING, "Event wait interrupted", ie);
|
xembedLog.warning("Event wait interrupted", ie);
|
||||||
}
|
}
|
||||||
eventWaited = -1;
|
eventWaited = -1;
|
||||||
if (checkEventList(position, event) == -1) {
|
if (checkEventList(position, event) == -1) {
|
||||||
@ -634,7 +634,7 @@ public class XEmbedServerTester implements XEventDispatcher {
|
|||||||
if (ev.get_type() == ClientMessage) {
|
if (ev.get_type() == ClientMessage) {
|
||||||
XClientMessageEvent msg = ev.get_xclient();
|
XClientMessageEvent msg = ev.get_xclient();
|
||||||
if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
|
if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
|
||||||
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1)));
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1)));
|
||||||
switch ((int)msg.get_data(1)) {
|
switch ((int)msg.get_data(1)) {
|
||||||
case XEmbedHelper.XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
|
case XEmbedHelper.XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
|
||||||
xembedActive = true;
|
xembedActive = true;
|
||||||
|
@ -30,15 +30,14 @@ import java.awt.*;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.EmbeddedFrame;
|
import sun.awt.EmbeddedFrame;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
public class XEmbeddedFramePeer extends XFramePeer {
|
public class XEmbeddedFramePeer extends XFramePeer {
|
||||||
|
|
||||||
private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed.XEmbeddedFramePeer");
|
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbeddedFramePeer");
|
||||||
|
|
||||||
LinkedList<AWTKeyStroke> strokes;
|
LinkedList<AWTKeyStroke> strokes;
|
||||||
|
|
||||||
@ -138,7 +137,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
|||||||
{
|
{
|
||||||
assert (SunToolkit.isAWTLockHeldByCurrentThread());
|
assert (SunToolkit.isAWTLockHeldByCurrentThread());
|
||||||
XConfigureEvent xe = xev.get_xconfigure();
|
XConfigureEvent xe = xev.get_xconfigure();
|
||||||
if (xembedLog.isLoggable(Level.FINE)) {
|
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
xembedLog.fine(xe.toString());
|
xembedLog.fine(xe.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ import java.util.Locale;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import com.sun.java.swing.plaf.motif.*;
|
import com.sun.java.swing.plaf.motif.*;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import java.util.logging.*;
|
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListener, ItemListener, KeyEventDispatcher, XChoicePeerListener {
|
class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListener, ItemListener, KeyEventDispatcher, XChoicePeerListener {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XFileDialogPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XFileDialogPeer");
|
||||||
|
|
||||||
FileDialog target;
|
FileDialog target;
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represent focus holder window implementation. When toplevel requests or receives focus
|
* This class represent focus holder window implementation. When toplevel requests or receives focus
|
||||||
@ -34,7 +33,6 @@ import java.util.logging.*;
|
|||||||
* and therefore X doesn't control focus after we have set it to proxy.
|
* and therefore X doesn't control focus after we have set it to proxy.
|
||||||
*/
|
*/
|
||||||
public class XFocusProxyWindow extends XBaseWindow {
|
public class XFocusProxyWindow extends XBaseWindow {
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XFocusProxyWindow");
|
|
||||||
XWindowPeer owner;
|
XWindowPeer owner;
|
||||||
|
|
||||||
public XFocusProxyWindow(XWindowPeer owner) {
|
public XFocusProxyWindow(XWindowPeer owner) {
|
||||||
|
@ -34,14 +34,13 @@ import java.awt.Insets;
|
|||||||
import java.awt.MenuBar;
|
import java.awt.MenuBar;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.peer.FramePeer;
|
import java.awt.peer.FramePeer;
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import sun.awt.AWTAccessor;
|
import sun.awt.AWTAccessor;
|
||||||
|
|
||||||
class XFramePeer extends XDecoratedPeer implements FramePeer {
|
class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XFramePeer");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XFramePeer");
|
||||||
private static Logger stateLog = Logger.getLogger("sun.awt.X11.states");
|
private static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states");
|
||||||
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XFramePeer");
|
private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XFramePeer");
|
||||||
|
|
||||||
XMenuBarPeer menubarPeer;
|
XMenuBarPeer menubarPeer;
|
||||||
MenuBar menubar;
|
MenuBar menubar;
|
||||||
@ -76,10 +75,10 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
winAttr.isResizable = true; // target.isResizable();
|
winAttr.isResizable = true; // target.isResizable();
|
||||||
winAttr.title = target.getTitle();
|
winAttr.title = target.getTitle();
|
||||||
winAttr.initialResizability = target.isResizable();
|
winAttr.initialResizability = target.isResizable();
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "Frame''s initial attributes: decor {0}, resizable {1}, undecorated {2}, initial state {3}",
|
log.fine("Frame''s initial attributes: decor {0}, resizable {1}, undecorated {2}, initial state {3}",
|
||||||
new Object[] {Integer.valueOf(winAttr.decorations), Boolean.valueOf(winAttr.initialResizability),
|
Integer.valueOf(winAttr.decorations), Boolean.valueOf(winAttr.initialResizability),
|
||||||
Boolean.valueOf(!winAttr.nativeDecor), Integer.valueOf(winAttr.initialState)});
|
Boolean.valueOf(!winAttr.nativeDecor), Integer.valueOf(winAttr.initialState));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +207,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMaximizedBounds(Rectangle b) {
|
public void setMaximizedBounds(Rectangle b) {
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting maximized bounds to " + b);
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting maximized bounds to " + b);
|
||||||
if (b == null) return;
|
if (b == null) return;
|
||||||
maxBounds = new Rectangle(b);
|
maxBounds = new Rectangle(b);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
@ -225,7 +224,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
} else {
|
} else {
|
||||||
hints.set_max_height((int)XlibWrapper.DisplayHeight(XToolkit.getDisplay(), XlibWrapper.DefaultScreen(XToolkit.getDisplay())));
|
hints.set_max_height((int)XlibWrapper.DisplayHeight(XToolkit.getDisplay(), XlibWrapper.DefaultScreen(XToolkit.getDisplay())));
|
||||||
}
|
}
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
|
||||||
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), window, hints.pData);
|
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), window, hints.pData);
|
||||||
} finally {
|
} finally {
|
||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
@ -253,14 +252,14 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
int changed = state ^ newState;
|
int changed = state ^ newState;
|
||||||
int changeIconic = changed & Frame.ICONIFIED;
|
int changeIconic = changed & Frame.ICONIFIED;
|
||||||
boolean iconic = (newState & Frame.ICONIFIED) != 0;
|
boolean iconic = (newState & Frame.ICONIFIED) != 0;
|
||||||
stateLog.log(Level.FINER, "Changing state, old state {0}, new state {1}(iconic {2})",
|
stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})",
|
||||||
new Object[] {Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic)});
|
Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic));
|
||||||
if (changeIconic != 0 && iconic) {
|
if (changeIconic != 0 && iconic) {
|
||||||
if (stateLog.isLoggable(Level.FINER)) stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber());
|
if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber());
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
int res = XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), getShell(), getScreenNumber());
|
int res = XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), getShell(), getScreenNumber());
|
||||||
if (stateLog.isLoggable(Level.FINER)) stateLog.finer("XIconifyWindow returned " + res);
|
if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("XIconifyWindow returned " + res);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
@ -270,7 +269,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
setExtendedState(newState);
|
setExtendedState(newState);
|
||||||
}
|
}
|
||||||
if (changeIconic != 0 && !iconic) {
|
if (changeIconic != 0 && !iconic) {
|
||||||
if (stateLog.isLoggable(Level.FINER)) stateLog.finer("DeIconifying " + this);
|
if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("DeIconifying " + this);
|
||||||
xSetVisible(true);
|
xSetVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,7 +282,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
super.handlePropertyNotify(xev);
|
super.handlePropertyNotify(xev);
|
||||||
XPropertyEvent ev = xev.get_xproperty();
|
XPropertyEvent ev = xev.get_xproperty();
|
||||||
|
|
||||||
log.log(Level.FINER, "Property change {0}", new Object[] {ev});
|
log.finer("Property change {0}", ev);
|
||||||
/*
|
/*
|
||||||
* Let's see if this is a window state protocol message, and
|
* Let's see if this is a window state protocol message, and
|
||||||
* if it is - decode a new state in terms of java constants.
|
* if it is - decode a new state in terms of java constants.
|
||||||
@ -348,7 +347,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
|||||||
XWMHints hints = getWMHints();
|
XWMHints hints = getWMHints();
|
||||||
hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
|
hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
|
||||||
hints.set_initial_state(wm_state);
|
hints.set_initial_state(wm_state);
|
||||||
if (stateLog.isLoggable(Level.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
|
if (stateLog.isLoggable(PlatformLogger.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
|
||||||
XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
|
XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
@ -30,10 +30,10 @@ import sun.awt.X11GraphicsConfig;
|
|||||||
import sun.awt.image.ToolkitImage;
|
import sun.awt.image.ToolkitImage;
|
||||||
import sun.awt.image.ImageRepresentation;
|
import sun.awt.image.ImageRepresentation;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class XIconWindow extends XBaseWindow {
|
public class XIconWindow extends XBaseWindow {
|
||||||
private final static Logger log = Logger.getLogger("sun.awt.X11.XIconWindow");
|
private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XIconWindow");
|
||||||
XDecoratedPeer parent;
|
XDecoratedPeer parent;
|
||||||
Dimension size;
|
Dimension size;
|
||||||
long iconPixmap = 0;
|
long iconPixmap = 0;
|
||||||
@ -61,7 +61,7 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
final long screen = adata.get_awt_visInfo().get_screen();
|
final long screen = adata.get_awt_visInfo().get_screen();
|
||||||
final long display = XToolkit.getDisplay();
|
final long display = XToolkit.getDisplay();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest(adata.toString());
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest(adata.toString());
|
||||||
|
|
||||||
long status =
|
long status =
|
||||||
XlibWrapper.XGetIconSizes(display, XToolkit.getDefaultRootWindow(),
|
XlibWrapper.XGetIconSizes(display, XToolkit.getDefaultRootWindow(),
|
||||||
@ -71,11 +71,11 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
}
|
}
|
||||||
int count = Native.getInt(XlibWrapper.iarg1);
|
int count = Native.getInt(XlibWrapper.iarg1);
|
||||||
long sizes_ptr = Native.getLong(XlibWrapper.larg1); // XIconSize*
|
long sizes_ptr = Native.getLong(XlibWrapper.larg1); // XIconSize*
|
||||||
log.log(Level.FINEST, "count = {1}, sizes_ptr = {0}", new Object[] {Long.valueOf(sizes_ptr), Integer.valueOf(count)});
|
log.finest("count = {1}, sizes_ptr = {0}", Long.valueOf(sizes_ptr), Integer.valueOf(count));
|
||||||
XIconSize[] res = new XIconSize[count];
|
XIconSize[] res = new XIconSize[count];
|
||||||
for (int i = 0; i < count; i++, sizes_ptr += XIconSize.getSize()) {
|
for (int i = 0; i < count; i++, sizes_ptr += XIconSize.getSize()) {
|
||||||
res[i] = new XIconSize(sizes_ptr);
|
res[i] = new XIconSize(sizes_ptr);
|
||||||
log.log(Level.FINEST, "sizes_ptr[{1}] = {0}", new Object[] {res[i], Integer.valueOf(i)});
|
log.finest("sizes_ptr[{1}] = {0}", res[i], Integer.valueOf(i));
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
} finally {
|
} finally {
|
||||||
@ -87,12 +87,12 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
if (XWM.getWMID() == XWM.ICE_WM) {
|
if (XWM.getWMID() == XWM.ICE_WM) {
|
||||||
// ICE_WM has a bug - it only displays icons of the size
|
// ICE_WM has a bug - it only displays icons of the size
|
||||||
// 16x16, while reporting 32x32 in its size list
|
// 16x16, while reporting 32x32 in its size list
|
||||||
log.log(Level.FINEST, "Returning ICE_WM icon size: 16x16");
|
log.finest("Returning ICE_WM icon size: 16x16");
|
||||||
return new Dimension(16, 16);
|
return new Dimension(16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
XIconSize[] sizeList = getIconSizes();
|
XIconSize[] sizeList = getIconSizes();
|
||||||
log.log(Level.FINEST, "Icon sizes: {0}", new Object[] {sizeList});
|
log.finest("Icon sizes: {0}", sizeList);
|
||||||
if (sizeList == null) {
|
if (sizeList == null) {
|
||||||
// No icon sizes so we simply fall back to 16x16
|
// No icon sizes so we simply fall back to 16x16
|
||||||
return new Dimension(16, 16);
|
return new Dimension(16, 16);
|
||||||
@ -139,11 +139,11 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("found=" + found);
|
log.finest("found=" + found);
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("widthHint=" + widthHint + ", heightHint=" + heightHint
|
log.finest("widthHint=" + widthHint + ", heightHint=" + heightHint
|
||||||
+ ", saveWidth=" + saveWidth + ", saveHeight=" + saveHeight
|
+ ", saveWidth=" + saveWidth + ", saveHeight=" + saveHeight
|
||||||
+ ", max_width=" + sizeList[0].get_max_width()
|
+ ", max_width=" + sizeList[0].get_max_width()
|
||||||
@ -159,7 +159,7 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
/* determine which way to scale */
|
/* determine which way to scale */
|
||||||
int wdiff = widthHint - sizeList[0].get_max_width();
|
int wdiff = widthHint - sizeList[0].get_max_width();
|
||||||
int hdiff = heightHint - sizeList[0].get_max_height();
|
int hdiff = heightHint - sizeList[0].get_max_height();
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("wdiff=" + wdiff + ", hdiff=" + hdiff);
|
log.finest("wdiff=" + wdiff + ", hdiff=" + hdiff);
|
||||||
}
|
}
|
||||||
if (wdiff >= hdiff) { /* need to scale width more */
|
if (wdiff >= hdiff) { /* need to scale width more */
|
||||||
@ -191,7 +191,7 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
XToolkit.awtUnlock();
|
XToolkit.awtUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("return " + saveWidth + "x" + saveHeight);
|
log.finest("return " + saveWidth + "x" + saveHeight);
|
||||||
}
|
}
|
||||||
return new Dimension(saveWidth, saveHeight);
|
return new Dimension(saveWidth, saveHeight);
|
||||||
@ -418,7 +418,7 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (min != null) {
|
if (min != null) {
|
||||||
log.log(Level.FINER, "Icon: {0}x{1}", new Object[] { min.getWidth(null), min.getHeight(null)});
|
log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null));
|
||||||
setIconImage(min);
|
setIconImage(min);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,7 +444,7 @@ public class XIconWindow extends XBaseWindow {
|
|||||||
}
|
}
|
||||||
Dimension iconSize = getIconSize(width, height);
|
Dimension iconSize = getIconSize(width, height);
|
||||||
if (iconSize != null) {
|
if (iconSize != null) {
|
||||||
log.log(Level.FINEST, "Icon size: {0}", iconSize);
|
log.finest("Icon size: {0}", iconSize);
|
||||||
iconWidth = iconSize.width;
|
iconWidth = iconSize.width;
|
||||||
iconHeight = iconSize.height;
|
iconHeight = iconSize.height;
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,7 +33,7 @@ import java.awt.im.spi.InputMethodContext;
|
|||||||
import java.awt.peer.ComponentPeer;
|
import java.awt.peer.ComponentPeer;
|
||||||
import sun.awt.X11InputMethod;
|
import sun.awt.X11InputMethod;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Input Method Adapter for XIM (without Motif)
|
* Input Method Adapter for XIM (without Motif)
|
||||||
@ -41,7 +41,7 @@ import java.util.logging.*;
|
|||||||
* @author JavaSoft International
|
* @author JavaSoft International
|
||||||
*/
|
*/
|
||||||
public class XInputMethod extends X11InputMethod {
|
public class XInputMethod extends X11InputMethod {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XInputMethod");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XInputMethod");
|
||||||
|
|
||||||
public XInputMethod() throws AWTException {
|
public XInputMethod() throws AWTException {
|
||||||
super();
|
super();
|
||||||
@ -102,13 +102,13 @@ public class XInputMethod extends X11InputMethod {
|
|||||||
protected ComponentPeer getPeer(Component client) {
|
protected ComponentPeer getPeer(Component client) {
|
||||||
XComponentPeer peer;
|
XComponentPeer peer;
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Client is " + client);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Client is " + client);
|
||||||
peer = (XComponentPeer)XToolkit.targetToPeer(client);
|
peer = (XComponentPeer)XToolkit.targetToPeer(client);
|
||||||
while (client != null && peer == null) {
|
while (client != null && peer == null) {
|
||||||
client = getParent(client);
|
client = getParent(client);
|
||||||
peer = (XComponentPeer)XToolkit.targetToPeer(client);
|
peer = (XComponentPeer)XToolkit.targetToPeer(client);
|
||||||
}
|
}
|
||||||
log.log(Level.FINE, "Peer is {0}, client is {1}", new Object[] {peer, client});
|
log.fine("Peer is {0}, client is {1}", peer, client);
|
||||||
|
|
||||||
if (peer != null)
|
if (peer != null)
|
||||||
return peer;
|
return peer;
|
||||||
|
@ -36,15 +36,14 @@ import java.awt.peer.ComponentPeer;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.CausedFocusEvent;
|
import sun.awt.CausedFocusEvent;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
import sun.awt.KeyboardFocusManagerPeerImpl;
|
import sun.awt.KeyboardFocusManagerPeerImpl;
|
||||||
|
|
||||||
public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
|
public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer");
|
||||||
|
|
||||||
private static Object lock = new Object() {};
|
private static Object lock = new Object() {};
|
||||||
private static Component currentFocusOwner;
|
private static Component currentFocusOwner;
|
||||||
@ -82,7 +81,7 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setCurrentNativeFocusedWindow(Window win) {
|
public static void setCurrentNativeFocusedWindow(Window win) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Setting current native focused window " + win);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Setting current native focused window " + win);
|
||||||
XWindowPeer from = null, to = null;
|
XWindowPeer from = null, to = null;
|
||||||
|
|
||||||
synchronized(lock) {
|
synchronized(lock) {
|
||||||
|
@ -29,8 +29,7 @@ package sun.awt.X11;
|
|||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
public class XKeysym {
|
public class XKeysym {
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ public class XKeysym {
|
|||||||
static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
|
static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
|
||||||
static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
|
static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
|
||||||
static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
|
static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
|
||||||
private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XKeysym");
|
private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym");
|
||||||
public static char convertKeysym( long ks, int state ) {
|
public static char convertKeysym( long ks, int state ) {
|
||||||
|
|
||||||
/* First check for Latin-1 characters (1:1 mapping) */
|
/* First check for Latin-1 characters (1:1 mapping) */
|
||||||
|
@ -34,13 +34,13 @@ import java.awt.peer.*;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.awt.geom.*;
|
import java.awt.geom.*;
|
||||||
import java.awt.image.*;
|
import java.awt.image.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
// TODO: some input actions should do nothing if Shift or Control are down
|
// TODO: some input actions should do nothing if Shift or Control are down
|
||||||
|
|
||||||
class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XListPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XListPeer");
|
||||||
|
|
||||||
public final static int MARGIN = 2;
|
public final static int MARGIN = 2;
|
||||||
public final static int SPACE = 1;
|
public final static int SPACE = 1;
|
||||||
@ -578,10 +578,10 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mousePressed(MouseEvent mouseEvent) {
|
void mousePressed(MouseEvent mouseEvent) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
|
||||||
if (isEnabled() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
|
if (isEnabled() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
|
||||||
if (inWindow(mouseEvent.getX(), mouseEvent.getY())) {
|
if (inWindow(mouseEvent.getX(), mouseEvent.getY())) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Mouse press in items area");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in items area");
|
||||||
active = WINDOW;
|
active = WINDOW;
|
||||||
int i = y2index(mouseEvent.getY());
|
int i = y2index(mouseEvent.getY());
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
@ -618,14 +618,14 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
currentIndex = -1;
|
currentIndex = -1;
|
||||||
}
|
}
|
||||||
} else if (inVerticalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
|
} else if (inVerticalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Mouse press in vertical scrollbar");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in vertical scrollbar");
|
||||||
active = VERSCROLLBAR;
|
active = VERSCROLLBAR;
|
||||||
vsb.handleMouseEvent(mouseEvent.getID(),
|
vsb.handleMouseEvent(mouseEvent.getID(),
|
||||||
mouseEvent.getModifiers(),
|
mouseEvent.getModifiers(),
|
||||||
mouseEvent.getX() - (width - SCROLLBAR_WIDTH),
|
mouseEvent.getX() - (width - SCROLLBAR_WIDTH),
|
||||||
mouseEvent.getY());
|
mouseEvent.getY());
|
||||||
} else if (inHorizontalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
|
} else if (inHorizontalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Mouse press in horizontal scrollbar");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in horizontal scrollbar");
|
||||||
active = HORSCROLLBAR;
|
active = HORSCROLLBAR;
|
||||||
hsb.handleMouseEvent(mouseEvent.getID(),
|
hsb.handleMouseEvent(mouseEvent.getID(),
|
||||||
mouseEvent.getModifiers(),
|
mouseEvent.getModifiers(),
|
||||||
@ -808,7 +808,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
|
|
||||||
void keyPressed(KeyEvent e) {
|
void keyPressed(KeyEvent e) {
|
||||||
int keyCode = e.getKeyCode();
|
int keyCode = e.getKeyCode();
|
||||||
if (log.isLoggable(Level.FINE)) log.fine(e.toString());
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine(e.toString());
|
||||||
switch(keyCode) {
|
switch(keyCode) {
|
||||||
case KeyEvent.VK_UP:
|
case KeyEvent.VK_UP:
|
||||||
case KeyEvent.VK_KP_UP: // TODO: I assume we also want this, too
|
case KeyEvent.VK_KP_UP: // TODO: I assume we also want this, too
|
||||||
@ -993,7 +993,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
*/
|
*/
|
||||||
public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) {
|
public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) {
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Notify value changed on " + obj + " to " + v);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Notify value changed on " + obj + " to " + v);
|
||||||
int value = obj.getValue();
|
int value = obj.getValue();
|
||||||
if (obj == vsb) {
|
if (obj == vsb) {
|
||||||
scrollVertical(v - value);
|
scrollVertical(v - value);
|
||||||
@ -1076,7 +1076,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Adding item '" + item + "' to " + addedIndex);
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Adding item '" + item + "' to " + addedIndex);
|
||||||
|
|
||||||
// Update maxLength
|
// Update maxLength
|
||||||
boolean repaintItems = !isItemHidden(addedIndex);
|
boolean repaintItems = !isItemHidden(addedIndex);
|
||||||
@ -1094,7 +1094,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
| ((vsb.needsRepaint())?(PAINT_VSCROLL):0);
|
| ((vsb.needsRepaint())?(PAINT_VSCROLL):0);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Last visible: " + getLastVisibleItem() +
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last visible: " + getLastVisibleItem() +
|
||||||
", hsb changed : " + (hsbWasVis ^ hsbVis) + ", items changed " + repaintItems);
|
", hsb changed : " + (hsbWasVis ^ hsbVis) + ", items changed " + repaintItems);
|
||||||
repaint(addedIndex, getLastVisibleItem(), options);
|
repaint(addedIndex, getLastVisibleItem(), options);
|
||||||
}
|
}
|
||||||
@ -1110,9 +1110,9 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
boolean vsbWasVisible = vsbVis;
|
boolean vsbWasVisible = vsbVis;
|
||||||
int oldLastDisplayed = lastItemDisplayed();
|
int oldLastDisplayed = lastItemDisplayed();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Deleting from " + s + " to " + e);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Deleting from " + s + " to " + e);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() +
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() +
|
||||||
", size " + items.size());
|
", size " + items.size());
|
||||||
|
|
||||||
if (items.size() == 0) {
|
if (items.size() == 0) {
|
||||||
@ -1180,7 +1180,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
options |= PAINT_FOCUS;
|
options |= PAINT_FOCUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Multiple selections: " + multipleSelections);
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Multiple selections: " + multipleSelections);
|
||||||
|
|
||||||
// update vsb.val
|
// update vsb.val
|
||||||
if (vsb.getValue() >= s) {
|
if (vsb.getValue() >= s) {
|
||||||
@ -1433,7 +1433,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
* y is the number of items to scroll
|
* y is the number of items to scroll
|
||||||
*/
|
*/
|
||||||
void scrollVertical(int y) {
|
void scrollVertical(int y) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Scrolling vertically by " + y);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Scrolling vertically by " + y);
|
||||||
int itemsInWin = itemsInWindow();
|
int itemsInWin = itemsInWindow();
|
||||||
int h = getItemHeight();
|
int h = getItemHeight();
|
||||||
int pixelsToScroll = y * h;
|
int pixelsToScroll = y * h;
|
||||||
@ -1473,7 +1473,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
* x is the number of pixels to scroll
|
* x is the number of pixels to scroll
|
||||||
*/
|
*/
|
||||||
void scrollHorizontal(int x) {
|
void scrollHorizontal(int x) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Scrolling horizontally by " + y);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Scrolling horizontally by " + y);
|
||||||
int w = getListWidth();
|
int w = getListWidth();
|
||||||
w -= ((2 * SPACE) + (2 * MARGIN));
|
w -= ((2 * SPACE) + (2 * MARGIN));
|
||||||
int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
|
int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
|
||||||
@ -1706,7 +1706,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (localBuffer == null) {
|
if (localBuffer == null) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Creating buffer " + width + "x" + height);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Creating buffer " + width + "x" + height);
|
||||||
// use GraphicsConfig.cCVI() instead of Component.cVI(),
|
// use GraphicsConfig.cCVI() instead of Component.cVI(),
|
||||||
// because the latter may cause a deadlock with the tree lock
|
// because the latter may cause a deadlock with the tree lock
|
||||||
localBuffer =
|
localBuffer =
|
||||||
@ -1743,7 +1743,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
|
|
||||||
private void paint(Graphics listG, int firstItem, int lastItem, int options,
|
private void paint(Graphics listG, int firstItem, int lastItem, int options,
|
||||||
Rectangle source, Point distance) {
|
Rectangle source, Point distance) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
|
||||||
if (firstItem > lastItem) {
|
if (firstItem > lastItem) {
|
||||||
int t = lastItem;
|
int t = lastItem;
|
||||||
lastItem = firstItem;
|
lastItem = firstItem;
|
||||||
@ -1832,7 +1832,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void paintItems(Graphics g, int firstItem, int lastItem, int options) {
|
private void paintItems(Graphics g, int firstItem, int lastItem, int options) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
|
||||||
|
|
||||||
firstItem = Math.max(getFirstVisibleItem(), firstItem);
|
firstItem = Math.max(getFirstVisibleItem(), firstItem);
|
||||||
if (firstItem > lastItem) {
|
if (firstItem > lastItem) {
|
||||||
@ -1843,7 +1843,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
firstItem = Math.max(getFirstVisibleItem(), firstItem);
|
firstItem = Math.max(getFirstVisibleItem(), firstItem);
|
||||||
lastItem = Math.min(lastItem, items.size()-1);
|
lastItem = Math.min(lastItem, items.size()-1);
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Actually painting items from " + firstItem + " to " + lastItem +
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Actually painting items from " + firstItem + " to " + lastItem +
|
||||||
", items in window " + itemsInWindow());
|
", items in window " + itemsInWindow());
|
||||||
for (int i = firstItem; i <= lastItem; i++) {
|
for (int i = firstItem; i <= lastItem; i++) {
|
||||||
paintItem(g, i);
|
paintItem(g, i);
|
||||||
@ -1851,7 +1851,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void paintItem(Graphics g, int index) {
|
private void paintItem(Graphics g, int index) {
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Painting item " + index);
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting item " + index);
|
||||||
// 4895367 - only paint items which are visible
|
// 4895367 - only paint items which are visible
|
||||||
if (!isItemHidden(index)) {
|
if (!isItemHidden(index)) {
|
||||||
Shape clip = g.getClip();
|
Shape clip = g.getClip();
|
||||||
@ -1859,18 +1859,18 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
int h = getItemHeight();
|
int h = getItemHeight();
|
||||||
int y = getItemY(index);
|
int y = getItemY(index);
|
||||||
int x = getItemX();
|
int x = getItemX();
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2)));
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2)));
|
||||||
g.setClip(x, y, w - (SPACE*2), h-(SPACE*2));
|
g.setClip(x, y, w - (SPACE*2), h-(SPACE*2));
|
||||||
|
|
||||||
// Always paint the background so that focus is unpainted in
|
// Always paint the background so that focus is unpainted in
|
||||||
// multiselect mode
|
// multiselect mode
|
||||||
if (isSelected(index)) {
|
if (isSelected(index)) {
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Painted item is selected");
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painted item is selected");
|
||||||
g.setColor(getListForeground());
|
g.setColor(getListForeground());
|
||||||
} else {
|
} else {
|
||||||
g.setColor(getListBackground());
|
g.setColor(getListBackground());
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Filling " + new Rectangle(x, y, w, h));
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Filling " + new Rectangle(x, y, w, h));
|
||||||
g.fillRect(x, y, w, h);
|
g.fillRect(x, y, w, h);
|
||||||
|
|
||||||
if (index <= getLastVisibleItem() && index < items.size()) {
|
if (index <= getLastVisibleItem() && index < items.size()) {
|
||||||
@ -1894,7 +1894,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) {
|
void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) {
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Painting scrollbar " + scr + " width " +
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting scrollbar " + scr + " width " +
|
||||||
width + " height " + height + ", paintAll " + paintAll);
|
width + " height " + height + ", paintAll " + paintAll);
|
||||||
g.translate(x, y);
|
g.translate(x, y);
|
||||||
scr.paint(g, getSystemColors(), paintAll);
|
scr.paint(g, getSystemColors(), paintAll);
|
||||||
@ -1932,22 +1932,22 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
|||||||
if (paintFocus && !hasFocus()) {
|
if (paintFocus && !hasFocus()) {
|
||||||
paintFocus = false;
|
paintFocus = false;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " +
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " +
|
||||||
(isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus);
|
(isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus);
|
||||||
Shape clip = g.getClip();
|
Shape clip = g.getClip();
|
||||||
g.setClip(0, 0, listWidth, listHeight);
|
g.setClip(0, 0, listWidth, listHeight);
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight));
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight));
|
||||||
Rectangle rect = getFocusRect();
|
Rectangle rect = getFocusRect();
|
||||||
if (prevFocusRect != null) {
|
if (prevFocusRect != null) {
|
||||||
// Erase focus rect
|
// Erase focus rect
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Erasing previous focus rect " + prevFocusRect);
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Erasing previous focus rect " + prevFocusRect);
|
||||||
g.setColor(getListBackground());
|
g.setColor(getListBackground());
|
||||||
g.drawRect(prevFocusRect.x, prevFocusRect.y, prevFocusRect.width, prevFocusRect.height);
|
g.drawRect(prevFocusRect.x, prevFocusRect.y, prevFocusRect.width, prevFocusRect.height);
|
||||||
prevFocusRect = null;
|
prevFocusRect = null;
|
||||||
}
|
}
|
||||||
if (paintFocus) {
|
if (paintFocus) {
|
||||||
// Paint new
|
// Paint new
|
||||||
if (log.isLoggable(Level.FINEST)) log.finest("Painting focus rect " + rect);
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting focus rect " + rect);
|
||||||
g.setColor(getListForeground()); // Focus color is always black on Linux
|
g.setColor(getListForeground()); // Focus color is always black on Linux
|
||||||
g.drawRect(rect.x, rect.y, rect.width, rect.height);
|
g.drawRect(rect.x, rect.y, rect.width, rect.height);
|
||||||
prevFocusRect = rect;
|
prevFocusRect = rect;
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
|
|
||||||
public class XMSelection {
|
public class XMSelection {
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ public class XMSelection {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XMSelection");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XMSelection");
|
||||||
/* Name of the selection */
|
/* Name of the selection */
|
||||||
String selectionName;
|
String selectionName;
|
||||||
|
|
||||||
@ -129,7 +128,7 @@ public class XMSelection {
|
|||||||
long display = XToolkit.getDisplay();
|
long display = XToolkit.getDisplay();
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
setOwner(owner, screen);
|
setOwner(owner, screen);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
|
||||||
XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
|
XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
|
||||||
XToolkit.addEventDispatcher(owner,
|
XToolkit.addEventDispatcher(owner,
|
||||||
new XEventDispatcher() {
|
new XEventDispatcher() {
|
||||||
@ -149,19 +148,19 @@ public class XMSelection {
|
|||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
long display = XToolkit.getDisplay();
|
long display = XToolkit.getDisplay();
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Grabbing XServer");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Grabbing XServer");
|
||||||
XlibWrapper.XGrabServer(display);
|
XlibWrapper.XGrabServer(display);
|
||||||
|
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
String selection_name = getName()+"_S"+screen;
|
String selection_name = getName()+"_S"+screen;
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name);
|
||||||
XAtom atom = XAtom.get(selection_name);
|
XAtom atom = XAtom.get(selection_name);
|
||||||
selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
|
selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
|
||||||
setAtom(atom,screen);
|
setAtom(atom,screen);
|
||||||
long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom());
|
long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom());
|
||||||
if (owner != 0) {
|
if (owner != 0) {
|
||||||
setOwner(owner, screen);
|
setOwner(owner, screen);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
|
||||||
XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
|
XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
|
||||||
XToolkit.addEventDispatcher(owner,
|
XToolkit.addEventDispatcher(owner,
|
||||||
new XEventDispatcher() {
|
new XEventDispatcher() {
|
||||||
@ -176,7 +175,7 @@ public class XMSelection {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("UnGrabbing XServer");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("UnGrabbing XServer");
|
||||||
XlibWrapper.XUngrabServer(XToolkit.getDisplay());
|
XlibWrapper.XUngrabServer(XToolkit.getDisplay());
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@ -188,7 +187,7 @@ public class XMSelection {
|
|||||||
static boolean processClientMessage(XEvent xev, int screen) {
|
static boolean processClientMessage(XEvent xev, int screen) {
|
||||||
XClientMessageEvent xce = xev.get_xclient();
|
XClientMessageEvent xce = xev.get_xclient();
|
||||||
if (xce.get_message_type() == XA_MANAGER.getAtom()) {
|
if (xce.get_message_type() == XA_MANAGER.getAtom()) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("client messags = " + xce);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("client messags = " + xce);
|
||||||
long timestamp = xce.get_data(0);
|
long timestamp = xce.get_data(0);
|
||||||
long atom = xce.get_data(1);
|
long atom = xce.get_data(1);
|
||||||
long owner = xce.get_data(2);
|
long owner = xce.get_data(2);
|
||||||
@ -295,7 +294,7 @@ public class XMSelection {
|
|||||||
|
|
||||||
|
|
||||||
synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) {
|
synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
|
||||||
if (listeners != null) {
|
if (listeners != null) {
|
||||||
Iterator iter = listeners.iterator();
|
Iterator iter = listeners.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
@ -306,7 +305,7 @@ public class XMSelection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) {
|
synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de);
|
||||||
if (listeners != null) {
|
if (listeners != null) {
|
||||||
Iterator iter = listeners.iterator();
|
Iterator iter = listeners.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
@ -318,7 +317,7 @@ public class XMSelection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dispatchSelectionEvent(XEvent xev, int screen) {
|
void dispatchSelectionEvent(XEvent xev, int screen) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Event =" + xev);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Event =" + xev);
|
||||||
if (xev.get_type() == XConstants.DestroyNotify) {
|
if (xev.get_type() == XConstants.DestroyNotify) {
|
||||||
XDestroyWindowEvent de = xev.get_xdestroywindow();
|
XDestroyWindowEvent de = xev.get_xdestroywindow();
|
||||||
dispatchOwnerDeath( de, screen);
|
dispatchOwnerDeath( de, screen);
|
||||||
|
@ -30,7 +30,7 @@ import java.awt.event.*;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||||
@ -41,7 +41,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XMenuBarPeer");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XMenuBarPeer");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Primary members
|
* Primary members
|
||||||
@ -533,7 +533,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
|||||||
*/
|
*/
|
||||||
public void handleKeyPress(XEvent xev) {
|
public void handleKeyPress(XEvent xev) {
|
||||||
XKeyEvent xkey = xev.get_xkey();
|
XKeyEvent xkey = xev.get_xkey();
|
||||||
if (log.isLoggable(Level.FINE)) log.fine(xkey.toString());
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine(xkey.toString());
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,6 @@ import java.awt.*;
|
|||||||
import java.awt.peer.*;
|
import java.awt.peer.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@ -43,8 +41,6 @@ public class XMenuItemPeer implements MenuItemPeer {
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XMenuItemPeer");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Primary members
|
* Primary members
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +29,7 @@ import java.awt.peer.*;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
||||||
@ -39,7 +39,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
|||||||
* Data members
|
* Data members
|
||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XMenuPeer");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XMenuPeer");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Window that correspond to this menu
|
* Window that correspond to this menu
|
||||||
@ -122,7 +122,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
|||||||
* for adding separators
|
* for adding separators
|
||||||
*/
|
*/
|
||||||
public void addSeparator() {
|
public void addSeparator() {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("addSeparator is not implemented");
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("addSeparator is not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItem(MenuItem item) {
|
public void addItem(MenuItem item) {
|
||||||
@ -130,7 +130,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
|||||||
if (menuWindow != null) {
|
if (menuWindow != null) {
|
||||||
menuWindow.addItem(item);
|
menuWindow.addItem(item);
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("Attempt to use XMenuWindowPeer without window");
|
log.fine("Attempt to use XMenuWindowPeer without window");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
|||||||
if (menuWindow != null) {
|
if (menuWindow != null) {
|
||||||
menuWindow.delItem(index);
|
menuWindow.delItem(index);
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("Attempt to use XMenuWindowPeer without window");
|
log.fine("Attempt to use XMenuWindowPeer without window");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class XMenuWindow extends XBaseMenuWindow {
|
public class XMenuWindow extends XBaseMenuWindow {
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XMenuWindow");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XMenuWindow");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Primary members
|
* Primary members
|
||||||
@ -399,7 +399,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
|||||||
if (!isCreated()) {
|
if (!isCreated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("showing menu window + " + getWindow() + " at " + bounds);
|
log.finer("showing menu window + " + getWindow() + " at " + bounds);
|
||||||
}
|
}
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
|
@ -27,14 +27,13 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.awt.Frame;
|
import java.awt.Frame;
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol
|
final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol
|
||||||
{
|
{
|
||||||
private final static Logger log = Logger.getLogger("sun.awt.X11.XNETProtocol");
|
private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XNETProtocol");
|
||||||
private final static Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XNETProtocol");
|
private final static PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XNETProtocol");
|
||||||
private static Logger stateLog = Logger.getLogger("sun.awt.X11.states.XNETProtocol");
|
private static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states.XNETProtocol");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XStateProtocol
|
* XStateProtocol
|
||||||
@ -44,7 +43,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setState(XWindowPeer window, int state) {
|
public void setState(XWindowPeer window, int state) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting state of " + window + " to " + state);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting state of " + window + " to " + state);
|
||||||
if (window.isShowing()) {
|
if (window.isShowing()) {
|
||||||
requestState(window, state);
|
requestState(window, state);
|
||||||
} else {
|
} else {
|
||||||
@ -54,7 +53,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
|
|
||||||
private void setInitialState(XWindowPeer window, int state) {
|
private void setInitialState(XWindowPeer window, int state) {
|
||||||
XAtomList old_state = window.getNETWMState();
|
XAtomList old_state = window.getNETWMState();
|
||||||
log.log(Level.FINE, "Current state of the window {0} is {1}", new Object[] {window, old_state});
|
log.fine("Current state of the window {0} is {1}", window, old_state);
|
||||||
if ((state & Frame.MAXIMIZED_VERT) != 0) {
|
if ((state & Frame.MAXIMIZED_VERT) != 0) {
|
||||||
old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT);
|
old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT);
|
||||||
} else {
|
} else {
|
||||||
@ -65,7 +64,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
} else {
|
} else {
|
||||||
old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ);
|
old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ);
|
||||||
}
|
}
|
||||||
log.log(Level.FINE, "Setting initial state of the window {0} to {1}", new Object[] {window, old_state});
|
log.fine("Setting initial state of the window {0} to {1}", window, old_state);
|
||||||
window.setNETWMState(old_state);
|
window.setNETWMState(old_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Requesting state on " + window + " for " + state);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Requesting state on " + window + " for " + state);
|
||||||
req.set_type((int)XConstants.ClientMessage);
|
req.set_type((int)XConstants.ClientMessage);
|
||||||
req.set_window(window.getWindow());
|
req.set_window(window.getWindow());
|
||||||
req.set_message_type(XA_NET_WM_STATE.getAtom());
|
req.set_message_type(XA_NET_WM_STATE.getAtom());
|
||||||
@ -180,7 +179,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
req.set_data(1, state.getAtom());
|
req.set_data(1, state.getAtom());
|
||||||
// Fix for 6735584: req.data[2] must be set to 0 when only one property is changed
|
// Fix for 6735584: req.data[2] must be set to 0 when only one property is changed
|
||||||
req.set_data(2, 0);
|
req.set_data(2, 0);
|
||||||
log.log(Level.FINE, "Setting _NET_STATE atom {0} on {1} for {2}", new Object[] {state, window, Boolean.valueOf(isAdd)});
|
log.fine("Setting _NET_STATE atom {0} on {1} for {2}", state, window, Boolean.valueOf(isAdd));
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
||||||
@ -205,20 +204,20 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
* @param reset Indicates operation, 'set' if false, 'reset' if true
|
* @param reset Indicates operation, 'set' if false, 'reset' if true
|
||||||
*/
|
*/
|
||||||
private void setStateHelper(XWindowPeer window, XAtom state, boolean set) {
|
private void setStateHelper(XWindowPeer window, XAtom state, boolean set) {
|
||||||
log.log(Level.FINER, "Window visibility is: withdrawn={0}, visible={1}, mapped={2} showing={3}",
|
log.finer("Window visibility is: withdrawn={0}, visible={1}, mapped={2} showing={3}",
|
||||||
new Object[] {Boolean.valueOf(window.isWithdrawn()), Boolean.valueOf(window.isVisible()),
|
Boolean.valueOf(window.isWithdrawn()), Boolean.valueOf(window.isVisible()),
|
||||||
Boolean.valueOf(window.isMapped()), Boolean.valueOf(window.isShowing())});
|
Boolean.valueOf(window.isMapped()), Boolean.valueOf(window.isShowing()));
|
||||||
if (window.isShowing()) {
|
if (window.isShowing()) {
|
||||||
requestState(window, state, set);
|
requestState(window, state, set);
|
||||||
} else {
|
} else {
|
||||||
XAtomList net_wm_state = window.getNETWMState();
|
XAtomList net_wm_state = window.getNETWMState();
|
||||||
log.log(Level.FINE, "Current state on {0} is {1}", new Object[] {window, net_wm_state});
|
log.finer("Current state on {0} is {1}", window, net_wm_state);
|
||||||
if (!set) {
|
if (!set) {
|
||||||
net_wm_state.remove(state);
|
net_wm_state.remove(state);
|
||||||
} else {
|
} else {
|
||||||
net_wm_state.add(state);
|
net_wm_state.add(state);
|
||||||
}
|
}
|
||||||
log.log(Level.FINE, "Setting states on {0} to {1}", new Object[] {window, net_wm_state});
|
log.fine("Setting states on {0} to {1}", window, net_wm_state);
|
||||||
window.setNETWMState(net_wm_state);
|
window.setNETWMState(net_wm_state);
|
||||||
}
|
}
|
||||||
XToolkit.XSync();
|
XToolkit.XSync();
|
||||||
@ -272,7 +271,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
}
|
}
|
||||||
NetWindow = checkAnchor(XA_NET_SUPPORTING_WM_CHECK, XAtom.XA_WINDOW);
|
NetWindow = checkAnchor(XA_NET_SUPPORTING_WM_CHECK, XAtom.XA_WINDOW);
|
||||||
supportChecked = true;
|
supportChecked = true;
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### " + this + " is active: " + (NetWindow != 0));
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " is active: " + (NetWindow != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean active() {
|
boolean active() {
|
||||||
@ -309,7 +308,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
|||||||
if (net_wm_name_string == null) {
|
if (net_wm_name_string == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### WM_NAME = " + net_wm_name_string);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### WM_NAME = " + net_wm_name_string);
|
||||||
return net_wm_name_string.startsWith(name);
|
return net_wm_name_string.startsWith(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import java.lang.reflect.Method;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
|
|||||||
* Data members
|
* Data members
|
||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XBaseMenuWindow");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XBaseMenuWindow");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Primary members
|
* Primary members
|
||||||
@ -146,7 +146,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
|
|||||||
* for adding separators
|
* for adding separators
|
||||||
*/
|
*/
|
||||||
public void addSeparator() {
|
public void addSeparator() {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("addSeparator is not implemented");
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("addSeparator is not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -382,7 +382,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
|
|||||||
*/
|
*/
|
||||||
public void handleKeyPress(XEvent xev) {
|
public void handleKeyPress(XEvent xev) {
|
||||||
XKeyEvent xkey = xev.get_xkey();
|
XKeyEvent xkey = xev.get_xkey();
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(xkey.toString());
|
log.fine(xkey.toString());
|
||||||
}
|
}
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
class XProtocol {
|
class XProtocol {
|
||||||
private final static Logger log = Logger.getLogger("sun.awt.X11.XProtocol");
|
private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XProtocol");
|
||||||
|
|
||||||
private Map<XAtom, XAtomList> atomToList = new HashMap<XAtom, XAtomList>();
|
private Map<XAtom, XAtomList> atomToList = new HashMap<XAtom, XAtomList>();
|
||||||
private Map<XAtom, Long> atomToAnchor = new HashMap<XAtom, Long>();
|
private Map<XAtom, Long> atomToAnchor = new HashMap<XAtom, Long>();
|
||||||
@ -54,7 +54,7 @@ class XProtocol {
|
|||||||
} finally {
|
} finally {
|
||||||
if (firstCheck) {
|
if (firstCheck) {
|
||||||
firstCheck = false;
|
firstCheck = false;
|
||||||
log.log(Level.FINE, "{0}:{1} supports {2}", new Object[] {this, listName, protocols});
|
log.fine("{0}:{1} supports {2}", this, listName, protocols);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,9 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
public class XQueryTree {
|
public class XQueryTree {
|
||||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XQueryTree");
|
|
||||||
private boolean __executed = false;
|
private boolean __executed = false;
|
||||||
long _w;
|
long _w;
|
||||||
long root_ptr = unsafe.allocateMemory(Native.getLongSize());
|
long root_ptr = unsafe.allocateMemory(Native.getLongSize());
|
||||||
|
@ -30,14 +30,14 @@ import java.awt.event.*;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
import sun.awt.X11GraphicsConfig;
|
import sun.awt.X11GraphicsConfig;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple vertical scroll bar.
|
* A simple vertical scroll bar.
|
||||||
*/
|
*/
|
||||||
abstract class XScrollbar {
|
abstract class XScrollbar {
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XScrollbar");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbar");
|
||||||
/**
|
/**
|
||||||
* The thread that asynchronously tells the scrollbar to scroll.
|
* The thread that asynchronously tells the scrollbar to scroll.
|
||||||
* @see #startScrolling
|
* @see #startScrolling
|
||||||
@ -118,7 +118,7 @@ abstract class XScrollbar {
|
|||||||
abstract protected void rebuildArrows();
|
abstract protected void rebuildArrows();
|
||||||
|
|
||||||
public void setSize(int width, int height) {
|
public void setSize(int width, int height) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ abstract class XScrollbar {
|
|||||||
* @param paintAll paint the whole scrollbar if true, just the thumb is false
|
* @param paintAll paint the whole scrollbar if true, just the thumb is false
|
||||||
*/
|
*/
|
||||||
void paint(Graphics g, Color colors[], boolean paintAll) {
|
void paint(Graphics g, Color colors[], boolean paintAll) {
|
||||||
if (log.isLoggable(Level.FINER)) log.finer("Painting scrollbar " + this);
|
if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting scrollbar " + this);
|
||||||
|
|
||||||
boolean useBufferedImage = false;
|
boolean useBufferedImage = false;
|
||||||
Graphics2D g2 = null;
|
Graphics2D g2 = null;
|
||||||
@ -454,7 +454,7 @@ abstract class XScrollbar {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
String type;
|
String type;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case MouseEvent.MOUSE_PRESSED:
|
case MouseEvent.MOUSE_PRESSED:
|
||||||
|
@ -28,10 +28,10 @@ package sun.awt.X11;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.awt.peer.*;
|
import java.awt.peer.*;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient {
|
class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient {
|
||||||
private final static Logger log = Logger.getLogger("sun.awt.X11.XScrollbarPeer");
|
private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbarPeer");
|
||||||
|
|
||||||
private static final int DEFAULT_LENGTH = 50;
|
private static final int DEFAULT_LENGTH = 50;
|
||||||
private static final int DEFAULT_WIDTH_SOLARIS = 19;
|
private static final int DEFAULT_WIDTH_SOLARIS = 19;
|
||||||
@ -162,7 +162,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
|||||||
|
|
||||||
public void handleJavaKeyEvent(KeyEvent event) {
|
public void handleJavaKeyEvent(KeyEvent event) {
|
||||||
super.handleJavaKeyEvent(event);
|
super.handleJavaKeyEvent(event);
|
||||||
if (log.isLoggable(Level.FINEST)) log.finer("KeyEvent on scrollbar: " + event);
|
if (log.isLoggable(PlatformLogger.FINEST)) log.finer("KeyEvent on scrollbar: " + event);
|
||||||
if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) {
|
if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) {
|
||||||
switch(event.getKeyCode()) {
|
switch(event.getKeyCode()) {
|
||||||
case KeyEvent.VK_UP:
|
case KeyEvent.VK_UP:
|
||||||
|
@ -27,14 +27,14 @@ package sun.awt.X11;
|
|||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.peer.SystemTrayPeer;
|
import java.awt.peer.SystemTrayPeer;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XSystemTrayPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XSystemTrayPeer");
|
||||||
|
|
||||||
SystemTray target;
|
SystemTray target;
|
||||||
static XSystemTrayPeer peerInstance; // there is only one SystemTray peer per application
|
static XSystemTrayPeer peerInstance; // there is only one SystemTray peer per application
|
||||||
|
@ -52,12 +52,13 @@ import javax.swing.border.Border;
|
|||||||
import com.sun.java.swing.plaf.motif.*;
|
import com.sun.java.swing.plaf.motif.*;
|
||||||
import java.awt.im.InputMethodRequests;
|
import java.awt.im.InputMethodRequests;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
import sun.awt.CausedFocusEvent;
|
import sun.awt.CausedFocusEvent;
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
|
|
||||||
public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer {
|
public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XTextField");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XTextField");
|
||||||
|
|
||||||
String text;
|
String text;
|
||||||
XAWTTextField xtext;
|
XAWTTextField xtext;
|
||||||
@ -256,7 +257,7 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBackground(Color c) {
|
public void setBackground(Color c) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("target="+ target + ", old=" + background + ", new=" + c);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("target="+ target + ", old=" + background + ", new=" + c);
|
||||||
background = c;
|
background = c;
|
||||||
if (xtext != null) {
|
if (xtext != null) {
|
||||||
xtext.setBackground(c);
|
xtext.setBackground(c);
|
||||||
|
@ -46,8 +46,6 @@ import java.lang.reflect.Method;
|
|||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
@ -56,13 +54,14 @@ import sun.font.FontManager;
|
|||||||
import sun.misc.PerformanceLogger;
|
import sun.misc.PerformanceLogger;
|
||||||
import sun.print.PrintJob2D;
|
import sun.print.PrintJob2D;
|
||||||
import sun.security.action.GetBooleanAction;
|
import sun.security.action.GetBooleanAction;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public final class XToolkit extends UNIXToolkit implements Runnable {
|
public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XToolkit");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XToolkit");
|
||||||
private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XToolkit");
|
private static final PlatformLogger eventLog = PlatformLogger.getLogger("sun.awt.X11.event.XToolkit");
|
||||||
private static final Logger timeoutTaskLog = Logger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
|
private static final PlatformLogger timeoutTaskLog = PlatformLogger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
|
||||||
private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XToolkit");
|
private static final PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XToolkit");
|
||||||
private static final Logger backingStoreLog = Logger.getLogger("sun.awt.X11.backingStore.XToolkit");
|
private static final PlatformLogger backingStoreLog = PlatformLogger.getLogger("sun.awt.X11.backingStore.XToolkit");
|
||||||
|
|
||||||
//There is 400 ms is set by default on Windows and 500 by default on KDE and GNOME.
|
//There is 400 ms is set by default on Windows and 500 by default on KDE and GNOME.
|
||||||
//We use the same hardcoded constant.
|
//We use the same hardcoded constant.
|
||||||
@ -181,13 +180,13 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
// Default XErrorHandler may just terminate the process. Don't call it.
|
// Default XErrorHandler may just terminate the process. Don't call it.
|
||||||
// return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
|
// return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "Unhandled XErrorEvent: " +
|
log.fine("Unhandled XErrorEvent: " +
|
||||||
"id=" + error.get_resourceid() + ", " +
|
"id=" + error.get_resourceid() + ", " +
|
||||||
"serial=" + error.get_serial() + ", " +
|
"serial=" + error.get_serial() + ", " +
|
||||||
"ec=" + error.get_error_code() + ", " +
|
"ec=" + error.get_error_code() + ", " +
|
||||||
"rc=" + error.get_request_code() + ", " +
|
"rc=" + error.get_request_code() + ", " +
|
||||||
"mc=" + error.get_minor_code());
|
"mc=" + error.get_minor_code());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -206,7 +205,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
return SAVED_ERROR_HANDLER(display, event);
|
return SAVED_ERROR_HANDLER(display, event);
|
||||||
}
|
}
|
||||||
} catch (Throwable z) {
|
} catch (Throwable z) {
|
||||||
log.log(Level.FINE, "Error in GlobalErrorHandler", z);
|
log.fine("Error in GlobalErrorHandler", z);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -324,7 +323,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
((XAWTXSettings)xs).dispose();
|
((XAWTXSettings)xs).dispose();
|
||||||
}
|
}
|
||||||
freeXKB();
|
freeXKB();
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
dumpPeers();
|
dumpPeers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,8 +566,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void processException(Throwable thr) {
|
static void processException(Throwable thr) {
|
||||||
if (log.isLoggable(Level.WARNING)) {
|
if (log.isLoggable(PlatformLogger.WARNING)) {
|
||||||
log.log(Level.WARNING, "Exception on Toolkit thread", thr);
|
log.warning("Exception on Toolkit thread", thr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,8 +628,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINER)) {
|
if (eventLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
eventLog.log(Level.FINER, "{0}", ev);
|
eventLog.finer("{0}", ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if input method consumes the event
|
// Check if input method consumes the event
|
||||||
@ -645,13 +644,13 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
|
if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
|
||||||
keyEventLog.fine("before XFilterEvent:"+ev);
|
keyEventLog.fine("before XFilterEvent:"+ev);
|
||||||
}
|
}
|
||||||
if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
|
if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
|
if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
|
||||||
keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
|
keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1338,7 +1337,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void dumpPeers() {
|
static void dumpPeers() {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("Mapped windows:");
|
log.fine("Mapped windows:");
|
||||||
Iterator iter = winMap.entrySet().iterator();
|
Iterator iter = winMap.entrySet().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
@ -1434,7 +1433,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
}
|
}
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
// Note: the returned timeStamp can be incorrect in this case.
|
// Note: the returned timeStamp can be incorrect in this case.
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
awtUnlock();
|
awtUnlock();
|
||||||
@ -1767,7 +1766,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
} finally {
|
} finally {
|
||||||
awtUnlock();
|
awtUnlock();
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine("metaMask = " + metaMask);
|
log.fine("metaMask = " + metaMask);
|
||||||
log.fine("altMask = " + altMask);
|
log.fine("altMask = " + altMask);
|
||||||
log.fine("numLockMask = " + numLockMask);
|
log.fine("numLockMask = " + numLockMask);
|
||||||
@ -1789,11 +1788,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
}
|
}
|
||||||
awtLock();
|
awtLock();
|
||||||
try {
|
try {
|
||||||
if (timeoutTaskLog.isLoggable(Level.FINER)) {
|
if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
timeoutTaskLog.finer("Removing task " + task);
|
timeoutTaskLog.finer("Removing task " + task);
|
||||||
}
|
}
|
||||||
if (timeoutTasks == null) {
|
if (timeoutTasks == null) {
|
||||||
if (timeoutTaskLog.isLoggable(Level.FINER)) {
|
if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
timeoutTaskLog.finer("Task is not scheduled");
|
timeoutTaskLog.finer("Task is not scheduled");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1840,11 +1839,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
|
|
||||||
awtLock();
|
awtLock();
|
||||||
try {
|
try {
|
||||||
if (timeoutTaskLog.isLoggable(Level.FINER)) {
|
if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
timeoutTaskLog.log(Level.FINER, "XToolkit.schedule(): current time={0}" +
|
timeoutTaskLog.finer("XToolkit.schedule(): current time={0}" +
|
||||||
"; interval={1}" +
|
"; interval={1}" +
|
||||||
"; task being added={2}" + "; tasks before addition={3}", new Object[] {
|
"; task being added={2}" + "; tasks before addition={3}",
|
||||||
Long.valueOf(System.currentTimeMillis()), Long.valueOf(interval), task, timeoutTasks});
|
Long.valueOf(System.currentTimeMillis()), Long.valueOf(interval), task, timeoutTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeoutTasks == null) {
|
if (timeoutTasks == null) {
|
||||||
@ -1887,9 +1886,9 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
* Called from run() under awtLock.
|
* Called from run() under awtLock.
|
||||||
*/
|
*/
|
||||||
private static void callTimeoutTasks() {
|
private static void callTimeoutTasks() {
|
||||||
if (timeoutTaskLog.isLoggable(Level.FINER)) {
|
if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
timeoutTaskLog.log(Level.FINER, "XToolkit.callTimeoutTasks(): current time={0}" +
|
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
|
||||||
"; tasks={1}", new Object[] {Long.valueOf(System.currentTimeMillis()), timeoutTasks});
|
"; tasks={1}", Long.valueOf(System.currentTimeMillis()), timeoutTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeoutTasks == null || timeoutTasks.isEmpty()) {
|
if (timeoutTasks == null || timeoutTasks.isEmpty()) {
|
||||||
@ -1905,9 +1904,9 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
for (Iterator iter = tasks.iterator(); iter.hasNext();) {
|
for (Iterator iter = tasks.iterator(); iter.hasNext();) {
|
||||||
Runnable task = (Runnable)iter.next();
|
Runnable task = (Runnable)iter.next();
|
||||||
|
|
||||||
if (timeoutTaskLog.isLoggable(Level.FINER)) {
|
if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
timeoutTaskLog.log(Level.FINER, "XToolkit.callTimeoutTasks(): current time={0}" +
|
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
|
||||||
"; about to run task={1}", new Object[] {Long.valueOf(currentTime), task});
|
"; about to run task={1}", Long.valueOf(currentTime), task);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1980,7 +1979,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
long current_time_utc = System.currentTimeMillis();
|
long current_time_utc = System.currentTimeMillis();
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("reset_time=" + reset_time_utc + ", current_time=" + current_time_utc
|
log.finer("reset_time=" + reset_time_utc + ", current_time=" + current_time_utc
|
||||||
+ ", server_offset=" + server_offset + ", wrap_time=" + WRAP_TIME_MILLIS);
|
+ ", server_offset=" + server_offset + ", wrap_time=" + WRAP_TIME_MILLIS);
|
||||||
}
|
}
|
||||||
@ -1989,7 +1988,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
reset_time_utc = System.currentTimeMillis() - getCurrentServerTime();
|
reset_time_utc = System.currentTimeMillis() - getCurrentServerTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.finer("result = " + (reset_time_utc + server_offset));
|
log.finer("result = " + (reset_time_utc + server_offset));
|
||||||
}
|
}
|
||||||
return reset_time_utc + server_offset;
|
return reset_time_utc + server_offset;
|
||||||
@ -2074,14 +2073,14 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
|
|
||||||
if (prop == null) {
|
if (prop == null) {
|
||||||
backingStoreType = XConstants.NotUseful;
|
backingStoreType = XConstants.NotUseful;
|
||||||
if (backingStoreLog.isLoggable(Level.CONFIG)) {
|
if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
|
||||||
backingStoreLog.config("The system property sun.awt.backingStore is not set" +
|
backingStoreLog.config("The system property sun.awt.backingStore is not set" +
|
||||||
", by default backingStore=NotUseful");
|
", by default backingStore=NotUseful");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backingStoreLog.isLoggable(Level.CONFIG)) {
|
if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
|
||||||
backingStoreLog.config("The system property sun.awt.backingStore is " + prop);
|
backingStoreLog.config("The system property sun.awt.backingStore is " + prop);
|
||||||
}
|
}
|
||||||
prop = prop.toLowerCase();
|
prop = prop.toLowerCase();
|
||||||
@ -2093,7 +2092,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
backingStoreType = XConstants.NotUseful;
|
backingStoreType = XConstants.NotUseful;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backingStoreLog.isLoggable(Level.CONFIG)) {
|
if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
|
||||||
backingStoreLog.config("backingStore(as provided by the system property)=" +
|
backingStoreLog.config("backingStore(as provided by the system property)=" +
|
||||||
( backingStoreType == XConstants.NotUseful ? "NotUseful"
|
( backingStoreType == XConstants.NotUseful ? "NotUseful"
|
||||||
: backingStoreType == XConstants.WhenMapped ?
|
: backingStoreType == XConstants.WhenMapped ?
|
||||||
@ -2103,7 +2102,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
if (sun.java2d.x11.X11SurfaceData.isDgaAvailable()) {
|
if (sun.java2d.x11.X11SurfaceData.isDgaAvailable()) {
|
||||||
backingStoreType = XConstants.NotUseful;
|
backingStoreType = XConstants.NotUseful;
|
||||||
|
|
||||||
if (backingStoreLog.isLoggable(Level.CONFIG)) {
|
if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
|
||||||
backingStoreLog.config("DGA is available, backingStore=NotUseful");
|
backingStoreLog.config("DGA is available, backingStore=NotUseful");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2118,7 +2117,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
== XConstants.NotUseful) {
|
== XConstants.NotUseful) {
|
||||||
backingStoreType = XConstants.NotUseful;
|
backingStoreType = XConstants.NotUseful;
|
||||||
|
|
||||||
if (backingStoreLog.isLoggable(Level.CONFIG)) {
|
if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
|
||||||
backingStoreLog.config("Backing store is not available on the screen " +
|
backingStoreLog.config("Backing store is not available on the screen " +
|
||||||
i + ", backingStore=NotUseful");
|
i + ", backingStore=NotUseful");
|
||||||
}
|
}
|
||||||
@ -2364,7 +2363,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
// Wait for selection notify for oops on win
|
// Wait for selection notify for oops on win
|
||||||
long event_number = getEventNumber();
|
long event_number = getEventNumber();
|
||||||
XAtom atom = XAtom.get("WM_S0");
|
XAtom atom = XAtom.get("WM_S0");
|
||||||
eventLog.log(Level.FINER, "WM_S0 selection owner {0}", new Object[] {XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom())});
|
eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
|
||||||
XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
|
XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
|
||||||
XAtom.get("VERSION").getAtom(), oops.getAtom(),
|
XAtom.get("VERSION").getAtom(), oops.getAtom(),
|
||||||
win.getWindow(), XConstants.CurrentTime);
|
win.getWindow(), XConstants.CurrentTime);
|
||||||
@ -2390,7 +2389,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
// If selection update failed we can simply wait some time
|
// If selection update failed we can simply wait some time
|
||||||
// hoping some events will arrive
|
// hoping some events will arrive
|
||||||
awtUnlock();
|
awtUnlock();
|
||||||
eventLog.log(Level.FINEST, "Emergency sleep");
|
eventLog.finest("Emergency sleep");
|
||||||
try {
|
try {
|
||||||
Thread.sleep(WORKAROUND_SLEEP);
|
Thread.sleep(WORKAROUND_SLEEP);
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
@ -2402,7 +2401,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
|||||||
return getEventNumber() - event_number > 2;
|
return getEventNumber() - event_number > 2;
|
||||||
} finally {
|
} finally {
|
||||||
removeEventDispatcher(win.getWindow(), oops_waiter);
|
removeEventDispatcher(win.getWindow(), oops_waiter);
|
||||||
eventLog.log(Level.FINER, "Exiting syncNativeQueue");
|
eventLog.finer("Exiting syncNativeQueue");
|
||||||
awtUnlock();
|
awtUnlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,18 +31,17 @@ import java.awt.peer.TrayIconPeer;
|
|||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
import java.awt.image.*;
|
import java.awt.image.*;
|
||||||
import java.text.BreakIterator;
|
import java.text.BreakIterator;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class XTrayIconPeer implements TrayIconPeer,
|
public class XTrayIconPeer implements TrayIconPeer,
|
||||||
InfoWindow.Balloon.LiveArguments,
|
InfoWindow.Balloon.LiveArguments,
|
||||||
InfoWindow.Tooltip.LiveArguments
|
InfoWindow.Tooltip.LiveArguments
|
||||||
{
|
{
|
||||||
private static final Logger ctrLog = Logger.getLogger("sun.awt.X11.XTrayIconPeer.centering");
|
private static final PlatformLogger ctrLog = PlatformLogger.getLogger("sun.awt.X11.XTrayIconPeer.centering");
|
||||||
|
|
||||||
TrayIcon target;
|
TrayIcon target;
|
||||||
TrayIconEventProxy eventProxy;
|
TrayIconEventProxy eventProxy;
|
||||||
@ -107,9 +106,9 @@ public class XTrayIconPeer implements TrayIconPeer,
|
|||||||
|
|
||||||
XConfigureEvent ce = ev.get_xconfigure();
|
XConfigureEvent ce = ev.get_xconfigure();
|
||||||
|
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})",
|
ctrLog.fine("ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})",
|
||||||
new Object[] { XTrayIconPeer.this, ce.get_width(), ce.get_height(),
|
XTrayIconPeer.this, ce.get_width(), ce.get_height(),
|
||||||
ce.get_x(), ce.get_y(), old_x, old_y });
|
ce.get_x(), ce.get_y(), old_x, old_y);
|
||||||
|
|
||||||
// A workaround for Gnome/Metacity (it doesn't affect the behaviour on KDE).
|
// A workaround for Gnome/Metacity (it doesn't affect the behaviour on KDE).
|
||||||
// On Metacity the EmbeddedFrame's parent window bounds are larger
|
// On Metacity the EmbeddedFrame's parent window bounds are larger
|
||||||
@ -129,14 +128,14 @@ public class XTrayIconPeer implements TrayIconPeer,
|
|||||||
// If both the height and the width differ from the fixed size then WM
|
// If both the height and the width differ from the fixed size then WM
|
||||||
// must level at least one side to the fixed size. For some reason it may take
|
// must level at least one side to the fixed size. For some reason it may take
|
||||||
// a few hops (even after reparenting) and we have to skip the intermediate ones.
|
// a few hops (even after reparenting) and we have to skip the intermediate ones.
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Skipping as intermediate resizing.",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Skipping as intermediate resizing.",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else if (ce.get_height() > TRAY_ICON_HEIGHT) {
|
} else if (ce.get_height() > TRAY_ICON_HEIGHT) {
|
||||||
|
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Centering by \"Y\".",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"Y\".",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
|
|
||||||
XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
|
XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
|
||||||
ce.get_x(),
|
ce.get_x(),
|
||||||
@ -148,8 +147,8 @@ public class XTrayIconPeer implements TrayIconPeer,
|
|||||||
|
|
||||||
} else if (ce.get_width() > TRAY_ICON_WIDTH) {
|
} else if (ce.get_width() > TRAY_ICON_WIDTH) {
|
||||||
|
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Centering by \"X\".",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"X\".",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
|
|
||||||
XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
|
XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
|
||||||
ce.get_x()+ce.get_width()/2 - TRAY_ICON_WIDTH/2,
|
ce.get_x()+ce.get_width()/2 - TRAY_ICON_WIDTH/2,
|
||||||
@ -166,8 +165,8 @@ public class XTrayIconPeer implements TrayIconPeer,
|
|||||||
|
|
||||||
if (ex_height != 0) {
|
if (ex_height != 0) {
|
||||||
|
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
|
|
||||||
XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
|
XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
|
||||||
ce.get_x(),
|
ce.get_x(),
|
||||||
@ -175,15 +174,15 @@ public class XTrayIconPeer implements TrayIconPeer,
|
|||||||
|
|
||||||
} else if (ex_width != 0) {
|
} else if (ex_width != 0) {
|
||||||
|
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
|
|
||||||
XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
|
XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
|
||||||
ce.get_x() + ex_width/2 - TRAY_ICON_WIDTH/2,
|
ce.get_x() + ex_width/2 - TRAY_ICON_WIDTH/2,
|
||||||
ce.get_y());
|
ce.get_y());
|
||||||
} else {
|
} else {
|
||||||
ctrLog.log(Level.FINE, "ConfigureNotify on parent of {0}. Move detected. Skipping.",
|
ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Skipping.",
|
||||||
XTrayIconPeer.this);
|
XTrayIconPeer.this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
old_x = ce.get_x();
|
old_x = ce.get_x();
|
||||||
|
@ -27,11 +27,10 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||||
final static Logger log = Logger.getLogger("sun.awt.X11.XWINProtocol");
|
final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWINProtocol");
|
||||||
|
|
||||||
/* Gnome WM spec */
|
/* Gnome WM spec */
|
||||||
XAtom XA_WIN_SUPPORTING_WM_CHECK = XAtom.get("_WIN_SUPPORTING_WM_CHECK");
|
XAtom XA_WIN_SUPPORTING_WM_CHECK = XAtom.get("_WIN_SUPPORTING_WM_CHECK");
|
||||||
@ -64,7 +63,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
req.set_format(32);
|
req.set_format(32);
|
||||||
req.set_data(0, (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT));
|
req.set_data(0, (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT));
|
||||||
req.set_data(1, win_state);
|
req.set_data(1, win_state);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Sending WIN_STATE to root to change the state to " + win_state);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Sending WIN_STATE to root to change the state to " + win_state);
|
||||||
try {
|
try {
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
||||||
@ -112,7 +111,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
win_state &= ~WIN_STATE_MAXIMIZED_HORIZ;
|
win_state &= ~WIN_STATE_MAXIMIZED_HORIZ;
|
||||||
}
|
}
|
||||||
if ((old_win_state ^ win_state) != 0) {
|
if ((old_win_state ^ win_state) != 0) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state);
|
||||||
XA_WIN_STATE.setCard32Property(window, win_state);
|
XA_WIN_STATE.setCard32Property(window, win_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,7 +156,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
req.set_data(0, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
|
req.set_data(0, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
|
||||||
req.set_data(1, 0);
|
req.set_data(1, 0);
|
||||||
req.set_data(2, 0);
|
req.set_data(2, 0);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting layer " + layer + " by root message : " + req);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting layer " + layer + " by root message : " + req);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
|
||||||
@ -172,7 +171,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
}
|
}
|
||||||
req.dispose();
|
req.dispose();
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting layer property to " + layer);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting layer property to " + layer);
|
||||||
XA_WIN_LAYER.setCard32Property(window, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
|
XA_WIN_LAYER.setCard32Property(window, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,7 +197,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
}
|
}
|
||||||
WinWindow = checkAnchor(XA_WIN_SUPPORTING_WM_CHECK, XAtom.XA_CARDINAL);
|
WinWindow = checkAnchor(XA_WIN_SUPPORTING_WM_CHECK, XAtom.XA_CARDINAL);
|
||||||
supportChecked = true;
|
supportChecked = true;
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### " + this + " is active: " + (WinWindow != 0));
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " is active: " + (WinWindow != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean active() {
|
boolean active() {
|
||||||
@ -207,13 +206,13 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
|||||||
}
|
}
|
||||||
boolean doStateProtocol() {
|
boolean doStateProtocol() {
|
||||||
boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_STATE);
|
boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_STATE);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### " + this + " supports state: " + res);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " supports state: " + res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean doLayerProtocol() {
|
boolean doLayerProtocol() {
|
||||||
boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_LAYER);
|
boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_LAYER);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("### " + this + " supports layer: " + res);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " supports layer: " + res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ import java.awt.Rectangle;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class incapsulating knowledge about window managers in general
|
* Class incapsulating knowledge about window managers in general
|
||||||
@ -49,9 +49,9 @@ import java.util.regex.Pattern;
|
|||||||
final class XWM
|
final class XWM
|
||||||
{
|
{
|
||||||
|
|
||||||
private final static Logger log = Logger.getLogger("sun.awt.X11.XWM");
|
private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWM");
|
||||||
private final static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XWM");
|
private final static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWM");
|
||||||
private final static Logger stateLog = Logger.getLogger("sun.awt.X11.states.XWM");
|
private final static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states.XWM");
|
||||||
|
|
||||||
static final XAtom XA_MWM_HINTS = new XAtom();
|
static final XAtom XA_MWM_HINTS = new XAtom();
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ final class XWM
|
|||||||
XWM(int WMID) {
|
XWM(int WMID) {
|
||||||
this.WMID = WMID;
|
this.WMID = WMID;
|
||||||
initializeProtocols();
|
initializeProtocols();
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Window manager: " + toString());
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Window manager: " + toString());
|
||||||
}
|
}
|
||||||
int getID() {
|
int getID() {
|
||||||
return WMID;
|
return WMID;
|
||||||
@ -246,7 +246,7 @@ final class XWM
|
|||||||
* having a window manager running. I.e. it does not reparent
|
* having a window manager running. I.e. it does not reparent
|
||||||
* top level shells.
|
* top level shells.
|
||||||
*/
|
*/
|
||||||
if (insLog.isLoggable(Level.FINE)) {
|
if (insLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
insLog.finer("eXcursion means NO_WM");
|
insLog.finer("eXcursion means NO_WM");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -264,7 +264,7 @@ final class XWM
|
|||||||
long selection_owner =
|
long selection_owner =
|
||||||
XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
|
XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
|
||||||
XAtom.get(selection_name).getAtom());
|
XAtom.get(selection_name).getAtom());
|
||||||
if (insLog.isLoggable(Level.FINE)) {
|
if (insLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
insLog.finer("selection owner of " + selection_name
|
insLog.finer("selection owner of " + selection_name
|
||||||
+ " is " + selection_owner);
|
+ " is " + selection_owner);
|
||||||
}
|
}
|
||||||
@ -293,7 +293,7 @@ final class XWM
|
|||||||
XToolkit.getDefaultRootWindow(),
|
XToolkit.getDefaultRootWindow(),
|
||||||
XConstants.CWEventMask,
|
XConstants.CWEventMask,
|
||||||
substruct.pData);
|
substruct.pData);
|
||||||
if (insLog.isLoggable(Level.FINE)) {
|
if (insLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
insLog.finer("It looks like there is no WM thus NO_WM");
|
insLog.finer("It looks like there is no WM thus NO_WM");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ final class XWM
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -401,7 +401,7 @@ final class XWM
|
|||||||
static boolean isCDE() {
|
static boolean isCDE() {
|
||||||
|
|
||||||
if (!XA_DT_SM_WINDOW_INFO.isInterned()) {
|
if (!XA_DT_SM_WINDOW_INFO.isInterned()) {
|
||||||
log.log(Level.FINER, "{0} is not interned", new Object[] {XA_DT_SM_WINDOW_INFO});
|
log.finer("{0} is not interned", XA_DT_SM_WINDOW_INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ final class XWM
|
|||||||
|
|
||||||
/* Now check that this window has _DT_SM_STATE_INFO (ignore contents) */
|
/* Now check that this window has _DT_SM_STATE_INFO (ignore contents) */
|
||||||
if (!XA_DT_SM_STATE_INFO.isInterned()) {
|
if (!XA_DT_SM_STATE_INFO.isInterned()) {
|
||||||
log.log(Level.FINER, "{0} is not interned", new Object[] {XA_DT_SM_STATE_INFO});
|
log.finer("{0} is not interned", XA_DT_SM_STATE_INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
WindowPropertyGetter getter2 =
|
WindowPropertyGetter getter2 =
|
||||||
@ -596,7 +596,7 @@ final class XWM
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!XA_ICEWM_WINOPTHINT.isInterned()) {
|
if (!XA_ICEWM_WINOPTHINT.isInterned()) {
|
||||||
log.log(Level.FINER, "{0} is not interned", new Object[] {XA_ICEWM_WINOPTHINT});
|
log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ final class XWM
|
|||||||
*/
|
*/
|
||||||
static boolean isIceWM() {
|
static boolean isIceWM() {
|
||||||
if (!XA_ICEWM_WINOPTHINT.isInterned()) {
|
if (!XA_ICEWM_WINOPTHINT.isInterned()) {
|
||||||
log.log(Level.FINER, "{0} is not interned", new Object[] {XA_ICEWM_WINOPTHINT});
|
log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ final class XWM
|
|||||||
return wm;
|
return wm;
|
||||||
}
|
}
|
||||||
static int getWMID() {
|
static int getWMID() {
|
||||||
if (insLog.isLoggable(Level.FINEST)) {
|
if (insLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
insLog.finest("awt_wmgr = " + awt_wmgr);
|
insLog.finest("awt_wmgr = " + awt_wmgr);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -718,7 +718,7 @@ final class XWM
|
|||||||
// Later, WM will initialize its own version of protocol
|
// Later, WM will initialize its own version of protocol
|
||||||
XNETProtocol l_net_protocol = g_net_protocol = new XNETProtocol();
|
XNETProtocol l_net_protocol = g_net_protocol = new XNETProtocol();
|
||||||
l_net_protocol.detect();
|
l_net_protocol.detect();
|
||||||
if (log.isLoggable(Level.FINE) && l_net_protocol.active()) {
|
if (log.isLoggable(PlatformLogger.FINE) && l_net_protocol.active()) {
|
||||||
log.fine("_NET_WM_NAME is " + l_net_protocol.getWMName());
|
log.fine("_NET_WM_NAME is " + l_net_protocol.getWMName());
|
||||||
}
|
}
|
||||||
XWINProtocol win = g_win_protocol = new XWINProtocol();
|
XWINProtocol win = g_win_protocol = new XWINProtocol();
|
||||||
@ -798,7 +798,7 @@ final class XWM
|
|||||||
}
|
}
|
||||||
|
|
||||||
hints.set_flags(hints.get_flags() & ~mask);
|
hints.set_flags(hints.get_flags() & ~mask);
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
|
||||||
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
|
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
|
||||||
window.getWindow(),
|
window.getWindow(),
|
||||||
hints.pData);
|
hints.pData);
|
||||||
@ -855,7 +855,7 @@ final class XWM
|
|||||||
|
|
||||||
XAtomList decorDel = new XAtomList();
|
XAtomList decorDel = new XAtomList();
|
||||||
decorations = normalizeMotifDecor(decorations);
|
decorations = normalizeMotifDecor(decorations);
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
|
||||||
if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
|
if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
|
||||||
decorDel.add(XA_OL_DECOR_HEADER);
|
decorDel.add(XA_OL_DECOR_HEADER);
|
||||||
}
|
}
|
||||||
@ -872,7 +872,7 @@ final class XWM
|
|||||||
insLog.finer("Deleting OL_DECOR");
|
insLog.finer("Deleting OL_DECOR");
|
||||||
XA_OL_DECOR_DEL.DeleteProperty(window);
|
XA_OL_DECOR_DEL.DeleteProperty(window);
|
||||||
} else {
|
} else {
|
||||||
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting OL_DECOR to " + decorDel);
|
if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + decorDel);
|
||||||
XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
|
XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -900,7 +900,7 @@ final class XWM
|
|||||||
hints.set_functions(functions);
|
hints.set_functions(functions);
|
||||||
hints.set_decorations(decorations);
|
hints.set_decorations(decorations);
|
||||||
|
|
||||||
if (stateLog.isLoggable(Level.FINER)) stateLog.finer("Setting MWM_HINTS to " + hints);
|
if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Setting MWM_HINTS to " + hints);
|
||||||
window.setMWMHints(hints);
|
window.setMWMHints(hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -962,7 +962,7 @@ final class XWM
|
|||||||
* Make specified shell resizable.
|
* Make specified shell resizable.
|
||||||
*/
|
*/
|
||||||
static void setShellResizable(XDecoratedPeer window) {
|
static void setShellResizable(XDecoratedPeer window) {
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell resizable " + window);
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell resizable " + window);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
Rectangle shellBounds = window.getShellBounds();
|
Rectangle shellBounds = window.getShellBounds();
|
||||||
@ -992,7 +992,7 @@ final class XWM
|
|||||||
static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
|
static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
|
||||||
boolean justChangeSize)
|
boolean justChangeSize)
|
||||||
{
|
{
|
||||||
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
|
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
|
||||||
", shellBounds " + shellBounds +", just change size: " + justChangeSize);
|
", shellBounds " + shellBounds +", just change size: " + justChangeSize);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
@ -1285,7 +1285,7 @@ final class XWM
|
|||||||
res = defaultInsets;
|
res = defaultInsets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (insLog.isLoggable(Level.FINEST)) insLog.finest("WM guessed insets: " + res);
|
if (insLog.isLoggable(PlatformLogger.FINEST)) insLog.finest("WM guessed insets: " + res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1354,7 +1354,7 @@ final class XWM
|
|||||||
XNETProtocol net_protocol = getWM().getNETProtocol();
|
XNETProtocol net_protocol = getWM().getNETProtocol();
|
||||||
if (net_protocol != null && net_protocol.active()) {
|
if (net_protocol != null && net_protocol.active()) {
|
||||||
Insets insets = getInsetsFromProp(window, XA_NET_FRAME_EXTENTS);
|
Insets insets = getInsetsFromProp(window, XA_NET_FRAME_EXTENTS);
|
||||||
insLog.log(Level.FINE, "_NET_FRAME_EXTENTS: {0}", insets);
|
insLog.fine("_NET_FRAME_EXTENTS: {0}", insets);
|
||||||
|
|
||||||
if (insets != null) {
|
if (insets != null) {
|
||||||
return insets;
|
return insets;
|
||||||
@ -1495,7 +1495,7 @@ final class XWM
|
|||||||
* [mwm, e!, kwin, fvwm2 ... ]
|
* [mwm, e!, kwin, fvwm2 ... ]
|
||||||
*/
|
*/
|
||||||
Insets correctWM = XWM.getInsetsFromExtents(window);
|
Insets correctWM = XWM.getInsetsFromExtents(window);
|
||||||
insLog.log(Level.FINER, "Got insets from property: {0}", correctWM);
|
insLog.finer("Got insets from property: {0}", correctWM);
|
||||||
|
|
||||||
if (correctWM == null) {
|
if (correctWM == null) {
|
||||||
correctWM = new Insets(0,0,0,0);
|
correctWM = new Insets(0,0,0,0);
|
||||||
@ -1556,7 +1556,7 @@ final class XWM
|
|||||||
}
|
}
|
||||||
case XWM.OTHER_WM:
|
case XWM.OTHER_WM:
|
||||||
default: { /* this is very similar to the E! case above */
|
default: { /* this is very similar to the E! case above */
|
||||||
insLog.log(Level.FINEST, "Getting correct insets for OTHER_WM/default, parent: {0}", parent);
|
insLog.finest("Getting correct insets for OTHER_WM/default, parent: {0}", parent);
|
||||||
syncTopLevelPos(parent, lwinAttr);
|
syncTopLevelPos(parent, lwinAttr);
|
||||||
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
|
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
|
||||||
window, lwinAttr.pData);
|
window, lwinAttr.pData);
|
||||||
@ -1583,8 +1583,8 @@ final class XWM
|
|||||||
&& lwinAttr.get_width()+2*lwinAttr.get_border_width() == pattr.get_width()
|
&& lwinAttr.get_width()+2*lwinAttr.get_border_width() == pattr.get_width()
|
||||||
&& lwinAttr.get_height()+2*lwinAttr.get_border_width() == pattr.get_height())
|
&& lwinAttr.get_height()+2*lwinAttr.get_border_width() == pattr.get_height())
|
||||||
{
|
{
|
||||||
insLog.log(Level.FINEST, "Double reparenting detected, pattr({2})={0}, lwinAttr({3})={1}",
|
insLog.finest("Double reparenting detected, pattr({2})={0}, lwinAttr({3})={1}",
|
||||||
new Object[] {lwinAttr, pattr, parent, window});
|
lwinAttr, pattr, parent, window);
|
||||||
lwinAttr.set_x(pattr.get_x());
|
lwinAttr.set_x(pattr.get_x());
|
||||||
lwinAttr.set_y(pattr.get_y());
|
lwinAttr.set_y(pattr.get_y());
|
||||||
lwinAttr.set_border_width(lwinAttr.get_border_width()+pattr.get_border_width());
|
lwinAttr.set_border_width(lwinAttr.get_border_width()+pattr.get_border_width());
|
||||||
@ -1611,8 +1611,8 @@ final class XWM
|
|||||||
* widths and inner/outer distinction, so for the time
|
* widths and inner/outer distinction, so for the time
|
||||||
* being, just ignore it.
|
* being, just ignore it.
|
||||||
*/
|
*/
|
||||||
insLog.log(Level.FINEST, "Attrs before calculation: pattr({2})={0}, lwinAttr({3})={1}",
|
insLog.finest("Attrs before calculation: pattr({2})={0}, lwinAttr({3})={1}",
|
||||||
new Object[] {lwinAttr, pattr, parent, window});
|
lwinAttr, pattr, parent, window);
|
||||||
correctWM = new Insets(lwinAttr.get_y() + lwinAttr.get_border_width(),
|
correctWM = new Insets(lwinAttr.get_y() + lwinAttr.get_border_width(),
|
||||||
lwinAttr.get_x() + lwinAttr.get_border_width(),
|
lwinAttr.get_x() + lwinAttr.get_border_width(),
|
||||||
pattr.get_height() - (lwinAttr.get_y() + lwinAttr.get_height() + 2*lwinAttr.get_border_width()),
|
pattr.get_height() - (lwinAttr.get_y() + lwinAttr.get_height() + 2*lwinAttr.get_border_width()),
|
||||||
|
@ -35,8 +35,7 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
|
|
||||||
@ -46,11 +45,11 @@ import sun.java2d.SunGraphics2D;
|
|||||||
import sun.java2d.SurfaceData;
|
import sun.java2d.SurfaceData;
|
||||||
|
|
||||||
public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||||
private static Logger log = Logger.getLogger("sun.awt.X11.XWindow");
|
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWindow");
|
||||||
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XWindow");
|
private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWindow");
|
||||||
private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XWindow");
|
private static PlatformLogger eventLog = PlatformLogger.getLogger("sun.awt.X11.event.XWindow");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindow");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XWindow");
|
||||||
private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XWindow");
|
private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XWindow");
|
||||||
/* If a motion comes in while a multi-click is pending,
|
/* If a motion comes in while a multi-click is pending,
|
||||||
* allow a smudge factor so that moving the mouse by a small
|
* allow a smudge factor so that moving the mouse by a small
|
||||||
* amount does not wipe out the multi-click state variables.
|
* amount does not wipe out the multi-click state variables.
|
||||||
@ -414,7 +413,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
((Component)e.getSource()).dispatchEvent(e);
|
((Component)e.getSource()).dispatchEvent(e);
|
||||||
}
|
}
|
||||||
}, PeerEvent.ULTIMATE_PRIORITY_EVENT);
|
}, PeerEvent.ULTIMATE_PRIORITY_EVENT);
|
||||||
if (focusLog.isLoggable(Level.FINER) && (e instanceof FocusEvent)) focusLog.finer("Sending " + e);
|
if (focusLog.isLoggable(PlatformLogger.FINER) && (e instanceof FocusEvent)) focusLog.finer("Sending " + e);
|
||||||
XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), pe);
|
XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), pe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,7 +669,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (eventLog.isLoggable(Level.FINE)) eventLog.fine(xbe.toString());
|
if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(xbe.toString());
|
||||||
long when;
|
long when;
|
||||||
int modifiers;
|
int modifiers;
|
||||||
boolean popupTrigger = false;
|
boolean popupTrigger = false;
|
||||||
@ -704,7 +703,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
/*
|
/*
|
||||||
multiclick checking
|
multiclick checking
|
||||||
*/
|
*/
|
||||||
if (eventLog.isLoggable(Level.FINEST)) eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
|
||||||
+ lastButton + ", lastTime " + lastTime + ", multiClickTime "
|
+ lastButton + ", lastTime " + lastTime + ", multiClickTime "
|
||||||
+ XToolkit.getMultiClickTime());
|
+ XToolkit.getMultiClickTime());
|
||||||
if (lastWindow == this && lastButton == lbutton && (when - lastTime) < XToolkit.getMultiClickTime()) {
|
if (lastWindow == this && lastButton == lbutton && (when - lastTime) < XToolkit.getMultiClickTime()) {
|
||||||
@ -895,7 +894,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
super.handleXCrossingEvent(xev);
|
super.handleXCrossingEvent(xev);
|
||||||
XCrossingEvent xce = xev.get_xcrossing();
|
XCrossingEvent xce = xev.get_xcrossing();
|
||||||
|
|
||||||
if (eventLog.isLoggable(Level.FINEST)) eventLog.finest(xce.toString());
|
if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest(xce.toString());
|
||||||
|
|
||||||
if (xce.get_type() == XConstants.EnterNotify) {
|
if (xce.get_type() == XConstants.EnterNotify) {
|
||||||
enterNotify(xce.get_window());
|
enterNotify(xce.get_window());
|
||||||
@ -997,8 +996,8 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
Rectangle oldBounds = getBounds();
|
Rectangle oldBounds = getBounds();
|
||||||
|
|
||||||
super.handleConfigureNotifyEvent(xev);
|
super.handleConfigureNotifyEvent(xev);
|
||||||
insLog.log(Level.FINER, "Configure, {0}, event disabled: {1}",
|
insLog.finer("Configure, {0}, event disabled: {1}",
|
||||||
new Object[] {xev.get_xconfigure(), isEventDisabled(xev)});
|
xev.get_xconfigure(), isEventDisabled(xev));
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1017,7 +1016,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
|
|
||||||
public void handleMapNotifyEvent(XEvent xev) {
|
public void handleMapNotifyEvent(XEvent xev) {
|
||||||
super.handleMapNotifyEvent(xev);
|
super.handleMapNotifyEvent(xev);
|
||||||
log.log(Level.FINE, "Mapped {0}", new Object[] {this});
|
log.fine("Mapped {0}", this);
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1074,7 +1073,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
public void handleKeyPress(XEvent xev) {
|
public void handleKeyPress(XEvent xev) {
|
||||||
super.handleKeyPress(xev);
|
super.handleKeyPress(xev);
|
||||||
XKeyEvent ev = xev.get_xkey();
|
XKeyEvent ev = xev.get_xkey();
|
||||||
if (eventLog.isLoggable(Level.FINE)) eventLog.fine(ev.toString());
|
if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(ev.toString());
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1087,14 +1086,14 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
int unicodeKey = 0;
|
int unicodeKey = 0;
|
||||||
keysym[0] = XConstants.NoSymbol;
|
keysym[0] = XConstants.NoSymbol;
|
||||||
|
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
logIncomingKeyEvent( ev );
|
logIncomingKeyEvent( ev );
|
||||||
}
|
}
|
||||||
if ( //TODO check if there's an active input method instance
|
if ( //TODO check if there's an active input method instance
|
||||||
// without calling a native method. Is it necessary though?
|
// without calling a native method. Is it necessary though?
|
||||||
haveCurrentX11InputMethodInstance()) {
|
haveCurrentX11InputMethodInstance()) {
|
||||||
if (x11inputMethodLookupString(ev.pData, keysym)) {
|
if (x11inputMethodLookupString(ev.pData, keysym)) {
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
keyEventLog.fine("--XWindow.java XIM did process event; return; dec keysym processed:"+(keysym[0])+
|
keyEventLog.fine("--XWindow.java XIM did process event; return; dec keysym processed:"+(keysym[0])+
|
||||||
"; hex keysym processed:"+Long.toHexString(keysym[0])
|
"; hex keysym processed:"+Long.toHexString(keysym[0])
|
||||||
);
|
);
|
||||||
@ -1102,7 +1101,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
return;
|
return;
|
||||||
}else {
|
}else {
|
||||||
unicodeKey = keysymToUnicode( keysym[0], ev.get_state() );
|
unicodeKey = keysymToUnicode( keysym[0], ev.get_state() );
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
keyEventLog.fine("--XWindow.java XIM did NOT process event, hex keysym:"+Long.toHexString(keysym[0])+"\n"+
|
keyEventLog.fine("--XWindow.java XIM did NOT process event, hex keysym:"+Long.toHexString(keysym[0])+"\n"+
|
||||||
" unicode key:"+Integer.toHexString((int)unicodeKey));
|
" unicode key:"+Integer.toHexString((int)unicodeKey));
|
||||||
}
|
}
|
||||||
@ -1112,7 +1111,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
// Produce do-it-yourself keysym and perhaps unicode character.
|
// Produce do-it-yourself keysym and perhaps unicode character.
|
||||||
keysym[0] = xkeycodeToKeysym(ev);
|
keysym[0] = xkeycodeToKeysym(ev);
|
||||||
unicodeKey = keysymToUnicode( keysym[0], ev.get_state() );
|
unicodeKey = keysymToUnicode( keysym[0], ev.get_state() );
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
keyEventLog.fine("--XWindow.java XIM is absent; hex keysym:"+Long.toHexString(keysym[0])+"\n"+
|
keyEventLog.fine("--XWindow.java XIM is absent; hex keysym:"+Long.toHexString(keysym[0])+"\n"+
|
||||||
" unicode key:"+Integer.toHexString((int)unicodeKey));
|
" unicode key:"+Integer.toHexString((int)unicodeKey));
|
||||||
}
|
}
|
||||||
@ -1135,7 +1134,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
// is undefined, we still have a guess of what has been engraved on a keytop.
|
// is undefined, we still have a guess of what has been engraved on a keytop.
|
||||||
int unicodeFromPrimaryKeysym = keysymToUnicode( xkeycodeToPrimaryKeysym(ev) ,0);
|
int unicodeFromPrimaryKeysym = keysymToUnicode( xkeycodeToPrimaryKeysym(ev) ,0);
|
||||||
|
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
keyEventLog.fine(">>>Fire Event:"+
|
keyEventLog.fine(">>>Fire Event:"+
|
||||||
(ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+
|
(ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+
|
||||||
"jkeycode:decimal="+jkc.getJavaKeycode()+
|
"jkeycode:decimal="+jkc.getJavaKeycode()+
|
||||||
@ -1178,7 +1177,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
public void handleKeyRelease(XEvent xev) {
|
public void handleKeyRelease(XEvent xev) {
|
||||||
super.handleKeyRelease(xev);
|
super.handleKeyRelease(xev);
|
||||||
XKeyEvent ev = xev.get_xkey();
|
XKeyEvent ev = xev.get_xkey();
|
||||||
if (eventLog.isLoggable(Level.FINE)) eventLog.fine(ev.toString());
|
if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(ev.toString());
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1190,7 +1189,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
int unicodeKey = 0;
|
int unicodeKey = 0;
|
||||||
keysym[0] = XConstants.NoSymbol;
|
keysym[0] = XConstants.NoSymbol;
|
||||||
|
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
logIncomingKeyEvent( ev );
|
logIncomingKeyEvent( ev );
|
||||||
}
|
}
|
||||||
// Keysym should be converted to Unicode, if possible and necessary,
|
// Keysym should be converted to Unicode, if possible and necessary,
|
||||||
@ -1201,7 +1200,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
if( jkc == null ) {
|
if( jkc == null ) {
|
||||||
jkc = new XKeysym.Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDEFINED, java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN);
|
jkc = new XKeysym.Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDEFINED, java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN);
|
||||||
}
|
}
|
||||||
if (keyEventLog.isLoggable(Level.FINE)) {
|
if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
keyEventLog.fine(">>>Fire Event:"+
|
keyEventLog.fine(">>>Fire Event:"+
|
||||||
(ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+
|
(ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+
|
||||||
"jkeycode:decimal="+jkc.getJavaKeycode()+
|
"jkeycode:decimal="+jkc.getJavaKeycode()+
|
||||||
@ -1333,10 +1332,10 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
void updateSizeHints(int x, int y, int width, int height) {
|
void updateSizeHints(int x, int y, int width, int height) {
|
||||||
long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
|
long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
|
||||||
if (!isResizable()) {
|
if (!isResizable()) {
|
||||||
log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
|
log.finer("Window {0} is not resizable", this);
|
||||||
flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
|
flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
|
||||||
} else {
|
} else {
|
||||||
log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
|
log.finer("Window {0} is resizable", this);
|
||||||
}
|
}
|
||||||
setSizeHints(flags, x, y, width, height);
|
setSizeHints(flags, x, y, width, height);
|
||||||
}
|
}
|
||||||
@ -1344,10 +1343,10 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
|
|||||||
void updateSizeHints(int x, int y) {
|
void updateSizeHints(int x, int y) {
|
||||||
long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
|
long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
|
||||||
if (!isResizable()) {
|
if (!isResizable()) {
|
||||||
log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
|
log.finer("Window {0} is not resizable", this);
|
||||||
flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
|
flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
|
||||||
} else {
|
} else {
|
||||||
log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
|
log.finer("Window {0} is resizable", this);
|
||||||
}
|
}
|
||||||
setSizeHints(flags, x, y, width, height);
|
setSizeHints(flags, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
@ -41,8 +41,7 @@ import java.util.Iterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.AWTAccessor;
|
import sun.awt.AWTAccessor;
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
@ -58,11 +57,11 @@ import sun.java2d.pipe.Region;
|
|||||||
class XWindowPeer extends XPanelPeer implements WindowPeer,
|
class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||||
DisplayChangedListener {
|
DisplayChangedListener {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11.XWindowPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWindowPeer");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindowPeer");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XWindowPeer");
|
||||||
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XWindowPeer");
|
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWindowPeer");
|
||||||
private static final Logger grabLog = Logger.getLogger("sun.awt.X11.grab.XWindowPeer");
|
private static final PlatformLogger grabLog = PlatformLogger.getLogger("sun.awt.X11.grab.XWindowPeer");
|
||||||
private static final Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XWindowPeer");
|
private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XWindowPeer");
|
||||||
|
|
||||||
// should be synchronized on awtLock
|
// should be synchronized on awtLock
|
||||||
private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
|
private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
|
||||||
@ -201,7 +200,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
Window owner = t_window.getOwner();
|
Window owner = t_window.getOwner();
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
ownerPeer = (XWindowPeer)owner.getPeer();
|
ownerPeer = (XWindowPeer)owner.getPeer();
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.fine("Owner is " + owner);
|
focusLog.fine("Owner is " + owner);
|
||||||
focusLog.fine("Owner peer is " + ownerPeer);
|
focusLog.fine("Owner peer is " + ownerPeer);
|
||||||
focusLog.fine("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
|
focusLog.fine("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
|
||||||
@ -214,7 +213,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
// Set WM_TRANSIENT_FOR
|
// Set WM_TRANSIENT_FOR
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
|
if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
|
||||||
+ " for " + Long.toHexString(ownerWindow));
|
+ " for " + Long.toHexString(ownerWindow));
|
||||||
setToplevelTransientFor(this, ownerPeer, false, true);
|
setToplevelTransientFor(this, ownerPeer, false, true);
|
||||||
|
|
||||||
@ -259,7 +258,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
for (Iterator<Image> i = iconImages.iterator(); i.hasNext(); ) {
|
for (Iterator<Image> i = iconImages.iterator(); i.hasNext(); ) {
|
||||||
Image image = i.next();
|
Image image = i.next();
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("XWindowPeer.updateIconImages: Skipping the image passed into Java because it's null.");
|
log.finest("XWindowPeer.updateIconImages: Skipping the image passed into Java because it's null.");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -268,7 +267,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
try {
|
try {
|
||||||
iconInfo = new XIconInfo(image);
|
iconInfo = new XIconInfo(image);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon.");
|
log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon.");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -339,9 +338,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iconLog.isLoggable(Level.FINEST)) {
|
if (iconLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
iconLog.log(Level.FINEST, ">>> Length_ of buffer of icons data: " + totalLength +
|
iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength +
|
||||||
", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
|
", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -351,10 +350,10 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
* Dumps each icon from the list
|
* Dumps each icon from the list
|
||||||
*/
|
*/
|
||||||
static void dumpIcons(java.util.List<XIconInfo> icons) {
|
static void dumpIcons(java.util.List<XIconInfo> icons) {
|
||||||
if (iconLog.isLoggable(Level.FINEST)) {
|
if (iconLog.isLoggable(PlatformLogger.FINEST)) {
|
||||||
iconLog.log(Level.FINEST, ">>> Sizes of icon images:");
|
iconLog.finest(">>> Sizes of icon images:");
|
||||||
for (Iterator<XIconInfo> i = icons.iterator(); i.hasNext(); ) {
|
for (Iterator<XIconInfo> i = icons.iterator(); i.hasNext(); ) {
|
||||||
iconLog.log(Level.FINEST, " {0}", i.next());
|
iconLog.finest(" {0}", i.next());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,7 +630,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
|
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,7 +667,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newScreenNum != curScreenNum) {
|
if (newScreenNum != curScreenNum) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.finest("XWindowPeer: Moved to a new screen");
|
log.finest("XWindowPeer: Moved to a new screen");
|
||||||
}
|
}
|
||||||
executeDisplayChangedOnEDT(newGC);
|
executeDisplayChangedOnEDT(newGC);
|
||||||
@ -743,7 +742,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
// override_redirect all we can do is check whether our parent
|
// override_redirect all we can do is check whether our parent
|
||||||
// is active. If it is - we can freely synthesize focus transfer.
|
// is active. If it is - we can freely synthesize focus transfer.
|
||||||
// Luckily, this logic is already implemented in requestWindowFocus.
|
// Luckily, this logic is already implemented in requestWindowFocus.
|
||||||
if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Requesting window focus");
|
if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Requesting window focus");
|
||||||
requestWindowFocus(time, timeProvided);
|
requestWindowFocus(time, timeProvided);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,7 +768,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
public void handleFocusEvent(XEvent xev) {
|
public void handleFocusEvent(XEvent xev) {
|
||||||
XFocusChangeEvent xfe = xev.get_xfocus();
|
XFocusChangeEvent xfe = xev.get_xfocus();
|
||||||
FocusEvent fe;
|
FocusEvent fe;
|
||||||
focusLog.log(Level.FINE, "{0}", new Object[] {xfe});
|
focusLog.fine("{0}", xfe);
|
||||||
if (isEventDisabled(xev)) {
|
if (isEventDisabled(xev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -952,7 +951,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlwaysOnTop() {
|
private void updateAlwaysOnTop() {
|
||||||
log.log(Level.FINE, "Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
|
log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
|
||||||
XWM.getWM().setLayer(this,
|
XWM.getWM().setLayer(this,
|
||||||
alwaysOnTop ?
|
alwaysOnTop ?
|
||||||
XLayerProtocol.LAYER_ALWAYS_ON_TOP :
|
XLayerProtocol.LAYER_ALWAYS_ON_TOP :
|
||||||
@ -1388,7 +1387,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
synchronized(getStateLock()) {
|
synchronized(getStateLock()) {
|
||||||
XDialogPeer blockerPeer = (XDialogPeer) ComponentAccessor.getPeer(d);
|
XDialogPeer blockerPeer = (XDialogPeer) ComponentAccessor.getPeer(d);
|
||||||
if (blocked) {
|
if (blocked) {
|
||||||
log.log(Level.FINE, "{0} is blocked by {1}", new Object[] { this, blockerPeer});
|
log.fine("{0} is blocked by {1}", this, blockerPeer);
|
||||||
modalBlocker = d;
|
modalBlocker = d;
|
||||||
|
|
||||||
if (isReparented() || XWM.isNonReparentingWM()) {
|
if (isReparented() || XWM.isNonReparentingWM()) {
|
||||||
@ -1741,7 +1740,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void xSetVisible(boolean visible) {
|
public void xSetVisible(boolean visible) {
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Setting visible on " + this + " to " + visible);
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting visible on " + this + " to " + visible);
|
||||||
XToolkit.awtLock();
|
XToolkit.awtLock();
|
||||||
try {
|
try {
|
||||||
this.visible = visible;
|
this.visible = visible;
|
||||||
@ -1864,9 +1863,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
|
|
||||||
public void handleXCrossingEvent(XEvent xev) {
|
public void handleXCrossingEvent(XEvent xev) {
|
||||||
XCrossingEvent xce = xev.get_xcrossing();
|
XCrossingEvent xce = xev.get_xcrossing();
|
||||||
if (grabLog.isLoggable(Level.FINE)) {
|
if (grabLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
grabLog.log(Level.FINE, "{0}, when grabbed {1}, contains {2}",
|
grabLog.fine("{0}, when grabbed {1}, contains {2}",
|
||||||
new Object[] {xce, isGrabbed(), containsGlobal(xce.get_x_root(), xce.get_y_root())});
|
xce, isGrabbed(), containsGlobal(xce.get_x_root(), xce.get_y_root()));
|
||||||
}
|
}
|
||||||
if (isGrabbed()) {
|
if (isGrabbed()) {
|
||||||
// When window is grabbed, all events are dispatched to
|
// When window is grabbed, all events are dispatched to
|
||||||
@ -1877,7 +1876,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
// since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog.
|
// since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog.
|
||||||
// (fix for 6390326)
|
// (fix for 6390326)
|
||||||
XBaseWindow target = XToolkit.windowToXWindow(xce.get_window());
|
XBaseWindow target = XToolkit.windowToXWindow(xce.get_window());
|
||||||
grabLog.log(Level.FINER, " - Grab event target {0}", new Object[] {target});
|
grabLog.finer(" - Grab event target {0}", target);
|
||||||
if (target != null && target != this) {
|
if (target != null && target != this) {
|
||||||
target.dispatchEvent(xev);
|
target.dispatchEvent(xev);
|
||||||
return;
|
return;
|
||||||
@ -1888,9 +1887,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
|
|
||||||
public void handleMotionNotify(XEvent xev) {
|
public void handleMotionNotify(XEvent xev) {
|
||||||
XMotionEvent xme = xev.get_xmotion();
|
XMotionEvent xme = xev.get_xmotion();
|
||||||
if (grabLog.isLoggable(Level.FINE)) {
|
if (grabLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
grabLog.log(Level.FINER, "{0}, when grabbed {1}, contains {2}",
|
grabLog.finer("{0}, when grabbed {1}, contains {2}",
|
||||||
new Object[] {xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root())});
|
xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root()));
|
||||||
}
|
}
|
||||||
if (isGrabbed()) {
|
if (isGrabbed()) {
|
||||||
boolean dragging = false;
|
boolean dragging = false;
|
||||||
@ -1919,7 +1918,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
xme.set_x(localCoord.x);
|
xme.set_x(localCoord.x);
|
||||||
xme.set_y(localCoord.y);
|
xme.set_y(localCoord.y);
|
||||||
}
|
}
|
||||||
grabLog.log(Level.FINER, " - Grab event target {0}", new Object[] {target});
|
grabLog.finer(" - Grab event target {0}", target);
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
if (target != getContentXWindow() && target != this) {
|
if (target != getContentXWindow() && target != this) {
|
||||||
target.dispatchEvent(xev);
|
target.dispatchEvent(xev);
|
||||||
@ -1951,9 +1950,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
|
if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (grabLog.isLoggable(Level.FINE)) {
|
if (grabLog.isLoggable(PlatformLogger.FINE)) {
|
||||||
grabLog.log(Level.FINE, "{0}, when grabbed {1}, contains {2} ({3}, {4}, {5}x{6})",
|
grabLog.fine("{0}, when grabbed {1}, contains {2} ({3}, {4}, {5}x{6})",
|
||||||
new Object[] {xbe, isGrabbed(), containsGlobal(xbe.get_x_root(), xbe.get_y_root()), getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight()});
|
xbe, isGrabbed(), containsGlobal(xbe.get_x_root(), xbe.get_y_root()), getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
if (isGrabbed()) {
|
if (isGrabbed()) {
|
||||||
// When window is grabbed, all events are dispatched to
|
// When window is grabbed, all events are dispatched to
|
||||||
@ -1962,7 +1961,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
// translation)
|
// translation)
|
||||||
XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window());
|
XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window());
|
||||||
try {
|
try {
|
||||||
grabLog.log(Level.FINER, " - Grab event target {0} (press target {1})", new Object[] {target, pressTarget});
|
grabLog.finer(" - Grab event target {0} (press target {1})", target, pressTarget);
|
||||||
if (xbe.get_type() == XConstants.ButtonPress
|
if (xbe.get_type() == XConstants.ButtonPress
|
||||||
&& xbe.get_button() == XConstants.buttons[0])
|
&& xbe.get_button() == XConstants.buttons[0])
|
||||||
{
|
{
|
||||||
@ -1995,7 +1994,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
// Outside this toplevel hierarchy
|
// Outside this toplevel hierarchy
|
||||||
// According to the specification of UngrabEvent, post it
|
// According to the specification of UngrabEvent, post it
|
||||||
// when press occurs outside of the window and not on its owned windows
|
// when press occurs outside of the window and not on its owned windows
|
||||||
grabLog.log(Level.FINE, "Generating UngrabEvent on {0} because not inside of shell", this);
|
grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this);
|
||||||
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2013,18 +2012,18 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
|||||||
// toplevel == null - outside of
|
// toplevel == null - outside of
|
||||||
// hierarchy, toplevel is Dialog - should
|
// hierarchy, toplevel is Dialog - should
|
||||||
// send ungrab (but shouldn't for Window)
|
// send ungrab (but shouldn't for Window)
|
||||||
grabLog.log(Level.FINE, "Generating UngrabEvent on {0} because hierarchy ended", this);
|
grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this);
|
||||||
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// toplevel is null - outside of hierarchy
|
// toplevel is null - outside of hierarchy
|
||||||
grabLog.log(Level.FINE, "Generating UngrabEvent on {0} because toplevel is null", this);
|
grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this);
|
||||||
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// target doesn't map to XAWT window - outside of hierarchy
|
// target doesn't map to XAWT window - outside of hierarchy
|
||||||
grabLog.log(Level.FINE, "Generating UngrabEvent on because target is null {0}", this);
|
grabLog.fine("Generating UngrabEvent on because target is null {0}", this);
|
||||||
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
package sun.awt.X11;
|
package sun.awt.X11;
|
||||||
|
|
||||||
// This class serves as the base class for all the wrappers.
|
// This class serves as the base class for all the wrappers.
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
abstract class XWrapperBase {
|
abstract class XWrapperBase {
|
||||||
static final Logger log = Logger.getLogger("sun.awt.X11.wrappers");
|
static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.wrappers");
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String ret = "";
|
String ret = "";
|
||||||
|
@ -27,7 +27,8 @@ import java.util.*;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.*;
|
import java.nio.charset.*;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.logging.*;
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class WrapperGenerator {
|
public class WrapperGenerator {
|
||||||
/* XLibParser converts Xlib.h to a Java Object that encapsulates the
|
/* XLibParser converts Xlib.h to a Java Object that encapsulates the
|
||||||
@ -835,7 +836,7 @@ public class WrapperGenerator {
|
|||||||
|
|
||||||
pw.println("package "+package_name+";\n");
|
pw.println("package "+package_name+";\n");
|
||||||
pw.println("import sun.misc.*;\n");
|
pw.println("import sun.misc.*;\n");
|
||||||
pw.println("import java.util.logging.*;");
|
pw.println("import sun.util.logging.PlatformLogger;");
|
||||||
String baseClass = stp.getBaseClass();
|
String baseClass = stp.getBaseClass();
|
||||||
if (baseClass == null) {
|
if (baseClass == null) {
|
||||||
baseClass = defaultBaseClass;
|
baseClass = defaultBaseClass;
|
||||||
|
@ -67,8 +67,7 @@ tojava package sun.awt.X11;
|
|||||||
tojava import java.util.Hashtable;
|
tojava import java.util.Hashtable;
|
||||||
tojava import sun.misc.Unsafe;
|
tojava import sun.misc.Unsafe;
|
||||||
tojava
|
tojava
|
||||||
tojava import java.util.logging.Level;
|
tojava import sun.util.logging.PlatformLogger;
|
||||||
tojava import java.util.logging.Logger;
|
|
||||||
tojava
|
tojava
|
||||||
tojava public class XKeysym {
|
tojava public class XKeysym {
|
||||||
tojava
|
tojava
|
||||||
@ -108,7 +107,7 @@ tojava // Another use for reverse lookup: query keyboard state, for some key
|
|||||||
tojava static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
|
tojava static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
|
||||||
tojava static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
|
tojava static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
|
||||||
tojava static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
|
tojava static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
|
||||||
tojava private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XKeysym");
|
tojava private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym");
|
||||||
tojava public static char convertKeysym( long ks, int state ) {
|
tojava public static char convertKeysym( long ks, int state ) {
|
||||||
tojava
|
tojava
|
||||||
tojava /* First check for Latin-1 characters (1:1 mapping) */
|
tojava /* First check for Latin-1 characters (1:1 mapping) */
|
||||||
|
@ -13,7 +13,6 @@ import java.util.Map;
|
|||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
import sun.awt.motif.MFontConfiguration;
|
import sun.awt.motif.MFontConfiguration;
|
||||||
@ -25,6 +24,7 @@ import sun.font.FcFontConfiguration;
|
|||||||
import sun.font.FontAccess;
|
import sun.font.FontAccess;
|
||||||
import sun.font.FontUtilities;
|
import sun.font.FontUtilities;
|
||||||
import sun.font.NativeFont;
|
import sun.font.NativeFont;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The X11 implementation of {@link FontManager}.
|
* The X11 implementation of {@link FontManager}.
|
||||||
@ -369,7 +369,7 @@ public class X11FontManager extends SunFontManager {
|
|||||||
String sVal = (String) fontNameMap.get(fontID);
|
String sVal = (String) fontNameMap.get(fontID);
|
||||||
|
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
logger.info("file=" + fileName +
|
logger.info("file=" + fileName +
|
||||||
" xlfd=" + fontPart);
|
" xlfd=" + fontPart);
|
||||||
logger.info("fontID=" + fontID +
|
logger.info("fontID=" + fontID +
|
||||||
|
@ -41,7 +41,6 @@ import java.net.SocketException;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import sun.awt.motif.MFontConfiguration;
|
import sun.awt.motif.MFontConfiguration;
|
||||||
import sun.font.FcFontConfiguration;
|
import sun.font.FcFontConfiguration;
|
||||||
@ -51,6 +50,7 @@ import sun.font.NativeFont;
|
|||||||
import sun.java2d.SunGraphicsEnvironment;
|
import sun.java2d.SunGraphicsEnvironment;
|
||||||
import sun.java2d.SurfaceManagerFactory;
|
import sun.java2d.SurfaceManagerFactory;
|
||||||
import sun.java2d.UnixSurfaceManagerFactory;
|
import sun.java2d.UnixSurfaceManagerFactory;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an implementation of a GraphicsEnvironment object for the
|
* This is an implementation of a GraphicsEnvironment object for the
|
||||||
@ -63,8 +63,8 @@ import sun.java2d.UnixSurfaceManagerFactory;
|
|||||||
public class X11GraphicsEnvironment
|
public class X11GraphicsEnvironment
|
||||||
extends SunGraphicsEnvironment
|
extends SunGraphicsEnvironment
|
||||||
{
|
{
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11GraphicsEnvironment");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11GraphicsEnvironment");
|
||||||
private static final Logger screenLog = Logger.getLogger("sun.awt.screen.X11GraphicsEnvironment");
|
private static final PlatformLogger screenLog = PlatformLogger.getLogger("sun.awt.screen.X11GraphicsEnvironment");
|
||||||
|
|
||||||
private static Boolean xinerState;
|
private static Boolean xinerState;
|
||||||
|
|
||||||
@ -284,8 +284,8 @@ public class X11GraphicsEnvironment
|
|||||||
// pRunningXinerama() simply returns a global boolean variable,
|
// pRunningXinerama() simply returns a global boolean variable,
|
||||||
// so there is no need to synchronize here
|
// so there is no need to synchronize here
|
||||||
xinerState = Boolean.valueOf(pRunningXinerama());
|
xinerState = Boolean.valueOf(pRunningXinerama());
|
||||||
if (screenLog.isLoggable(Level.FINER)) {
|
if (screenLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
screenLog.log(Level.FINER, "Running Xinerama: " + xinerState);
|
screenLog.finer("Running Xinerama: " + xinerState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return xinerState.booleanValue();
|
return xinerState.booleanValue();
|
||||||
@ -368,24 +368,24 @@ public class X11GraphicsEnvironment
|
|||||||
(unionRect.width / 2) + unionRect.x < center.x + 1 &&
|
(unionRect.width / 2) + unionRect.x < center.x + 1 &&
|
||||||
(unionRect.height / 2) + unionRect.y < center.y + 1) {
|
(unionRect.height / 2) + unionRect.y < center.y + 1) {
|
||||||
|
|
||||||
if (screenLog.isLoggable(Level.FINER)) {
|
if (screenLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
screenLog.log(Level.FINER, "Video Wall: center point is at center of all displays.");
|
screenLog.finer("Video Wall: center point is at center of all displays.");
|
||||||
}
|
}
|
||||||
return unionRect;
|
return unionRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
// next, check if at center of one monitor
|
// next, check if at center of one monitor
|
||||||
if (centerMonitorRect != null) {
|
if (centerMonitorRect != null) {
|
||||||
if (screenLog.isLoggable(Level.FINER)) {
|
if (screenLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
screenLog.log(Level.FINER, "Center point at center of a particular " +
|
screenLog.finer("Center point at center of a particular " +
|
||||||
"monitor, but not of the entire virtual display.");
|
"monitor, but not of the entire virtual display.");
|
||||||
}
|
}
|
||||||
return centerMonitorRect;
|
return centerMonitorRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, the center is at some weird spot: return unionRect
|
// otherwise, the center is at some weird spot: return unionRect
|
||||||
if (screenLog.isLoggable(Level.FINER)) {
|
if (screenLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
screenLog.log(Level.FINER, "Center point is somewhere strange - return union of all bounds.");
|
screenLog.finer("Center point is somewhere strange - return union of all bounds.");
|
||||||
}
|
}
|
||||||
return unionRect;
|
return unionRect;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ import java.io.File;
|
|||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ import java.util.regex.Pattern;
|
|||||||
* @author JavaSoft International
|
* @author JavaSoft International
|
||||||
*/
|
*/
|
||||||
public abstract class X11InputMethod extends InputMethodAdapter {
|
public abstract class X11InputMethod extends InputMethodAdapter {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.X11InputMethod");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11InputMethod");
|
||||||
/*
|
/*
|
||||||
* The following XIM* values must be the same as those defined in
|
* The following XIM* values must be the same as those defined in
|
||||||
* Xlib.h
|
* Xlib.h
|
||||||
@ -324,8 +324,8 @@ public abstract class X11InputMethod extends InputMethodAdapter {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (lastXICFocussedComponent != null){
|
if (lastXICFocussedComponent != null){
|
||||||
if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "XICFocused {0}, AWTFocused {1}", new Object[] {
|
if (log.isLoggable(PlatformLogger.FINE)) log.fine("XICFocused {0}, AWTFocused {1}",
|
||||||
lastXICFocussedComponent, awtFocussedComponent});
|
lastXICFocussedComponent, awtFocussedComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pData == 0) {
|
if (pData == 0) {
|
||||||
|
@ -30,10 +30,10 @@ import java.io.BufferedReader;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import sun.awt.FontConfiguration;
|
import sun.awt.FontConfiguration;
|
||||||
@ -44,17 +44,17 @@ import sun.font.SunFontManager;
|
|||||||
import sun.font.FontManagerFactory;
|
import sun.font.FontManagerFactory;
|
||||||
import sun.font.FontUtilities;
|
import sun.font.FontUtilities;
|
||||||
import sun.java2d.SunGraphicsEnvironment;
|
import sun.java2d.SunGraphicsEnvironment;
|
||||||
import java.nio.charset.Charset;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class MFontConfiguration extends FontConfiguration {
|
public class MFontConfiguration extends FontConfiguration {
|
||||||
|
|
||||||
private static FontConfiguration fontConfig = null;
|
private static FontConfiguration fontConfig = null;
|
||||||
private static Logger logger;
|
private static PlatformLogger logger;
|
||||||
|
|
||||||
public MFontConfiguration(SunFontManager fm) {
|
public MFontConfiguration(SunFontManager fm) {
|
||||||
super(fm);
|
super(fm);
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
logger = Logger.getLogger("sun.awt.FontConfiguration");
|
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
|
||||||
}
|
}
|
||||||
initTables();
|
initTables();
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ public class MFontConfiguration extends FontConfiguration {
|
|||||||
boolean preferPropFonts) {
|
boolean preferPropFonts) {
|
||||||
super(fm, preferLocaleFonts, preferPropFonts);
|
super(fm, preferLocaleFonts, preferPropFonts);
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
logger = Logger.getLogger("sun.awt.FontConfiguration");
|
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
|
||||||
}
|
}
|
||||||
initTables();
|
initTables();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ import java.security.PrivilegedExceptionAction;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import sun.awt.AppContext;
|
import sun.awt.AppContext;
|
||||||
import sun.awt.AWTAutoShutdown;
|
import sun.awt.AWTAutoShutdown;
|
||||||
@ -74,10 +73,11 @@ import sun.misc.PerformanceLogger;
|
|||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
import sun.security.action.GetBooleanAction;
|
import sun.security.action.GetBooleanAction;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class MToolkit extends UNIXToolkit implements Runnable {
|
public class MToolkit extends UNIXToolkit implements Runnable {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.motif.MToolkit");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.motif.MToolkit");
|
||||||
|
|
||||||
// the system clipboard - CLIPBOARD selection
|
// the system clipboard - CLIPBOARD selection
|
||||||
//X11Clipboard clipboard;
|
//X11Clipboard clipboard;
|
||||||
@ -617,8 +617,8 @@ public class MToolkit extends UNIXToolkit implements Runnable {
|
|||||||
protected Boolean lazilyLoadDynamicLayoutSupportedProperty(String name) {
|
protected Boolean lazilyLoadDynamicLayoutSupportedProperty(String name) {
|
||||||
boolean nativeDynamic = isDynamicLayoutSupportedNative();
|
boolean nativeDynamic = isDynamicLayoutSupportedNative();
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "nativeDynamic == " + nativeDynamic);
|
log.finer("nativeDynamic == " + nativeDynamic);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Boolean.valueOf(nativeDynamic);
|
return Boolean.valueOf(nativeDynamic);
|
||||||
|
@ -35,7 +35,6 @@ import java.net.UnknownHostException;
|
|||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import sun.awt.FontConfiguration;
|
import sun.awt.FontConfiguration;
|
||||||
@ -48,6 +47,7 @@ import sun.font.FontConfigManager.FontConfigInfo;
|
|||||||
import sun.font.FontConfigManager.FcCompFont;
|
import sun.font.FontConfigManager.FcCompFont;
|
||||||
import sun.font.FontConfigManager.FontConfigFont;
|
import sun.font.FontConfigManager.FontConfigFont;
|
||||||
import sun.java2d.SunGraphicsEnvironment;
|
import sun.java2d.SunGraphicsEnvironment;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class FcFontConfiguration extends FontConfiguration {
|
public class FcFontConfiguration extends FontConfiguration {
|
||||||
|
|
||||||
@ -99,14 +99,11 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
writeFcInfo();
|
writeFcInfo();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger =
|
warning("Exception writing fcInfo " + e);
|
||||||
Logger.getLogger("sun.awt.FontConfiguration");
|
|
||||||
logger.warning("Exception writing fcInfo " + e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (FontUtilities.debugFonts()) {
|
} else if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning("Failed to get info from libfontconfig");
|
||||||
logger.warning("Failed to get info from libfontconfig");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fcm.populateFontConfig(fcCompFonts);
|
fcm.populateFontConfig(fcCompFonts);
|
||||||
@ -329,8 +326,7 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning("Exception identifying Linux distro.");
|
||||||
logger.warning("Exception identifying Linux distro.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -402,13 +398,11 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
boolean renamed = tempFile.renameTo(fcInfoFile);
|
boolean renamed = tempFile.renameTo(fcInfoFile);
|
||||||
if (!renamed && FontUtilities.debugFonts()) {
|
if (!renamed && FontUtilities.debugFonts()) {
|
||||||
System.out.println("rename failed");
|
System.out.println("rename failed");
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning("Failed renaming file to "+ getFcInfoFile());
|
||||||
logger.warning("Failed renaming file to "+ getFcInfoFile());
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning("IOException writing to "+ getFcInfoFile());
|
||||||
logger.warning("IOException writing to "+ getFcInfoFile());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,8 +426,7 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
fis.close();
|
fis.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning("IOException reading from "+fcFile.toString());
|
||||||
logger.warning("IOException reading from "+fcFile.toString());
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -455,10 +448,7 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger =
|
warning("Exception parsing version " + fcVersionStr);
|
||||||
Logger.getLogger("sun.awt.FontConfiguration");
|
|
||||||
logger.warning("Exception parsing version " +
|
|
||||||
fcVersionStr);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -521,9 +511,13 @@ public class FcFontConfiguration extends FontConfiguration {
|
|||||||
fcCompFonts = fci;
|
fcCompFonts = fci;
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (FontUtilities.debugFonts()) {
|
if (FontUtilities.debugFonts()) {
|
||||||
Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
|
warning(t.toString());
|
||||||
logger.warning(t.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void warning(String msg) {
|
||||||
|
PlatformLogger logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
|
||||||
|
logger.warning(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
package sun.font;
|
package sun.font;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import sun.awt.SunHints;
|
import sun.awt.SunHints;
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small utility class to manage FontConfig.
|
* Small utility class to manage FontConfig.
|
||||||
@ -200,7 +200,7 @@ public class FontConfigManager {
|
|||||||
FcCompFont fci = fontArr[i];
|
FcCompFont fci = fontArr[i];
|
||||||
if (fci.firstFont == null) {
|
if (fci.firstFont == null) {
|
||||||
if (FontUtilities.isLogging()) {
|
if (FontUtilities.isLogging()) {
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
logger.info("Fontconfig returned no font for " +
|
logger.info("Fontconfig returned no font for " +
|
||||||
fontArr[i].fcName);
|
fontArr[i].fcName);
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ public class FontConfigManager {
|
|||||||
|
|
||||||
if (anyFont == null) {
|
if (anyFont == null) {
|
||||||
if (FontUtilities.isLogging()) {
|
if (FontUtilities.isLogging()) {
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
logger.info("Fontconfig returned no fonts at all.");
|
logger.info("Fontconfig returned no fonts at all.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ public class FontConfigManager {
|
|||||||
|
|
||||||
if (FontUtilities.isLogging()) {
|
if (FontUtilities.isLogging()) {
|
||||||
|
|
||||||
Logger logger = FontUtilities.getLogger();
|
PlatformLogger logger = FontUtilities.getLogger();
|
||||||
|
|
||||||
long t1 = System.nanoTime();
|
long t1 = System.nanoTime();
|
||||||
logger.info("Time spent accessing fontconfig="
|
logger.info("Time spent accessing fontconfig="
|
||||||
|
@ -59,8 +59,7 @@ import java.awt.dnd.DropTarget;
|
|||||||
import java.awt.dnd.peer.DropTargetPeer;
|
import java.awt.dnd.peer.DropTargetPeer;
|
||||||
import sun.awt.ComponentAccessor;
|
import sun.awt.ComponentAccessor;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
|
|
||||||
public abstract class WComponentPeer extends WObjectPeer
|
public abstract class WComponentPeer extends WObjectPeer
|
||||||
implements ComponentPeer, DropTargetPeer
|
implements ComponentPeer, DropTargetPeer
|
||||||
@ -70,9 +69,9 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
*/
|
*/
|
||||||
protected volatile long hwnd;
|
protected volatile long hwnd;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.windows.WComponentPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WComponentPeer");
|
||||||
private static final Logger shapeLog = Logger.getLogger("sun.awt.windows.shape.WComponentPeer");
|
private static final PlatformLogger shapeLog = PlatformLogger.getLogger("sun.awt.windows.shape.WComponentPeer");
|
||||||
private static final Logger focusLog = Logger.getLogger("sun.awt.windows.focus.WComponentPeer");
|
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.windows.focus.WComponentPeer");
|
||||||
|
|
||||||
// ComponentPeer implementation
|
// ComponentPeer implementation
|
||||||
SurfaceData surfaceData;
|
SurfaceData surfaceData;
|
||||||
@ -178,10 +177,10 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
void dynamicallyLayoutContainer() {
|
void dynamicallyLayoutContainer() {
|
||||||
// If we got the WM_SIZING, this must be a Container, right?
|
// If we got the WM_SIZING, this must be a Container, right?
|
||||||
// In fact, it must be the top-level Container.
|
// In fact, it must be the top-level Container.
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
Container parent = WToolkit.getNativeContainer((Component)target);
|
Container parent = WToolkit.getNativeContainer((Component)target);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
log.log(Level.FINE, "Assertion (parent == null) failed");
|
log.fine("Assertion (parent == null) failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Container cont = (Container)target;
|
final Container cont = (Container)target;
|
||||||
@ -283,14 +282,14 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
paintArea.add(r, e.getID());
|
paintArea.add(r, e.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
switch(e.getID()) {
|
switch(e.getID()) {
|
||||||
case PaintEvent.UPDATE:
|
case PaintEvent.UPDATE:
|
||||||
log.log(Level.FINEST, "coalescePaintEvent: UPDATE: add: x = " +
|
log.finest("coalescePaintEvent: UPDATE: add: x = " +
|
||||||
r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
|
r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
|
||||||
return;
|
return;
|
||||||
case PaintEvent.PAINT:
|
case PaintEvent.PAINT:
|
||||||
log.log(Level.FINEST, "coalescePaintEvent: PAINT: add: x = " +
|
log.finest("coalescePaintEvent: PAINT: add: x = " +
|
||||||
r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
|
r.x + ", y = " + r.y + ", width = " + r.width + ", height = " + r.height);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -360,7 +359,7 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleJavaFocusEvent(FocusEvent fe) {
|
void handleJavaFocusEvent(FocusEvent fe) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer(fe.toString());
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(fe.toString());
|
||||||
setFocus(fe.getID() == FocusEvent.FOCUS_GAINED);
|
setFocus(fe.getID() == FocusEvent.FOCUS_GAINED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +640,7 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
case WKeyboardFocusManagerPeer.SNFH_FAILURE:
|
case WKeyboardFocusManagerPeer.SNFH_FAILURE:
|
||||||
return false;
|
return false;
|
||||||
case WKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
|
case WKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
|
||||||
if (focusLog.isLoggable(Level.FINER)) {
|
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target);
|
focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target);
|
||||||
}
|
}
|
||||||
Window parentWindow = SunToolkit.getContainingWindow((Component)target);
|
Window parentWindow = SunToolkit.getContainingWindow((Component)target);
|
||||||
@ -654,7 +653,7 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
}
|
}
|
||||||
boolean res = wpeer.requestWindowFocus(cause);
|
boolean res = wpeer.requestWindowFocus(cause);
|
||||||
|
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Requested window focus: " + res);
|
||||||
// If parent window can be made focused and has been made focused(synchronously)
|
// If parent window can be made focused and has been made focused(synchronously)
|
||||||
// then we can proceed with children, otherwise we retreat.
|
// then we can proceed with children, otherwise we retreat.
|
||||||
if (!(res && parentWindow.isFocused())) {
|
if (!(res && parentWindow.isFocused())) {
|
||||||
@ -674,7 +673,7 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean rejectFocusRequestHelper(String logMsg) {
|
private boolean rejectFocusRequestHelper(String logMsg) {
|
||||||
if (focusLog.isLoggable(Level.FINER)) focusLog.finer(logMsg);
|
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(logMsg);
|
||||||
WKeyboardFocusManagerPeer.removeLastFocusRequest((Component)target);
|
WKeyboardFocusManagerPeer.removeLastFocusRequest((Component)target);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1017,7 +1016,7 @@ public abstract class WComponentPeer extends WObjectPeer
|
|||||||
* @since 1.7
|
* @since 1.7
|
||||||
*/
|
*/
|
||||||
public void applyShape(Region shape) {
|
public void applyShape(Region shape) {
|
||||||
if (shapeLog.isLoggable(Level.FINER)) {
|
if (shapeLog.isLoggable(PlatformLogger.FINER)) {
|
||||||
shapeLog.finer(
|
shapeLog.finer(
|
||||||
"*** INFO: Setting shape: PEER: " + this
|
"*** INFO: Setting shape: PEER: " + this
|
||||||
+ "; TARGET: " + target
|
+ "; TARGET: " + target
|
||||||
|
@ -34,8 +34,7 @@ import java.util.Arrays;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import sun.awt.SunToolkit;
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
@ -54,7 +53,7 @@ import sun.awt.SunToolkit;
|
|||||||
* itself when running on a Windows platform.
|
* itself when running on a Windows platform.
|
||||||
*/
|
*/
|
||||||
class WDesktopProperties {
|
class WDesktopProperties {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.windows.WDesktopProperties");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WDesktopProperties");
|
||||||
private static final String PREFIX = "win.";
|
private static final String PREFIX = "win.";
|
||||||
private static final String FILE_PREFIX = "awt.file.";
|
private static final String FILE_PREFIX = "awt.file.";
|
||||||
private static final String PROP_NAMES = "win.propNames";
|
private static final String PROP_NAMES = "win.propNames";
|
||||||
@ -111,7 +110,7 @@ class WDesktopProperties {
|
|||||||
*/
|
*/
|
||||||
private synchronized void setBooleanProperty(String key, boolean value) {
|
private synchronized void setBooleanProperty(String key, boolean value) {
|
||||||
assert( key != null );
|
assert( key != null );
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + String.valueOf(value));
|
log.fine(key + "=" + String.valueOf(value));
|
||||||
}
|
}
|
||||||
map.put(key, Boolean.valueOf(value));
|
map.put(key, Boolean.valueOf(value));
|
||||||
@ -122,7 +121,7 @@ class WDesktopProperties {
|
|||||||
*/
|
*/
|
||||||
private synchronized void setIntegerProperty(String key, int value) {
|
private synchronized void setIntegerProperty(String key, int value) {
|
||||||
assert( key != null );
|
assert( key != null );
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + String.valueOf(value));
|
log.fine(key + "=" + String.valueOf(value));
|
||||||
}
|
}
|
||||||
map.put(key, Integer.valueOf(value));
|
map.put(key, Integer.valueOf(value));
|
||||||
@ -133,7 +132,7 @@ class WDesktopProperties {
|
|||||||
*/
|
*/
|
||||||
private synchronized void setStringProperty(String key, String value) {
|
private synchronized void setStringProperty(String key, String value) {
|
||||||
assert( key != null );
|
assert( key != null );
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + value);
|
log.fine(key + "=" + value);
|
||||||
}
|
}
|
||||||
map.put(key, value);
|
map.put(key, value);
|
||||||
@ -145,7 +144,7 @@ class WDesktopProperties {
|
|||||||
private synchronized void setColorProperty(String key, int r, int g, int b) {
|
private synchronized void setColorProperty(String key, int r, int g, int b) {
|
||||||
assert( key != null && r <= 255 && g <=255 && b <= 255 );
|
assert( key != null && r <= 255 && g <=255 && b <= 255 );
|
||||||
Color color = new Color(r, g, b);
|
Color color = new Color(r, g, b);
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + color);
|
log.fine(key + "=" + color);
|
||||||
}
|
}
|
||||||
map.put(key, color);
|
map.put(key, color);
|
||||||
@ -173,14 +172,14 @@ class WDesktopProperties {
|
|||||||
name = mappedName;
|
name = mappedName;
|
||||||
}
|
}
|
||||||
Font font = new Font(name, style, size);
|
Font font = new Font(name, style, size);
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + font);
|
log.fine(key + "=" + font);
|
||||||
}
|
}
|
||||||
map.put(key, font);
|
map.put(key, font);
|
||||||
|
|
||||||
String sizeKey = key + ".height";
|
String sizeKey = key + ".height";
|
||||||
Integer iSize = Integer.valueOf(size);
|
Integer iSize = Integer.valueOf(size);
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(sizeKey + "=" + iSize);
|
log.fine(sizeKey + "=" + iSize);
|
||||||
}
|
}
|
||||||
map.put(sizeKey, iSize);
|
map.put(sizeKey, iSize);
|
||||||
@ -193,7 +192,7 @@ class WDesktopProperties {
|
|||||||
assert( key != null && winEventName != null );
|
assert( key != null && winEventName != null );
|
||||||
|
|
||||||
Runnable soundRunnable = new WinPlaySound(winEventName);
|
Runnable soundRunnable = new WinPlaySound(winEventName);
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.fine(key + "=" + soundRunnable);
|
log.fine(key + "=" + soundRunnable);
|
||||||
}
|
}
|
||||||
map.put(key, soundRunnable);
|
map.put(key, soundRunnable);
|
||||||
|
@ -31,11 +31,10 @@ import java.awt.peer.*;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
import java.util.logging.Logger;
|
import sun.util.logging.PlatformLogger;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
|
class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.WMenuItemPeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.WMenuItemPeer");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
initIDs();
|
initIDs();
|
||||||
@ -166,8 +165,8 @@ class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
|
|||||||
ResourceBundle rb = ResourceBundle.getBundle("sun.awt.windows.awtLocalization");
|
ResourceBundle rb = ResourceBundle.getBundle("sun.awt.windows.awtLocalization");
|
||||||
return Font.decode(rb.getString("menuFont"));
|
return Font.decode(rb.getString("menuFont"));
|
||||||
} catch (MissingResourceException e) {
|
} catch (MissingResourceException e) {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "WMenuItemPeer: " + e.getMessage()+". Using default MenuItem font.", e);
|
log.fine("WMenuItemPeer: " + e.getMessage()+". Using default MenuItem font.", e);
|
||||||
}
|
}
|
||||||
return new Font("SanSerif", Font.PLAIN, 11);
|
return new Font("SanSerif", Font.PLAIN, 11);
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,9 @@ import java.awt.peer.*;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import sun.awt.SunGraphicsCallback;
|
import sun.awt.SunGraphicsCallback;
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
class WPanelPeer extends WCanvasPeer implements PanelPeer {
|
class WPanelPeer extends WCanvasPeer implements PanelPeer {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.windows.WPanelPeer");
|
|
||||||
// ComponentPeer overrides
|
// ComponentPeer overrides
|
||||||
|
|
||||||
public void paint(Graphics g) {
|
public void paint(Graphics g) {
|
||||||
|
@ -29,11 +29,11 @@ import java.awt.event.AdjustmentEvent;
|
|||||||
import java.awt.peer.ScrollPanePeer;
|
import java.awt.peer.ScrollPanePeer;
|
||||||
import sun.awt.PeerEvent;
|
import sun.awt.PeerEvent;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.windows.WScrollPanePeer");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WScrollPanePeer");
|
||||||
|
|
||||||
int scrollbarWidth;
|
int scrollbarWidth;
|
||||||
int scrollbarHeight;
|
int scrollbarHeight;
|
||||||
@ -159,8 +159,8 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PeerEvent coalesceEvents(PeerEvent newEvent) {
|
public PeerEvent coalesceEvents(PeerEvent newEvent) {
|
||||||
if (log.isLoggable(Level.FINEST)) {
|
if (log.isLoggable(PlatformLogger.FINEST)) {
|
||||||
log.log(Level.FINEST, "ScrollEvent coalesced: " + newEvent);
|
log.finest("ScrollEvent coalesced: " + newEvent);
|
||||||
}
|
}
|
||||||
if (newEvent instanceof ScrollEvent) {
|
if (newEvent instanceof ScrollEvent) {
|
||||||
return newEvent;
|
return newEvent;
|
||||||
@ -204,8 +204,8 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
|||||||
} else if (orient == Adjustable.HORIZONTAL) {
|
} else if (orient == Adjustable.HORIZONTAL) {
|
||||||
adj = (ScrollPaneAdjustable)sp.getHAdjustable();
|
adj = (ScrollPaneAdjustable)sp.getHAdjustable();
|
||||||
} else {
|
} else {
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "Assertion failed: unknown orient");
|
log.fine("Assertion failed: unknown orient");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,8 +231,8 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
|||||||
newpos = this.pos;
|
newpos = this.pos;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "Assertion failed: unknown type");
|
log.fine("Assertion failed: unknown type");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -258,10 +258,10 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer {
|
|||||||
{
|
{
|
||||||
hwAncestor = hwAncestor.getParent();
|
hwAncestor = hwAncestor.getParent();
|
||||||
}
|
}
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
if (hwAncestor == null) {
|
if (hwAncestor == null) {
|
||||||
log.log(Level.FINE, "Assertion (hwAncestor != null) failed, " +
|
log.fine("Assertion (hwAncestor != null) failed, " +
|
||||||
"couldn't find heavyweight ancestor of scroll pane child");
|
"couldn't find heavyweight ancestor of scroll pane child");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WComponentPeer hwPeer = (WComponentPeer)hwAncestor.getPeer();
|
WComponentPeer hwPeer = (WComponentPeer)hwAncestor.getPeer();
|
||||||
|
@ -58,16 +58,15 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import sun.font.FontManager;
|
import sun.font.FontManager;
|
||||||
import sun.font.FontManagerFactory;
|
import sun.font.FontManagerFactory;
|
||||||
import sun.font.SunFontManager;
|
import sun.font.SunFontManager;
|
||||||
import sun.misc.PerformanceLogger;
|
import sun.misc.PerformanceLogger;
|
||||||
|
import sun.util.logging.PlatformLogger;
|
||||||
|
|
||||||
public class WToolkit extends SunToolkit implements Runnable {
|
public class WToolkit extends SunToolkit implements Runnable {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("sun.awt.windows.WToolkit");
|
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WToolkit");
|
||||||
|
|
||||||
static GraphicsConfiguration config;
|
static GraphicsConfiguration config;
|
||||||
|
|
||||||
@ -110,8 +109,8 @@ public class WToolkit extends SunToolkit implements Runnable {
|
|||||||
initIDs();
|
initIDs();
|
||||||
|
|
||||||
// Print out which version of Windows is running
|
// Print out which version of Windows is running
|
||||||
if (log.isLoggable(Level.FINE)) {
|
if (log.isLoggable(PlatformLogger.FINE)) {
|
||||||
log.log(Level.FINE, "Win version: " + getWindowsVersion());
|
log.fine("Win version: " + getWindowsVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
java.security.AccessController.doPrivileged(
|
java.security.AccessController.doPrivileged(
|
||||||
@ -830,10 +829,10 @@ public class WToolkit extends SunToolkit implements Runnable {
|
|||||||
lazilyInitWProps();
|
lazilyInitWProps();
|
||||||
Boolean prop = (Boolean) desktopProperties.get("awt.dynamicLayoutSupported");
|
Boolean prop = (Boolean) desktopProperties.get("awt.dynamicLayoutSupported");
|
||||||
|
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "In WTK.isDynamicLayoutSupported()" +
|
log.finer("In WTK.isDynamicLayoutSupported()" +
|
||||||
" nativeDynamic == " + nativeDynamic +
|
" nativeDynamic == " + nativeDynamic +
|
||||||
" wprops.dynamic == " + prop);
|
" wprops.dynamic == " + prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop == null) || (nativeDynamic != prop.booleanValue())) {
|
if ((prop == null) || (nativeDynamic != prop.booleanValue())) {
|
||||||
@ -868,8 +867,8 @@ public class WToolkit extends SunToolkit implements Runnable {
|
|||||||
Map<String, Object> props = wprops.getProperties();
|
Map<String, Object> props = wprops.getProperties();
|
||||||
for (String propName : props.keySet()) {
|
for (String propName : props.keySet()) {
|
||||||
Object val = props.get(propName);
|
Object val = props.get(propName);
|
||||||
if (log.isLoggable(Level.FINER)) {
|
if (log.isLoggable(PlatformLogger.FINER)) {
|
||||||
log.log(Level.FINER, "changed " + propName + " to " + val);
|
log.finer("changed " + propName + " to " + val);
|
||||||
}
|
}
|
||||||
setDesktopProperty(propName, val);
|
setDesktopProperty(propName, val);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user