提交 f0b89a21 编写于 作者: M mchung

6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes

Summary: Replace calls to Logger with sun.util.logging.PlatformLogger
Reviewed-by: prr, art, alexp, dcherepanov, igor, dav, anthony
上级 d3b300ff
......@@ -30,9 +30,8 @@ import java.awt.event.*;
import java.awt.peer.ComponentPeer;
import java.awt.peer.LightweightPeer;
import java.lang.reflect.Field;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.awt.AWTAccessor;
import sun.util.logging.PlatformLogger;
/**
* The root event class for all AWT events.
......@@ -76,7 +75,7 @@ import sun.awt.AWTAccessor;
* @since 1.1
*/
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[];
/**
......@@ -252,12 +251,12 @@ public abstract class AWTEvent extends EventObject {
field.setAccessible(true);
return field;
} catch (SecurityException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
}
} catch (NoSuchFieldException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
}
}
return null;
......@@ -549,8 +548,8 @@ public abstract class AWTEvent extends EventObject {
boolean b = field.getBoolean(this);
field.setBoolean(that, b);
} catch(IllegalAccessException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
}
}
}
......@@ -564,8 +563,8 @@ public abstract class AWTEvent extends EventObject {
try {
field.setBoolean(this, false);
} catch(IllegalAccessException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.dispatched() got IllegalAccessException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.dispatched() got IllegalAccessException ", e);
}
}
}
......
......@@ -25,21 +25,21 @@
package java.awt;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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 String[] names;
protected AttributeValue(int value, String[] names) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "value = " + value + ", names = " + names);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("value = " + value + ", names = " + names);
}
if (log.isLoggable(Level.FINER)) {
if (log.isLoggable(PlatformLogger.FINER)) {
if ((value < 0) || (names == null) || (value >= names.length)) {
log.log(Level.FINER, "Assertion failed");
log.finer("Assertion failed");
}
}
this.value = value;
......
......@@ -46,10 +46,10 @@ import java.util.EventListener;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.*;
import javax.accessibility.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.CausedFocusEvent;
import sun.awt.PeerEvent;
......@@ -85,8 +85,8 @@ import sun.java2d.pipe.Region;
*/
public class Container extends Component {
private static final Logger log = Logger.getLogger("java.awt.Container");
private static final Logger eventLog = Logger.getLogger("java.awt.event.Container");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Container");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Container");
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 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
......@@ -1287,33 +1287,33 @@ public class Container extends Component {
int superListening = super.numListening(mask);
if (mask == AWTEvent.HIERARCHY_EVENT_MASK) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningChildren != sum) {
eventLog.log(Level.FINE, "Assertion (listeningChildren == sum) failed");
eventLog.fine("Assertion (listeningChildren == sum) failed");
}
}
return listeningChildren + superListening;
} else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningBoundsChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningBoundsChildren != sum) {
eventLog.log(Level.FINE, "Assertion (listeningBoundsChildren == sum) failed");
eventLog.fine("Assertion (listeningBoundsChildren == sum) failed");
}
}
return listeningBoundsChildren + superListening;
} else {
// assert false;
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "This code must never be reached");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("This code must never be reached");
}
return superListening;
}
......@@ -1321,13 +1321,13 @@ public class Container extends Component {
// Should only be called while holding tree lock
void adjustListeningChildren(long mask, int num) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK ||
mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK ||
mask == (AWTEvent.HIERARCHY_EVENT_MASK |
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK));
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
int countHierarchyMembers() {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
// Verify descendantsCount is correct
int sum = 0;
for (Component comp : component) {
sum += comp.countHierarchyMembers();
}
if (descendantsCount != sum) {
log.log(Level.FINE, "Assertion (descendantsCount == sum) failed");
log.fine("Assertion (descendantsCount == sum) failed");
}
}
return descendantsCount + 1;
......@@ -3924,7 +3924,7 @@ public class Container extends Component {
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) {
checkTreeLock();
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
......@@ -3961,7 +3961,7 @@ public class Container extends Component {
final void recursiveApplyCurrentShape(int fromZorder, int toZorder) {
checkTreeLock();
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
......@@ -4065,7 +4065,7 @@ public class Container extends Component {
@Override
void mixOnShowing() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
......@@ -4090,7 +4090,7 @@ public class Container extends Component {
@Override
void mixOnHiding(boolean isLightweight) {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; isLightweight=" + isLightweight);
}
......@@ -4104,7 +4104,7 @@ public class Container extends Component {
@Override
void mixOnReshaping() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
......@@ -4139,7 +4139,7 @@ public class Container extends Component {
@Override
void mixOnZOrderChanging(int oldZorder, int newZorder) {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; oldZ=" + oldZorder + "; newZ=" + newZorder);
}
......@@ -4160,7 +4160,7 @@ public class Container extends Component {
@Override
void mixOnValidating() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
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 Logger eventLog = Logger.getLogger("java.awt.event.LightweightDispatcher");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
LightweightDispatcher(Container 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
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(Level.FINEST) && (mouseOver != null)) {
eventLog.log(Level.FINEST, "retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
if (eventLog.isLoggable(PlatformLogger.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
}
retargetMouseEvent(mouseOver, id, e);
break;
......
......@@ -24,9 +24,9 @@
*/
package java.awt;
import java.util.logging.*;
import java.util.List;
import java.util.ArrayList;
import sun.util.logging.PlatformLogger;
/**
* A FocusTraversalPolicy that determines traversal order based on the order
......@@ -60,7 +60,7 @@ import java.util.ArrayList;
public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
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 BACKWARD_TRAVERSAL = 1;
......@@ -165,7 +165,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
if (getImplicitDownCycleTraversal()) {
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 +
" in the focus cycle root " + cont);
}
......@@ -177,7 +177,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
cont.getFocusTraversalPolicy().getDefaultComponent(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);
}
}
......@@ -208,7 +208,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
* aComponent is null
*/
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) {
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.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.
// In that case we must quit the cycle, otherwise return the component found.
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;
}
aComponent = provider;
......@@ -255,12 +255,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
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);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getFirstComponent(aContainer);
......@@ -325,7 +325,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.
// In that case we must quit the cycle, otherwise return the component found.
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;
}
aComponent = provider;
......@@ -349,12 +349,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
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);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getLastComponent(aContainer);
......@@ -401,7 +401,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
public Component getFirstComponent(Container aContainer) {
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) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -420,10 +420,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
}
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;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (Component comp : cycle) {
if (accept(comp)) {
......@@ -451,7 +451,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
*/
public Component getLastComponent(Container aContainer) {
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) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -470,10 +470,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
}
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;
}
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--) {
Component comp = cycle.get(i);
......
......@@ -36,10 +36,10 @@ import java.util.Hashtable;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.*;
import java.security.AccessController;
import sun.util.logging.PlatformLogger;
/**
* 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 Logger log = Logger.getLogger("java.awt.Cursor");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Cursor");
static {
/* ensure that the necessary native libraries are loaded */
......@@ -298,8 +298,8 @@ public class Cursor implements java.io.Serializable {
String key = prefix + DotFileSuffix;
if (!systemCustomCursorProperties.containsKey(key)) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
}
return null;
}
......@@ -353,8 +353,8 @@ public class Cursor implements java.io.Serializable {
}
if (cursor == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
}
} else {
systemCustomCursors.put(name, cursor);
......
......@@ -35,8 +35,7 @@ import java.util.Iterator;
import java.util.ListIterator;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
......@@ -62,7 +61,7 @@ import sun.awt.CausedFocusEvent;
* @since 1.4
*/
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
private static final WeakReference<Window> NULL_WINDOW_WR =
......@@ -275,7 +274,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
* <code>false</code> otherwise
*/
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()) {
case WindowEvent.WINDOW_GAINED_FOCUS: {
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
// should receive focus first
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "tempLost {0}, toFocus {1}",
new Object[]{tempLost, toFocus});
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("tempLost {0}, toFocus {1}",
tempLost, toFocus);
}
if (tempLost != null) {
tempLost.requestFocusInWindow(CausedFocusEvent.Cause.ACTIVATION);
......@@ -447,8 +446,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
Component oldFocusOwner = getGlobalFocusOwner();
Component newFocusOwner = fe.getComponent();
if (oldFocusOwner == newFocusOwner) {
if (focusLog.isLoggable(Level.FINE)) {
focusLog.log(Level.FINE, "Skipping {0} because focus owner is the same", new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE)) {
focusLog.fine("Skipping {0} because focus owner is the same", e);
}
// We can't just drop the event - there could be
// type-ahead markers associated with it.
......@@ -565,16 +564,16 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
FocusEvent fe = (FocusEvent)e;
Component currentFocusOwner = getGlobalFocusOwner();
if (currentFocusOwner == null) {
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because focus owner is null",
new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Skipping {0} because focus owner is null", e);
break;
}
// Ignore cases where a Component loses focus to itself.
// If we make a mistake because of retargeting, then the
// FOCUS_GAINED handler will correct it.
if (currentFocusOwner == fe.getOppositeComponent()) {
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because current focus owner is equal to opposite",
new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Skipping {0} because current focus owner is equal to opposite", e);
break;
}
......@@ -642,9 +641,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
Window losingFocusWindow = we.getWindow();
Window activeWindow = getGlobalActiveWindow();
Window oppositeWindow = we.getOppositeWindow();
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Active {0}, Current focused {1}, losing focus {2} opposite {3}",
new Object[] {activeWindow, currentFocusedWindow,
losingFocusWindow, oppositeWindow});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Active {0}, Current focused {1}, losing focus {2} opposite {3}",
activeWindow, currentFocusedWindow,
losingFocusWindow, oppositeWindow);
if (currentFocusedWindow == null) {
break;
}
......@@ -828,7 +828,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
}
if (ke != null) {
focusLog.log(Level.FINER, "Pumping approved event {0}", new Object[] {ke});
focusLog.finer("Pumping approved event {0}", ke);
enqueuedKeyEvents.removeFirst();
}
}
......@@ -843,14 +843,14 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
* Dumps the list of type-ahead queue markers to stderr
*/
void dumpMarkers() {
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, ">>> Markers dump, time: {0}", System.currentTimeMillis());
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest(">>> Markers dump, time: {0}", System.currentTimeMillis());
synchronized (this) {
if (typeAheadMarkers.size() != 0) {
Iterator iter = typeAheadMarkers.iterator();
while (iter.hasNext()) {
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.
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);
return true;
}
......@@ -890,7 +890,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
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();
// Search the marker list for the first marker tied to
// the Component which just gained focus. Then remove
......@@ -919,10 +919,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
} else {
// 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();
redispatchEvent(target, e);
......@@ -1159,8 +1159,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
return;
}
focusLog.log(Level.FINER, "Enqueue at {0} for {1}",
new Object[] {after, untilFocused});
focusLog.finer("Enqueue at {0} for {1}",
after, untilFocused);
int insertionIndex = 0,
i = typeAheadMarkers.size();
......@@ -1199,8 +1199,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
return;
}
focusLog.log(Level.FINER, "Dequeue at {0} for {1}",
new Object[] {after, untilFocused});
focusLog.finer("Dequeue at {0} for {1}",
after, untilFocused);
TypeAheadMarker marker;
ListIterator iter = typeAheadMarkers.listIterator
......
......@@ -36,7 +36,7 @@ import sun.awt.AWTAutoShutdown;
import sun.awt.SunToolkit;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.dnd.SunDragSourceContextPeer;
import sun.awt.EventQueueDelegate;
......@@ -61,7 +61,7 @@ import sun.awt.EventQueueDelegate;
* @since 1.1
*/
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 boolean doDispatch = true;
......@@ -275,8 +275,8 @@ class EventDispatchThread extends Thread {
}
while (eventOK == false);
if (eventLog.isLoggable(Level.FINEST)) {
eventLog.log(Level.FINEST, "Dispatching: " + event);
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
eventLog.finest("Dispatching: " + event);
}
Object handle = null;
......@@ -308,8 +308,8 @@ class EventDispatchThread extends Thread {
}
private void processException(Throwable e) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Processing exception: " + e);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Processing exception: " + e);
}
getUncaughtExceptionHandler().uncaughtException(this, e);
// don't rethrow the exception to avoid EDT recreation
......
......@@ -36,7 +36,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.EmptyStackException;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.AWTAutoShutdown;
......@@ -153,7 +153,7 @@ public class EventQueue {
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 {
AWTAccessor.setEventQueueAccessor(
......@@ -707,8 +707,8 @@ public class EventQueue {
* @since 1.2
*/
public synchronized void push(EventQueue newEventQueue) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "EventQueue.push(" + newEventQueue + ")");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("EventQueue.push(" + newEventQueue + ")");
}
if (nextQueue != null) {
......@@ -722,8 +722,8 @@ public class EventQueue {
try {
newEventQueue.postEventPrivate(getNextEvent());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Interrupted push", ie);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Interrupted push", ie);
}
}
}
......@@ -766,8 +766,8 @@ public class EventQueue {
* @since 1.2
*/
protected void pop() throws EmptyStackException {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "EventQueue.pop(" + this + ")");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("EventQueue.pop(" + this + ")");
}
// To prevent deadlock, we lock on the previous EventQueue before
......@@ -790,8 +790,8 @@ public class EventQueue {
try {
previousQueue.postEventPrivate(getNextEvent());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Interrupted pop", ie);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Interrupted pop", ie);
}
}
}
......
......@@ -53,8 +53,7 @@ import java.util.Set;
import java.util.StringTokenizer;
import java.util.WeakHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.HeadlessToolkit;
......@@ -111,7 +110,7 @@ public abstract class KeyboardFocusManager
{
// 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 {
/* ensure that the necessary native libraries are loaded */
......@@ -154,7 +153,7 @@ public abstract class KeyboardFocusManager
*/
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.
......@@ -504,8 +503,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return focusOwner;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -609,9 +608,9 @@ public abstract class KeyboardFocusManager
}
void setNativeFocusOwner(Component comp) {
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "Calling peer {0} setCurrentFocusOwner for {1}",
new Object[] {peer, comp});
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}",
peer, comp);
}
peer.setCurrentFocusOwner(comp);
}
......@@ -673,8 +672,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return permanentFocusOwner;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -781,8 +780,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return focusedWindow;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -885,8 +884,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return activeWindow;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -919,8 +918,8 @@ public abstract class KeyboardFocusManager
Window oldActiveWindow;
synchronized (KeyboardFocusManager.class) {
oldActiveWindow = getActiveWindow();
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
}
try {
......@@ -1215,8 +1214,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return currentFocusCycleRoot;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -2149,9 +2148,9 @@ public abstract class KeyboardFocusManager
HeavyweightFocusRequest(Component heavyweight, Component descendant,
boolean temporary, CausedFocusEvent.Cause cause) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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 temporary, CausedFocusEvent.Cause cause) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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) {
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,
boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
{
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (heavyweight == null) {
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
log.fine("Assertion (heavyweight != null) failed");
}
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 nativeFocusOwner = thisManager.getNativeFocusOwner();
Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "SNFH for {0} in {1}",
new Object[] {descendant, heavyweight});
}
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "0. Current focus owner {0}",
currentFocusOwner);
focusLog.log(Level.FINEST, "0. Native focus owner {0}",
nativeFocusOwner);
focusLog.log(Level.FINEST, "0. Native focused window {0}",
nativeFocusedWindow);
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("SNFH for {0} in {1}",
descendant, heavyweight);
}
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("0. Current focus owner {0}",
currentFocusOwner);
focusLog.finest("0. Native focus owner {0}",
nativeFocusOwner);
focusLog.finest("0. Native focused window {0}",
nativeFocusedWindow);
}
synchronized (heavyweightRequests) {
HeavyweightFocusRequest hwFocusRequest = getLastHWRequest();
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "Request {0}", hwFocusRequest);
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("Request {0}", hwFocusRequest);
}
if (hwFocusRequest == null &&
heavyweight == nativeFocusOwner)
{
if (descendant == currentFocusOwner) {
// Redundant request.
if (focusLog.isLoggable(Level.FINEST))
focusLog.log(Level.FINEST, "1. SNFH_FAILURE for {0}",
descendant);
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("1. SNFH_FAILURE for {0}",
descendant);
return SNFH_FAILURE;
}
......@@ -2417,8 +2416,8 @@ public abstract class KeyboardFocusManager
// SunToolkit.postPriorityEvent(newFocusOwnerEvent);
SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent);
if (focusLog.isLoggable(Level.FINEST))
focusLog.log(Level.FINEST, "2. SNFH_HANDLED for {0}", descendant);
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("2. SNFH_HANDLED for {0}", descendant);
return SNFH_SUCCESS_HANDLED;
} else if (hwFocusRequest != null &&
hwFocusRequest.heavyweight == heavyweight) {
......@@ -2431,7 +2430,7 @@ public abstract class KeyboardFocusManager
manager.enqueueKeyEvents(time, descendant);
}
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("3. SNFH_HANDLED for lightweight" +
descendant + " in " + heavyweight);
return SNFH_SUCCESS_HANDLED;
......@@ -2454,7 +2453,7 @@ public abstract class KeyboardFocusManager
(hwFocusRequest != null)
? hwFocusRequest.heavyweight
: nativeFocusedWindow)) {
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("4. SNFH_FAILURE for " + descendant);
return SNFH_FAILURE;
}
......@@ -2464,7 +2463,7 @@ public abstract class KeyboardFocusManager
heavyweightRequests.add
(new HeavyweightFocusRequest(heavyweight, descendant,
temporary, cause));
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("5. SNFH_PROCEED for " + descendant);
return SNFH_SUCCESS_PROCEED;
}
......@@ -2855,13 +2854,13 @@ public abstract class KeyboardFocusManager
}
KeyboardFocusManager manager = getCurrentKeyboardFocusManager();
if (focusLog.isLoggable(Level.FINER)) {
if (focusLog.isLoggable(PlatformLogger.FINER)) {
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) {
focusLog.log(Level.FINER, " focus owner is {0}", new Object[] {manager.getGlobalFocusOwner()});
focusLog.log(Level.FINER, ">>> {0}", new Object[] {event});
if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) {
focusLog.finer(" focus owner is {0}", manager.getGlobalFocusOwner());
focusLog.finer(">>> {0}", event);
}
}
......@@ -2945,9 +2944,9 @@ public abstract class KeyboardFocusManager
}
}
static void removeLastFocusRequest(Component heavyweight) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.URLConnection;
import java.io.File;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import sun.awt.image.SunWritableRaster;
/**
......@@ -204,8 +203,8 @@ public final class SplashScreen {
}
}
catch(java.net.MalformedURLException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "MalformedURLException caught in the getImageURL() method", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("MalformedURLException caught in the getImageURL() method", e);
}
}
}
......@@ -355,7 +354,7 @@ public final class SplashScreen {
*/
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 boolean _isVisible(long splashPtr);
......
......@@ -48,7 +48,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
......@@ -1956,7 +1956,7 @@ public abstract class Toolkit {
*/
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 int[] calls = new int[LONG_BITS];
......@@ -2123,9 +2123,9 @@ public abstract class Toolkit {
}
synchronized int countAWTEventListeners(long eventMask) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.Set;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.accessibility.*;
import sun.awt.AWTAccessor;
......@@ -61,6 +59,7 @@ import sun.java2d.Disposer;
import sun.java2d.pipe.Region;
import sun.security.action.GetPropertyAction;
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
......@@ -324,7 +323,7 @@ public class Window extends Container implements Accessible {
*/
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;
......@@ -2985,7 +2984,7 @@ public class Window extends Container implements Accessible {
}
synchronized (getTreeLock()) {
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);
}
}
......
......@@ -29,8 +29,7 @@ import java.awt.Event;
import java.awt.Component;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.util.Arrays;
/**
......@@ -55,7 +54,7 @@ import java.util.Arrays;
* @since 1.1
*/
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.
......@@ -344,8 +343,8 @@ public abstract class InputEvent extends ComponentEvent {
sm.checkSystemClipboardAccess();
b = true;
} catch (SecurityException se) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "InputEvent.canAccessSystemClipboard() got SecurityException ", se);
if (logger.isLoggable(PlatformLogger.FINE)) {
logger.fine("InputEvent.canAccessSystemClipboard() got SecurityException ", se);
}
}
} else {
......
......@@ -32,7 +32,6 @@ import java.lang.reflect.*;
import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.util.*;
import java.util.logging.*;
import com.sun.java.swing.SwingUtilities3;
......@@ -41,6 +40,7 @@ import sun.java2d.SunGraphics2D;
import sun.security.action.GetPropertyAction;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import sun.awt.SunToolkit;
import sun.util.logging.PlatformLogger;
/**
* 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_GET_BUFFER_STRATEGY_METHOD;
private static final Logger LOGGER = Logger.getLogger(
private static final PlatformLogger LOGGER = PlatformLogger.getLogger(
"javax.swing.BufferStrategyPaintManager");
/**
......@@ -222,9 +222,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
private void dispose(java.util.List<BufferInfo> bufferInfos) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "BufferStrategyPaintManager disposed",
new RuntimeException());
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("BufferStrategyPaintManager disposed",
new RuntimeException());
}
if (bufferInfos != null) {
for (BufferInfo bufferInfo : bufferInfos) {
......@@ -305,7 +305,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
}
// Invalid root, do what Swing has always done.
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare failed");
}
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);
} else {
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("copyArea: prepare failed or not in sync");
}
// 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");
}
// Reset the area that needs to be painted.
......@@ -371,7 +371,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
public void endPaint() {
if (LOGGER.isLoggable(Level.FINEST)) {
if (LOGGER.isLoggable(PlatformLogger.FINEST)) {
LOGGER.finest("endPaint: region " + accumulatedX + " " +
accumulatedY + " " + accumulatedMaxX + " " +
accumulatedMaxY);
......@@ -420,7 +420,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
contentsLost = bufferStrategy.contentsLost();
}
if (contentsLost) {
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("endPaint: contents lost");
}
// Shown region was bogus, mark buffer as out of sync.
......@@ -514,7 +514,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
contentsLost = true;
bufferInfo = new BufferInfo(root);
bufferInfos.add(bufferInfo);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare: new BufferInfo: " + root);
}
}
......@@ -525,7 +525,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
bsg = bufferStrategy.getDrawGraphics();
if (bufferStrategy.contentsRestored()) {
contentsLost = true;
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer(
"prepare: contents restored in prepare");
}
......@@ -539,7 +539,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (bufferInfo.getContentsLostDuringExpose()) {
contentsLost = true;
bufferInfo.setContentsLostDuringExpose(false);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare: contents lost on expose");
}
}
......@@ -642,7 +642,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (biRoot == null) {
// Window gc'ed
bufferInfos.remove(counter);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("BufferInfo pruned, root null");
}
}
......@@ -748,7 +748,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (bs != null) {
weakBS = new WeakReference<BufferStrategy>(bs);
}
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("getBufferStrategy: created bs: " + bs);
}
}
......@@ -806,7 +806,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
BufferStrategy bs = null;
if (SwingUtilities3.isVsyncRequested(root)) {
bs = createBufferStrategy(root, true);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStrategy: using vsynced strategy");
}
}
......@@ -848,9 +848,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
invoke(root);
} catch (InvocationTargetException ite) {
// Type is not supported
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "createBufferStratety failed",
ite);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStratety failed",
ite);
}
} catch (IllegalArgumentException iae) {
assert false;
......@@ -864,9 +864,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
bs = ((Window)root).getBufferStrategy();
} catch (AWTException e) {
// Type not supported
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "createBufferStratety failed",
e);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStratety failed",
e);
}
}
}
......@@ -878,8 +878,8 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
*/
public void dispose() {
Container root = getRoot();
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "disposed BufferInfo for: " + root);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("disposed BufferInfo for: " + root);
}
if (root != null) {
root.removeComponentListener(this);
......
......@@ -29,7 +29,7 @@ import java.awt.Container;
import java.awt.Window;
import java.util.*;
import java.awt.FocusTraversalPolicy;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* A FocusTraversalPolicy that determines traversal order by sorting the
......@@ -64,7 +64,7 @@ public class SortingFocusTraversalPolicy
private Comparator<? super Component> comparator;
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
......@@ -115,8 +115,8 @@ public class SortingFocusTraversalPolicy
try {
index = Collections.binarySearch(cycle, aComponent, comparator);
} catch (ClassCastException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "### During the binary search for " + aComponent + " the exception occured: ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### During the binary search for " + aComponent + " the exception occured: ", e);
}
return -1;
}
......@@ -193,7 +193,7 @@ public class SortingFocusTraversalPolicy
if (getImplicitDownCycleTraversal()) {
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 +
" in the focus cycle root " + cont);
}
......@@ -205,7 +205,7 @@ public class SortingFocusTraversalPolicy
cont.getFocusTraversalPolicy().getDefaultComponent(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);
}
}
......@@ -236,7 +236,7 @@ public class SortingFocusTraversalPolicy
* aComponent is null
*/
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);
}
......@@ -260,7 +260,7 @@ public class SortingFocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.
// In that case we must quit the cycle, otherwise return the component found.
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;
}
aComponent = provider;
......@@ -279,12 +279,12 @@ public class SortingFocusTraversalPolicy
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);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getFirstComponent(aContainer);
......@@ -349,7 +349,7 @@ public class SortingFocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.
// In that case we must quit the cycle, otherwise return the component found.
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;
}
aComponent = provider;
......@@ -373,12 +373,12 @@ public class SortingFocusTraversalPolicy
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);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getLastComponent(aContainer);
......@@ -424,7 +424,7 @@ public class SortingFocusTraversalPolicy
public Component getFirstComponent(Container aContainer) {
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) {
throw new IllegalArgumentException("aContainer cannot be null");
}
......@@ -436,10 +436,10 @@ public class SortingFocusTraversalPolicy
}
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;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (Component comp : cycle) {
if (accept(comp)) {
......@@ -466,7 +466,7 @@ public class SortingFocusTraversalPolicy
*/
public Component getLastComponent(Container aContainer) {
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) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -479,10 +479,10 @@ public class SortingFocusTraversalPolicy
}
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;
}
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--) {
Component comp = cycle.get(i);
......
......@@ -30,7 +30,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.IdentityHashMap;
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
......@@ -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 (mainLock) {
aLog.fine("Mapped peers:");
......
......@@ -40,10 +40,9 @@ import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import sun.util.logging.PlatformLogger;
/**
* The AppContext is a table referenced by ThreadGroup which stores
......@@ -128,7 +127,7 @@ import java.beans.PropertyChangeListener;
* @author Fred Ecks
*/
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
* session, this class should never be serialized. */
......@@ -380,9 +379,7 @@ public final class AppContext {
try {
w.dispose();
} catch (Throwable t) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "exception occured while disposing app context", t);
}
log.finer("exception occured while disposing app context", t);
}
}
AccessController.doPrivileged(new PrivilegedAction() {
......
......@@ -39,8 +39,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.security.AccessController;
import java.security.PrivilegedAction;
......@@ -78,7 +77,7 @@ public class ComponentAccessor
private static Method methodGetCursorNoClientCode;
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() {
}
......@@ -136,13 +135,13 @@ public class ComponentAccessor
methodLocationNoClientCode.setAccessible(true);
}
catch (NoSuchFieldException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
catch (ClassNotFoundException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
catch (NoSuchMethodException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
// to please javac
return null;
......@@ -157,7 +156,7 @@ public class ComponentAccessor
}
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)
{
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)
{
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)
{
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)
{
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)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return 0;
}
......@@ -225,7 +224,7 @@ public class ComponentAccessor
}
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;
}
......@@ -236,7 +235,7 @@ public class ComponentAccessor
}
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;
}
......@@ -247,7 +246,7 @@ public class ComponentAccessor
}
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;
}
......@@ -258,7 +257,7 @@ public class ComponentAccessor
}
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;
}
......@@ -271,10 +270,10 @@ public class ComponentAccessor
}
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) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return parent;
......@@ -288,10 +287,10 @@ public class ComponentAccessor
}
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) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return font;
......@@ -307,10 +306,10 @@ public class ComponentAccessor
}
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) {
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)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", 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)
{
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)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return color;
}
......@@ -361,7 +360,7 @@ public class ComponentAccessor
}
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;
}
......@@ -372,7 +371,7 @@ public class ComponentAccessor
}
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)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return f;
}
......@@ -396,7 +395,7 @@ public class ComponentAccessor
}
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;
}
......@@ -406,7 +405,7 @@ public class ComponentAccessor
fieldPeer.set(c, peer);
} 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);
}
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;
......@@ -427,7 +426,7 @@ public class ComponentAccessor
}
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;
}
......@@ -439,10 +438,10 @@ public class ComponentAccessor
}
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) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return enabled;
}
......@@ -455,10 +454,10 @@ public class ComponentAccessor
}
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) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return cursor;
......@@ -472,12 +471,13 @@ public class ComponentAccessor
}
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) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return loc;
}
}
......@@ -28,7 +28,7 @@ package sun.awt;
import java.io.*;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/*
* Internal class that manages sun.awt.Debug settings.
......@@ -72,7 +72,7 @@ import java.util.logging.*;
* the fix for 4638447).
*/
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 */
static final String PREFIX = "awtdebug";
......@@ -128,8 +128,8 @@ final class DebugSettings {
});
// echo the initial property settings to stdout
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "DebugSettings:\n{0}", this);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("DebugSettings:\n{0}" + this);
}
}
......@@ -258,8 +258,8 @@ final class DebugSettings {
}
private void println(Object object) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, object.toString());
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer(object.toString());
}
}
......
......@@ -37,7 +37,6 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Logger;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
......@@ -51,6 +50,7 @@ import sun.font.CompositeFontDescriptor;
import sun.font.SunFontManager;
import sun.font.FontManagerFactory;
import sun.font.FontUtilities;
import sun.util.logging.PlatformLogger;
/**
* 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 Hashtable localeMap = null;
private static FontConfiguration fontConfig;
private static Logger logger;
private static PlatformLogger logger;
protected static boolean isProperties = true;
protected SunFontManager fontManager;
......@@ -83,7 +83,7 @@ public abstract class FontConfiguration {
*/
public FontConfiguration(SunFontManager fm) {
if (FontUtilities.debugFonts() && logger == null) {
logger = Logger.getLogger("sun.awt.FontConfiguration");
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
}
fontManager = fm;
setOsNameAndVersion(); /* static initialization */
......@@ -366,7 +366,7 @@ public abstract class FontConfiguration {
stringTable = new StringBuilder(4096);
if (verbose && logger == null) {
logger = Logger.getLogger("sun.awt.FontConfiguration");
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
}
new PropertiesHandler().load(in);
......
......@@ -39,12 +39,11 @@ import java.awt.peer.ComponentPeer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
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 =
AWTAccessor.getKeyboardFocusManagerAccessor();
......@@ -64,7 +63,8 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
public void clearGlobalFocusOwner(Window activeWindow) {
if (activeWindow != null) {
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) {
FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
......@@ -130,14 +130,16 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
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);
}
FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
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);
return true;
}
......
......@@ -30,7 +30,7 @@ import java.awt.Insets;
import java.awt.Adjustable;
import java.awt.event.MouseWheelEvent;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/*
* ScrollPaneWheelScroller is a helper class for implmenenting mouse wheel
......@@ -39,7 +39,7 @@ import java.util.logging.*;
*/
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() {}
......@@ -47,8 +47,8 @@ public abstract class ScrollPaneWheelScroller {
* Called from ScrollPane.processMouseWheelEvent()
*/
public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
}
int increment = 0;
......@@ -56,8 +56,8 @@ public abstract class ScrollPaneWheelScroller {
Adjustable adj = getAdjustableToScroll(sp);
if (adj != null) {
increment = getIncrementFromAdjustable(adj, e);
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "increment from adjustable(" + adj.getClass() + ") : " + increment);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment);
}
scrollAdjustable(adj, increment);
}
......@@ -74,8 +74,8 @@ public abstract class ScrollPaneWheelScroller {
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using vertical scrolling due to scrollbar policy");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
......@@ -85,31 +85,31 @@ public abstract class ScrollPaneWheelScroller {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "insets: l = " + ins.left + ", r = " + ins.right +
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", 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
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using vertical scrolling because scrollbar is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using horiz scrolling because scrollbar is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using NO scrollbar becsause neither is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
......@@ -124,9 +124,9 @@ public abstract class ScrollPaneWheelScroller {
*/
public static int getIncrementFromAdjustable(Adjustable adj,
MouseWheelEvent e) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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.
*/
public static void scrollAdjustable(Adjustable adj, int amount) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (adj == null) {
log.log(Level.FINE, "Assertion (adj != null) failed");
log.fine("Assertion (adj != null) failed");
}
if (amount == 0) {
log.log(Level.FINE, "Assertion (amount != 0) failed");
log.fine("Assertion (amount != 0) failed");
}
}
int current = adj.getValue();
int upperLimit = adj.getMaximum() - adj.getVisibleAmount();
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "doScrolling by " + amount);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("doScrolling by " + amount);
}
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.WeakHashMap;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* 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.
*/
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.
// 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.
*/
public void add(DisplayChangedListener theListener) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (theListener == null) {
log.log(Level.FINE, "Assertion (theListener != null) failed");
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Adding listener: " + theListener);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Adding listener: " + theListener);
}
listeners.put(theListener, null);
}
......@@ -83,13 +83,13 @@ public class SunDisplayChanger {
* Remove the given DisplayChangeListener from this SunDisplayChanger.
*/
public void remove(DisplayChangedListener theListener) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (theListener == null) {
log.log(Level.FINE, "Assertion (theListener != null) failed");
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Removing listener: " + theListener);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Removing listener: " + theListener);
}
listeners.remove(theListener);
}
......@@ -99,8 +99,8 @@ public class SunDisplayChanger {
* taken place by calling their displayChanged() methods.
*/
public void notifyListeners() {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "notifyListeners");
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("notifyListeners");
}
// 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
......@@ -126,8 +126,8 @@ public class SunDisplayChanger {
DisplayChangedListener current =
(DisplayChangedListener) itr.next();
try {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "displayChanged for listener: " + current);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("displayChanged for listener: " + current);
}
current.displayChanged();
} catch (IllegalComponentStateException e) {
......@@ -146,7 +146,7 @@ public class SunDisplayChanger {
* taken place by calling their paletteChanged() methods.
*/
public void notifyPaletteChanged() {
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("notifyPaletteChanged");
}
// This method is implemented by making a clone of the set of listeners,
......@@ -172,8 +172,8 @@ public class SunDisplayChanger {
DisplayChangedListener current =
(DisplayChangedListener) itr.next();
try {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "paletteChanged for listener: " + current);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("paletteChanged for listener: " + current);
}
current.paletteChanged();
} catch (IllegalComponentStateException e) {
......
......@@ -27,14 +27,14 @@ package sun.awt;
import java.awt.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
public abstract class SunGraphicsCallback {
public static final int HEAVYWEIGHTS = 0x1;
public static final int LIGHTWEIGHTS = 0x2;
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);
......@@ -87,11 +87,11 @@ public abstract class SunGraphicsCallback {
int ncomponents = comps.length;
Shape clip = g.getClip();
if (log.isLoggable(Level.FINER) && (clip != null)) {
if (log.isLoggable(PlatformLogger.FINER) && (clip != null)) {
Rectangle newrect = clip.getBounds();
log.log(Level.FINER, "x = " + newrect.x + ", y = " + newrect.y +
", width = " + newrect.width +
", height = " + newrect.height);
log.finer("x = " + newrect.x + ", y = " + newrect.y +
", width = " + newrect.width +
", height = " + newrect.height);
}
// A seriously sad hack--
......
......@@ -40,8 +40,7 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.misc.SoftCache;
import sun.font.FontDesignMetrics;
import sun.awt.im.InputContext;
......@@ -61,7 +60,7 @@ public abstract class SunToolkit extends Toolkit
implements WindowClosingSupport, WindowClosingListener,
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 */
static {
......@@ -986,9 +985,9 @@ public abstract class SunToolkit extends Toolkit
//with scale factors x1, x3/4, x2/3, xN, x1/N.
Image im = i.next();
if (im == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
"Skipping the image passed into Java because it's null.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Skipping the image passed into Java because it's null.");
}
continue;
}
......@@ -1002,9 +1001,9 @@ public abstract class SunToolkit extends Toolkit
iw = im.getWidth(null);
ih = im.getHeight(null);
} catch (Exception e){
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue;
}
......@@ -1077,8 +1076,8 @@ public abstract class SunToolkit extends Toolkit
try {
int x = (width - bestWidth) / 2;
int y = (height - bestHeight) / 2;
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "WWindowPeer.getScaledIconData() result : " +
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("WWindowPeer.getScaledIconData() result : " +
"w : " + width + " h : " + height +
" iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) +
" 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) {
BufferedImage bimage = getScaledIconImage(imageList, width, height);
if (bimage == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconData: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconData: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
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);
}
......
......@@ -29,8 +29,7 @@ import java.awt.Window;
import java.lang.reflect.Field;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.security.AccessController;
import java.security.PrivilegedAction;
......@@ -41,7 +40,7 @@ public class WindowAccessor {
private static Field fieldIsAutoRequestFocus;
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() {
}
......@@ -57,9 +56,9 @@ public class WindowAccessor {
fieldIsTrayIconWindow.setAccessible(true);
} catch (NoSuchFieldException e) {
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
log.fine("Unable to initialize WindowAccessor: ", e);
} catch (ClassNotFoundException e) {
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
log.fine("Unable to initialize WindowAccessor: ", e);
}
return null;
}
......@@ -71,7 +70,7 @@ public class WindowAccessor {
return fieldIsAutoRequestFocus.getBoolean(w);
} 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;
}
......@@ -81,7 +80,7 @@ public class WindowAccessor {
return fieldIsTrayIconWindow.getBoolean(w);
} 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;
}
......@@ -91,7 +90,7 @@ public class WindowAccessor {
fieldIsTrayIconWindow.set(w, isTrayIconWindow);
} 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.TreeSet;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
......@@ -222,7 +222,7 @@ public abstract class DataTransferer {
*/
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 {
Class tCharArrayClass = null, tByteArrayClass = null;
......@@ -382,9 +382,9 @@ public abstract class DataTransferer {
* "text".
*/
public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
if (dtLog.isLoggable(Level.FINE)) {
if (dtLog.isLoggable(PlatformLogger.FINE)) {
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.Arrays;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.io.IOException;
import java.io.InputStream;
......@@ -99,7 +99,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
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
......@@ -845,8 +845,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
void registerEvent(SunDropTargetEvent e) {
handler.lock();
if (!eventSet.add(e) && dndLog.isLoggable(Level.FINE)) {
dndLog.log(Level.FINE, "Event is already registered: " + e);
if (!eventSet.add(e) && dndLog.isLoggable(PlatformLogger.FINE)) {
dndLog.fine("Event is already registered: " + e);
}
handler.unlock();
}
......
......@@ -50,9 +50,9 @@ import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.logging.*;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import sun.util.logging.PlatformLogger;
import sun.awt.SunToolkit;
/**
......@@ -67,7 +67,7 @@ import sun.awt.SunToolkit;
public class InputContext extends java.awt.im.InputContext
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:
// a locator is used to keep information about the selected
// 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;
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) {
((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
}
......@@ -889,7 +889,7 @@ public class InputContext extends java.awt.im.InputContext
{inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
throwable.getLocalizedMessage()};
MessageFormat mf = new MessageFormat(errorTextFormat);
Logger logger = Logger.getLogger("sun.awt.im");
PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
logger.config(mf.format(args));
}
......
......@@ -31,12 +31,11 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.security.AccessController;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.plaf.FontUIResource;
import sun.security.action.GetPropertyAction;
import sun.util.logging.PlatformLogger;
/**
* A collection of utility methods.
......@@ -139,7 +138,7 @@ public final class FontUtilities {
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
private static boolean debugFonts = false;
private static Logger logger = null;
private static PlatformLogger logger = null;
private static boolean logging;
static {
......@@ -149,17 +148,17 @@ public final class FontUtilities {
if (debugLevel != null && !debugLevel.equals("false")) {
debugFonts = true;
logger = Logger.getLogger("sun.java2d");
logger = PlatformLogger.getLogger("sun.java2d");
if (debugLevel.equals("warning")) {
logger.setLevel(Level.WARNING);
logger.setLevel(PlatformLogger.WARNING);
} else if (debugLevel.equals("severe")) {
logger.setLevel(Level.SEVERE);
logger.setLevel(PlatformLogger.SEVERE);
}
}
if (debugFonts) {
logger = Logger.getLogger("sun.java2d", null);
logging = logger.getLevel() != Level.OFF;
logger = PlatformLogger.getLogger("sun.java2d");
logging = logger.isEnabled();
}
}
......@@ -298,7 +297,7 @@ public final class FontUtilities {
return false;
}
public static Logger getLogger() {
public static PlatformLogger getLogger() {
return logger;
}
......
......@@ -47,14 +47,13 @@ import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.plaf.FontUIResource;
import sun.awt.AppContext;
import sun.awt.FontConfiguration;
import sun.awt.SunToolkit;
import sun.java2d.FontSupport;
import sun.util.logging.PlatformLogger;
/**
* The base implementation of the {@link FontManager} interface. It implements
......@@ -473,7 +472,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
if (FontUtilities.debugFonts()) {
Logger logger = FontUtilities.getLogger();
PlatformLogger logger = FontUtilities.getLogger();
logger.info("JRE font directory: " + jreFontDirName);
logger.info("Extra font path: " + extraFontPath);
logger.info("Debug font path: " + dbgFontPath);
......@@ -1615,7 +1614,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
private void logPlatformFontInfo() {
Logger logger = FontUtilities.getLogger();
PlatformLogger logger = FontUtilities.getLogger();
for (int i=0; i< pathDirs.length;i++) {
logger.info("fontdir="+pathDirs[i]);
}
......@@ -2997,7 +2996,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
registeredFontFiles.add(fullName);
if (FontUtilities.debugFonts()
&& FontUtilities.getLogger().isLoggable(Level.INFO)) {
&& FontUtilities.getLogger().isLoggable(PlatformLogger.INFO)) {
String message = "Registering font " + fullName;
String[] natNames = getNativeNames(fullName, null);
if (natNames == null) {
......
......@@ -43,7 +43,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Locale;
import java.util.logging.Level;
import sun.java2d.Disposer;
import sun.java2d.DisposerRecord;
......@@ -405,7 +404,7 @@ public class TrueTypeFont extends FileFont {
}
} catch (FontFormatException e) {
if (FontUtilities.isLogging()) {
FontUtilities.getLogger().log(Level.SEVERE,
FontUtilities.getLogger().severe(
"While reading " + platName, e);
}
bread = -1; // signal EOF
......@@ -426,7 +425,7 @@ public class TrueTypeFont extends FileFont {
* file are handled as a FontFormatException.
*/
if (FontUtilities.isLogging()) {
FontUtilities.getLogger().log(Level.SEVERE,
FontUtilities.getLogger().severe(
"While reading " + platName, e);
}
if (bread == 0) {
......
......@@ -55,8 +55,6 @@ import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.awt.AppContext;
import sun.awt.DisplayChangedListener;
import sun.awt.FontConfiguration;
......@@ -80,7 +78,6 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
public static boolean isOpenSolaris;
private static Font defaultFont;
protected static Logger logger = null;
public SunGraphicsEnvironment() {
java.security.AccessController.doPrivileged(
......
......@@ -31,8 +31,6 @@ import java.awt.peer.TrayIconPeer;
import sun.awt.*;
import java.awt.image.*;
import java.text.BreakIterator;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.concurrent.ArrayBlockingQueue;
import java.security.AccessController;
import java.security.PrivilegedAction;
......
......@@ -33,7 +33,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import sun.awt.motif.X11FontMetrics;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
// FIXME: implement multi-select
/*
......@@ -43,7 +43,7 @@ import java.util.logging.*;
* posting of Item or ActionEvents
*/
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;
......@@ -263,7 +263,7 @@ public class ListHelper implements XScrollbarClient {
}
public int y2index(int y) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("y=" + y +", firstIdx=" + firstDisplayedIndex() +", itemHeight=" + getItemHeight()
+ ",item_margin=" + ITEM_MARGIN);
}
......
......@@ -25,10 +25,10 @@
package sun.awt.X11;
import sun.misc.Unsafe;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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;
final long[] unsafe_ptrs, x_ptrs;
final String name;
......@@ -59,11 +59,11 @@ class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
XToolkit.awtLock();
try {
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) {
log.log(Level.WARNING, name + " object was not disposed before finalization!", place);
log.warning(name + " object was not disposed before finalization!", place);
} 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.awt.*;
import sun.awt.XSettings;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
class XAWTXSettings extends XSettings implements XMSelectionListener {
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. */
public static final long MAX_LENGTH = 1000000;
......@@ -56,7 +55,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
}
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.addSelectionListener(this);
initPerScreenXSettings();
......@@ -67,12 +66,12 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
}
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) {
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) {
......@@ -81,7 +80,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
}
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,
......@@ -115,7 +114,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
}
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) {
return null;
}
......@@ -129,13 +128,13 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
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;
}
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());
if (array != null) {
settings = update(array);
......
......@@ -33,7 +33,7 @@ import sun.awt.*;
import java.util.ArrayList;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.java2d.SurfaceData;
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
......@@ -330,7 +330,7 @@ abstract public class XBaseMenuWindow extends XWindow {
items.add(mp);
}
} else {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
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()) {
items.remove(index);
} 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());
}
}
......@@ -386,7 +386,7 @@ abstract public class XBaseMenuWindow extends XWindow {
XMenuPeer showingSubmenu = getShowingSubmenu();
int newSelectedIndex = (item != null) ? items.indexOf(item) : -1;
if (this.selectedIndex != newSelectedIndex) {
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("Selected index changed, was : " + this.selectedIndex + ", new : " + newSelectedIndex);
}
this.selectedIndex = newSelectedIndex;
......@@ -426,7 +426,7 @@ abstract public class XBaseMenuWindow extends XWindow {
try {
synchronized(getMenuTreeLock()) {
if (showingSubmenu != submenuToShow) {
if (log.isLoggable(Level.FINER)) {
if (log.isLoggable(PlatformLogger.FINER)) {
log.finest("Changing showing submenu");
}
if (showingSubmenu != null) {
......@@ -1122,7 +1122,7 @@ abstract public class XBaseMenuWindow extends XWindow {
* that grabs input focus
*/
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) {
return;
}
......
......@@ -27,15 +27,15 @@ package sun.awt.X11;
import java.awt.*;
import sun.awt.*;
import java.util.logging.*;
import java.util.*;
import sun.util.logging.PlatformLogger;
public class XBaseWindow {
private static final Logger log = Logger.getLogger("sun.awt.X11.XBaseWindow");
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XBaseWindow");
private static final Logger eventLog = Logger.getLogger("sun.awt.X11.event.XBaseWindow");
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XBaseWindow");
private static final Logger grabLog = Logger.getLogger("sun.awt.X11.grab.XBaseWindow");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XBaseWindow");
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XBaseWindow");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("sun.awt.X11.event.XBaseWindow");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XBaseWindow");
private static final PlatformLogger grabLog = PlatformLogger.getLogger("sun.awt.X11.grab.XBaseWindow");
public static final String
PARENT_WINDOW = "parent window", // parent window, Long
......@@ -160,7 +160,7 @@ public class XBaseWindow {
* with class-specific values and perform post-initialization actions.
*/
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();
// Set WM_CLIENT_LEADER property
......@@ -198,7 +198,7 @@ public class XBaseWindow {
awtUnlock();
throw re;
} catch (Throwable t) {
log.log(Level.WARNING, "Exception during peer initialization", t);
log.warning("Exception during peer initialization", t);
awtLock();
initialising = InitialiseState.FAILED_INITIALISATION;
awtLockNotifyAll();
......@@ -360,7 +360,7 @@ public class XBaseWindow {
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);
}
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) {
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();
try {
XSizeHints hints = getHints();
......@@ -541,7 +541,7 @@ public class XBaseWindow {
flags |= XUtilConstants.PWinGravity;
hints.set_flags(flags);
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);
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
} finally {
......@@ -593,7 +593,7 @@ public class XBaseWindow {
public void xRequestFocus(long time) {
XToolkit.awtLock();
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);
} finally {
XToolkit.awtUnlock();
......@@ -602,7 +602,7 @@ public class XBaseWindow {
public void xRequestFocus() {
XToolkit.awtLock();
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());
} finally {
XToolkit.awtUnlock();
......@@ -619,7 +619,7 @@ public class XBaseWindow {
}
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();
try {
this.visible = visible;
......@@ -824,7 +824,7 @@ public class XBaseWindow {
* The active grab overrides activated automatic grab.
*/
public boolean grabInput() {
grabLog.log(Level.FINE, "Grab input on {0}", new Object[] {this});
grabLog.fine("Grab input on {0}", this);
XToolkit.awtLock();
try {
......@@ -887,7 +887,7 @@ public class XBaseWindow {
XToolkit.awtLock();
try {
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) {
grabWindow.ungrabInputImpl();
if (!XToolkit.getSunAwtDisableGrab()) {
......@@ -929,7 +929,7 @@ public class XBaseWindow {
mapped = false;
}
public void handleReparentNotifyEvent(XEvent xev) {
if (eventLog.isLoggable(Level.FINER)) {
if (eventLog.isLoggable(PlatformLogger.FINER)) {
XReparentEvent msg = xev.get_xreparent();
eventLog.finer(msg.toString());
}
......@@ -939,8 +939,8 @@ public class XBaseWindow {
if (XPropertyCache.isCachingSupported()) {
XPropertyCache.clearCache(window, XAtom.get(msg.get_atom()));
}
if (eventLog.isLoggable(Level.FINER)) {
eventLog.log(Level.FINER, "{0}", new Object[] {msg});
if (eventLog.isLoggable(PlatformLogger.FINER)) {
eventLog.finer("{0}", msg);
}
}
......@@ -969,7 +969,7 @@ public class XBaseWindow {
}
public void handleClientMessage(XEvent xev) {
if (eventLog.isLoggable(Level.FINER)) {
if (eventLog.isLoggable(PlatformLogger.FINER)) {
XClientMessageEvent msg = xev.get_xclient();
eventLog.finer(msg.toString());
}
......@@ -1021,8 +1021,7 @@ public class XBaseWindow {
}
public void handleConfigureNotifyEvent(XEvent xev) {
XConfigureEvent xe = xev.get_xconfigure();
insLog.log(Level.FINER, "Configure, {0}",
new Object[] {xe});
insLog.finer("Configure, {0}", xe);
x = xe.get_x();
y = xe.get_y();
width = xe.get_width();
......@@ -1073,7 +1072,7 @@ public class XBaseWindow {
}
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();
if (isDisposed()) {
......
......@@ -29,8 +29,6 @@ import java.awt.*;
import java.awt.peer.*;
import java.awt.event.*;
import java.util.logging.*;
import java.lang.reflect.Field;
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
*/
......
......@@ -32,11 +32,11 @@ import java.awt.image.BufferedImage;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import java.awt.geom.AffineTransform;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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 borderInsets = new Insets(2,2,2,2);
......@@ -172,7 +172,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
Checkbox cb = (Checkbox) e.getSource();
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
+ ", selected = " + selected + ", enabled = " + isEnabled());
}
......@@ -190,7 +190,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
}
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
+ ", selected = " + selected + ", enabled = " + isEnabled());
}
......@@ -215,7 +215,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
}
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
+ ", selected = " + selected + ", enabled = " + isEnabled());
}
......@@ -226,7 +226,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
}
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
+ ", selected = " + selected + ", enabled = " + isEnabled());
}
......
......@@ -28,7 +28,7 @@ package sun.awt.X11;
import java.awt.*;
import java.awt.peer.*;
import java.awt.event.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
// 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.
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
// items to be displayed
......@@ -892,7 +892,7 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS
if (transX > 0 && transX < width &&
transY > 0 && transY < height) {
int newIdx = helper.y2index(transY);
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("transX=" + transX + ", transY=" + transY
+ ",width=" + width + ", height=" + height
+ ", newIdx=" + newIdx + " on " + target);
......
......@@ -66,7 +66,8 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.*;
import sun.awt.event.IgnorePaintEvent;
import sun.awt.image.SunVolatileImage;
......@@ -77,12 +78,12 @@ import sun.java2d.pipe.Region;
public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer,
BackBufferCapsProvider
{
private static final Logger log = Logger.getLogger("sun.awt.X11.XComponentPeer");
private static final Logger buffersLog = Logger.getLogger("sun.awt.X11.XComponentPeer.multibuffer");
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XComponentPeer");
private static final Logger fontLog = Logger.getLogger("sun.awt.X11.font.XComponentPeer");
private static final Logger enableLog = Logger.getLogger("sun.awt.X11.enable.XComponentPeer");
private static final Logger shapeLog = Logger.getLogger("sun.awt.X11.shape.XComponentPeer");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XComponentPeer");
private static final PlatformLogger buffersLog = PlatformLogger.getLogger("sun.awt.X11.XComponentPeer.multibuffer");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XComponentPeer");
private static final PlatformLogger fontLog = PlatformLogger.getLogger("sun.awt.X11.font.XComponentPeer");
private static final PlatformLogger enableLog = PlatformLogger.getLogger("sun.awt.X11.enable.XComponentPeer");
private static final PlatformLogger shapeLog = PlatformLogger.getLogger("sun.awt.X11.shape.XComponentPeer");
boolean paintPending = false;
boolean isLayouting = false;
......@@ -159,7 +160,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
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()) {
setVisible(true);
......@@ -253,7 +254,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* Called when component receives focus
*/
public void focusGained(FocusEvent e) {
focusLog.log(Level.FINE, "{0}", new Object[] {e});
focusLog.fine("{0}", e);
bHasFocus = true;
}
......@@ -261,7 +262,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* Called when component loses focus
*/
public void focusLost(FocusEvent e) {
focusLog.log(Level.FINE, "{0}", new Object[] {e});
focusLog.fine("{0}", e);
bHasFocus = false;
}
......@@ -333,7 +334,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
// Currently we just generate focus events like we deal with lightweight instead of calling
// 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);
/**
* 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);
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)
// then we can proceed with children, otherwise we retreat.
if (!(res && parentWindow.isFocused())) {
......@@ -378,13 +379,13 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
private boolean rejectFocusRequestHelper(String logMsg) {
if (focusLog.isLoggable(Level.FINER)) focusLog.finer(logMsg);
if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(logMsg);
XKeyboardFocusManagerPeer.removeLastFocusRequest(target);
return false;
}
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) {
focusGained((FocusEvent)e);
} else {
......@@ -414,7 +415,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* @see java.awt.peer.ComponentPeer
*/
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);
enabled = value;
if (target instanceof Container) {
......@@ -690,7 +691,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
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()) {
background = c;
}
......@@ -699,7 +700,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
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()) {
foreground = c;
}
......@@ -718,7 +719,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* @since JDK1.0
*/
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);
}
......@@ -1188,7 +1189,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
public void createBuffers(int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (buffersLog.isLoggable(Level.FINE)) {
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")");
}
// 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,
BufferCapabilities.FlipContents flipAction)
{
if (buffersLog.isLoggable(Level.FINE)) {
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
buffersLog.fine("flip(" + flipAction + ")");
}
if (backBuffer == 0) {
......@@ -1217,7 +1218,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
public Image getBackBuffer() {
if (buffersLog.isLoggable(Level.FINE)) {
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
buffersLog.fine("getBackBuffer()");
}
if (backBuffer == 0) {
......@@ -1227,7 +1228,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
public void destroyBuffers() {
if (buffersLog.isLoggable(Level.FINE)) {
if (buffersLog.isLoggable(PlatformLogger.FINE)) {
buffersLog.fine("destroyBuffers()");
}
graphicsConfig.destroyBackBuffer(backBuffer);
......@@ -1262,7 +1263,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
* ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
*/
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()) {
switch (e.get_type()) {
case XConstants.ButtonPress:
......@@ -1272,7 +1273,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
case XConstants.EnterNotify:
case XConstants.LeaveNotify:
case XConstants.MotionNotify:
enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
enableLog.finer("Event {0} is disable", e);
return true;
}
}
......@@ -1393,7 +1394,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
*/
public void applyShape(Region shape) {
if (XlibUtil.isShapingSupported()) {
if (shapeLog.isLoggable(Level.FINER)) {
if (shapeLog.isLoggable(PlatformLogger.FINER)) {
shapeLog.finer(
"*** INFO: Setting shape: PEER: " + this
+ "; WINDOW: " + getWindow()
......@@ -1423,7 +1424,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
XToolkit.awtUnlock();
}
} else {
if (shapeLog.isLoggable(Level.FINER)) {
if (shapeLog.isLoggable(PlatformLogger.FINER)) {
shapeLog.finer("*** WARNING: Shaping is NOT supported!");
}
}
......
......@@ -30,8 +30,7 @@ import java.awt.Insets;
import java.awt.event.ComponentEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
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.
*/
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) {
final WindowDimensions dims = parentFrame.getDimensions();
......@@ -116,8 +115,8 @@ public final class XContentWindow extends XWindow {
if (in != null) {
newBounds.setLocation(-in.left, -in.top);
}
if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
new Object[] {newBounds, getBounds()});
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting content bounds {0}, old bounds {1}",
newBounds, getBounds());
// Fix for 5023533:
// 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
......
......@@ -30,17 +30,16 @@ import java.awt.event.ComponentEvent;
import java.awt.event.InvocationEvent;
import java.awt.event.WindowEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.ComponentAccessor;
import sun.awt.SunToolkit;
abstract class XDecoratedPeer extends XWindowPeer {
private static final Logger log = Logger.getLogger("sun.awt.X11.XDecoratedPeer");
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
private static final Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XDecoratedPeer");
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
// Set to true when we get the first ConfigureNotify after being
// reparented - indicates that WM has adopted the top-level.
......@@ -79,7 +78,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
Rectangle bounds = (Rectangle)params.get(BOUNDS);
dimensions = new WindowDimensions(bounds, getRealInsets(), false);
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
// them instead
......@@ -175,7 +174,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
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;
updateWMName();
}
......@@ -265,7 +264,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
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) {
wm_set_insets = copy(wm_set_insets);
......@@ -292,7 +291,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
public void handleReparentNotifyEvent(XEvent xev) {
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();
XToolkit.awtLock();
try {
......@@ -331,7 +330,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
// Check if we have insets provided by the WM
Insets correctWM = getWMSetInsets(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
Insets dimInsets = dimensions.getInsets();
if (correctWM.equals(dimInsets)) {
......@@ -345,9 +344,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
if (correctWM != null) {
insLog.log(Level.FINER, "correctWM {0}", new Object[] {correctWM});
insLog.finer("correctWM {0}", correctWM);
} 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).
*/
Insets correction = difference(correctWM, currentInsets);
insLog.log(Level.FINEST, "Corrention {0}", new Object[] {correction});
insLog.finest("Corrention {0}", correction);
if (!isNull(correction)) {
currentInsets = copy(correctWM);
applyGuessedInsets();
......@@ -378,7 +377,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
//update minimum size hints
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());
insets_corrected = true;
......@@ -452,8 +451,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
public Insets getInsets() {
Insets in = copy(getRealInsets());
in.top += getMenuBarHeight();
if (insLog.isLoggable(Level.FINEST)) {
insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
if (insLog.isLoggable(PlatformLogger.FINEST)) {
insLog.finest("Get insets returns {0}", in);
}
return in;
}
......@@ -482,7 +481,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
public void reshape(WindowDimensions newDimensions, int op,
boolean userReshape)
{
if (insLog.isLoggable(Level.FINE)) {
if (insLog.isLoggable(PlatformLogger.FINE)) {
insLog.fine("Reshaping " + this + " to " + newDimensions + " op " + op + " user reshape " + userReshape);
}
if (userReshape) {
......@@ -503,8 +502,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
XToolkit.awtLock();
try {
if (!isReparented() || !isVisible()) {
insLog.log(Level.FINE, "- not reparented({0}) or not visible({1}), default reshape",
new Object[] {Boolean.valueOf(isReparented()), Boolean.valueOf(visible)});
insLog.fine("- not reparented({0}) or not visible({1}), default reshape",
Boolean.valueOf(isReparented()), Boolean.valueOf(visible));
// Fix for 6323293.
// This actually is needed to preserve compatibility with previous releases -
......@@ -609,8 +608,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
dims.setSize(width, height);
break;
}
if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "For the operation {0} new dimensions are {1}",
new Object[] {operationToString(operation), dims});
if (insLog.isLoggable(PlatformLogger.FINE))
insLog.fine("For the operation {0} new dimensions are {1}",
operationToString(operation), dims);
reshape(dims, operation, userReshape);
}
......@@ -640,7 +640,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
public void handleConfigureNotifyEvent(XEvent xev) {
assert (SunToolkit.isAWTLockHeldByCurrentThread());
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
if (isReparented()) {
......@@ -677,9 +677,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
* it!!!! or we wind up in a bogus location.
*/
int runningWM = XWM.getWMID();
if (insLog.isLoggable(Level.FINE)) {
insLog.log(Level.FINE, "reparented={0}, visible={1}, WM={2}, decorations={3}",
new Object[] {isReparented(), isVisible(), runningWM, getDecorations()});
if (insLog.isLoggable(PlatformLogger.FINE)) {
insLog.fine("reparented={0}, visible={1}, WM={2}, decorations={3}",
isReparented(), isVisible(), runningWM, getDecorations());
}
if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
&& !XWM.isNonReparentingWM()
......@@ -691,7 +691,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
long parent = XlibUtil.getParentWindow(window);
Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
if (insLog.isLoggable(Level.FINER)) {
if (insLog.isLoggable(PlatformLogger.FINER)) {
if (correctWM != null) {
insLog.finer("Configure notify - insets : " + correctWM);
} else {
......@@ -732,7 +732,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
case XWM.SAWFISH_WM:
{
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) {
newLocation = xlocation;
}
......@@ -749,8 +749,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
copy(currentInsets),
true);
insLog.log(Level.FINER, "Insets are {0}, new dimensions {1}",
new Object[] {currentInsets, newDimensions});
insLog.finer("Insets are {0}, new dimensions {1}",
currentInsets, newDimensions);
checkIfOnNewScreen(newDimensions.getBounds());
......@@ -789,8 +789,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
public void setShellBounds(Rectangle rec) {
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell bounds on " +
this + " to " + rec);
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell bounds on " +
this + " to " + rec);
XToolkit.awtLock();
try {
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
......@@ -802,8 +802,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
}
public void setShellSize(Rectangle rec) {
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell size on " +
this + " to " + rec);
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell size on " +
this + " to " + rec);
XToolkit.awtLock();
try {
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
......@@ -814,8 +814,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
}
public void setShellPosition(Rectangle rec) {
if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell position on " +
this + " to " + rec);
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell position on " +
this + " to " + rec);
XToolkit.awtLock();
try {
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
......@@ -915,9 +915,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
return toGlobal(0,0);
} else {
Point location = target.getLocation();
if (insLog.isLoggable(Level.FINE))
insLog.log(Level.FINE, "getLocationOnScreen {0} not reparented: {1} ",
new Object[] {this, location});
if (insLog.isLoggable(PlatformLogger.FINE))
insLog.fine("getLocationOnScreen {0} not reparented: {1} ",
this, location);
return location;
}
} finally {
......@@ -954,7 +954,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
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()) {
XWM.setShellDecor(this);
super.setVisible(vis);
......@@ -1005,7 +1005,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
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);
}
......@@ -1018,9 +1018,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
// by "proxy" - invisible mapped window. When we want to set X input focus to
// toplevel set it on proxy instead.
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 {
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) {
focusProxy.xRequestFocus(time);
} else {
......@@ -1111,9 +1111,9 @@ abstract class XDecoratedPeer extends XWindowPeer {
Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
focusLog.log(Level.FINER, "Current window is: active={0}, focused={1}",
new Object[]{ Boolean.valueOf(target == activeWindow),
Boolean.valueOf(target == focusedWindow)});
focusLog.finer("Current window is: active={0}, focused={1}",
Boolean.valueOf(target == activeWindow),
Boolean.valueOf(target == focusedWindow));
XWindowPeer toFocus = this;
while (toFocus.nextTransientFor != null) {
......
......@@ -32,7 +32,7 @@ import java.awt.dnd.InvalidDnDOperationException;
import java.util.Map;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.misc.Unsafe;
......@@ -42,8 +42,8 @@ import sun.misc.Unsafe;
* @since 1.5
*/
class XDnDDragSourceProtocol extends XDragSourceProtocol {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
private static final Unsafe unsafe = XlibWrapper.unsafe;
......@@ -395,7 +395,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
return false;
}
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" sourceWindow=" + sourceWindow +
" get_window=" + xclient.get_window() +
" xclient=" + xclient);
......
......@@ -33,7 +33,7 @@ import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.misc.Unsafe;
......@@ -43,8 +43,8 @@ import sun.misc.Unsafe;
* @since 1.5
*/
class XDnDDropTargetProtocol extends XDropTargetProtocol {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDropTargetProtocol");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDropTargetProtocol");
private static final Unsafe unsafe = XlibWrapper.unsafe;
......@@ -999,7 +999,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
if (sourceFormats != null && sourceFormats.length > 3) {
data1 |= XDnDConstants.XDND_DATA_TYPES_BIT;
}
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" "
+ " entryVersion=" + version
+ " sourceProtocolVersion=" +
......@@ -1058,7 +1058,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
public boolean forwardEventToEmbedded(long embedded, long ctxt,
int eventID) {
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" ctxt=" + ctxt +
" type=" + (ctxt != 0 ?
getMessageType(new
......@@ -1086,7 +1086,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
long data3 = Native.getLong(ctxt + size + 2 * Native.getLongSize());
long data4 = Native.getLong(ctxt + size + 3 * Native.getLongSize());
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" 1 "
+ " embedded=" + embedded
+ " source=" + xclient.get_data(0)
......@@ -1120,7 +1120,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
if (XToolkit.saved_error != null &&
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");
}
}
......@@ -1128,7 +1128,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
XToolkit.awtUnlock();
}
} else {
if (logger.isLoggable(Level.WARNING)) {
if (logger.isLoggable(PlatformLogger.WARNING)) {
logger.warning("Cannot read XdndTypeList from the source window");
}
}
......@@ -1143,7 +1143,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
overXEmbedClient = true;
}
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" 2 "
+ " embedded=" + embedded
+ " xclient=" + xclient);
......
......@@ -37,7 +37,8 @@ import java.awt.dnd.InvalidDnDOperationException;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.ComponentAccessor;
import sun.awt.dnd.SunDragSourceContextPeer;
......@@ -52,8 +53,8 @@ import sun.awt.SunToolkit;
*/
public final class XDragSourceContextPeer
extends SunDragSourceContextPeer implements XDragSourceProtocolListener {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
/* The events selected on the root window when the drag begins. */
private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
......@@ -542,7 +543,7 @@ public final class XDragSourceContextPeer
return false;
}
if (logger.isLoggable(Level.FINEST)) {
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" proxyModeSourceWindow=" +
getProxyModeSourceWindow() +
" ev=" + ev);
......
......@@ -31,7 +31,8 @@ import java.awt.peer.ComponentPeer;
import java.io.IOException;
import java.util.Iterator;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
......@@ -48,8 +49,8 @@ import sun.misc.Unsafe;
* @since 1.5
*/
final class XDropTargetContextPeer extends SunDropTargetContextPeer {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetContextPeer");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetContextPeer");
private static final Unsafe unsafe = XlibWrapper.unsafe;
......@@ -198,7 +199,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
structure. */
long ctxt = getNativeDragContext();
if (logger.isLoggable(Level.FINER)) {
if (logger.isLoggable(PlatformLogger.FINER)) {
logger.finer(" processing " + event + " ctxt=" + ctxt +
" consumed=" + event.isConsumed());
}
......
......@@ -29,7 +29,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* An abstract class for drop protocols on X11 systems.
......@@ -38,8 +38,8 @@ import java.util.logging.*;
* @since 1.5
*/
abstract class XDropTargetProtocol {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetProtocol");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetProtocol");
private final XDropTargetProtocolListener listener;
......@@ -116,16 +116,16 @@ abstract class XDropTargetProtocol {
XClientMessageEvent xclient) {
EmbedderRegistryEntry entry = getEmbedderRegistryEntry(toplevel);
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, " entry={0}", new Object[] {entry});
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" entry={0}", entry);
}
// Window not registered as an embedder for this protocol.
if (entry == null) {
return false;
}
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, " entry.isOverriden()={0}", new Object[] {entry.isOverriden()});
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" entry.isOverriden()={0}", entry.isOverriden());
}
// Window didn't have an associated drop site, so there is no need
// to forward the message.
......@@ -137,8 +137,8 @@ abstract class XDropTargetProtocol {
long proxy = entry.getProxy();
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, " proxy={0} toplevel={1}", new Object[] {proxy, toplevel});
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest(" proxy={0} toplevel={1}", proxy, toplevel);
}
if (proxy == 0) {
proxy = toplevel;
......
......@@ -31,7 +31,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.awt.Point;
......@@ -42,8 +42,8 @@ import java.awt.Point;
* @since 1.5
*/
final class XDropTargetRegistry {
private static final Logger logger =
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetRegistry");
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDropTargetRegistry");
private static final long DELAYED_REGISTRATION_PERIOD = 200;
......@@ -614,7 +614,7 @@ final class XDropTargetRegistry {
if (info != null &&
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));
}
registerEmbeddedDropSite(canvasWindow, clientWindow);
......@@ -628,14 +628,14 @@ final class XDropTargetRegistry {
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));
}
}
}
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));
}
Iterator dropTargetProtocols =
......@@ -649,7 +649,7 @@ final class XDropTargetRegistry {
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));
}
}
......
......@@ -37,7 +37,7 @@ import java.awt.peer.*;
import sun.awt.*;
import sun.awt.motif.X11FontMetrics;
import java.lang.reflect.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.util.*;
import static sun.awt.X11.XEmbedHelper.*;
......@@ -45,7 +45,7 @@ import java.security.AccessController;
import sun.security.action.GetBooleanAction;
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)
XEmbedServer xembed = new XEmbedServer(); // Helper object, contains XEmbed intrinsics
......@@ -129,7 +129,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
}
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();
try {
XToolkit.addEventDispatcher(xembed.handle, xembed);
......@@ -196,10 +196,10 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
switch (ev.get_type()) {
case XConstants.CreateNotify:
XCreateWindowEvent cr = ev.get_xcreatewindow();
if (xembedLog.isLoggable(Level.FINEST)) {
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
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()) +
", window " + Long.toHexString(cr.get_window()));
}
......@@ -207,20 +207,20 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
break;
case XConstants.DestroyNotify:
XDestroyWindowEvent dn = ev.get_xdestroywindow();
if (xembedLog.isLoggable(Level.FINEST)) {
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
xembedLog.finest("Message on embedder: " + dn);
}
if (xembedLog.isLoggable(Level.FINER)) {
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
xembedLog.finer("Destroy notify for parent: " + dn);
}
childDestroyed();
break;
case XConstants.ReparentNotify:
XReparentEvent rep = ev.get_xreparent();
if (xembedLog.isLoggable(Level.FINEST)) {
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
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()) +
", window " + Long.toHexString(rep.get_window()) +
", event " + Long.toHexString(rep.get_event()));
......@@ -323,7 +323,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
}
void childResized() {
if (xembedLog.isLoggable(Level.FINER)) {
if (xembedLog.isLoggable(PlatformLogger.FINER)) {
Rectangle bounds = getClientBounds();
xembedLog.finer("Child resized: " + bounds);
// 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() {
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:
* "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 {
XKeyEvent ke = new XKeyEvent(data);
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();
try {
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() {
public void run() {
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) {
grabbed_keys.add(grab);
}
......@@ -520,7 +520,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
postEvent(new InvocationEvent(target, new Runnable() {
public void run() {
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) {
grabbed_keys.remove(grab);
}
......@@ -533,7 +533,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
public void run() {
AWTKeyStroke stroke = xembed.getKeyStrokeForKeySym(keysym, modifiers);
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) {
accelerators.put(accel_id, stroke);
accel_lookup.put(stroke, accel_id);
......@@ -551,7 +551,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
synchronized(ACCEL_LOCK) {
stroke = accelerators.get(accel_id);
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);
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;
if (xembedLog.isLoggable(Level.FINER)) xembedLog.finer("Post-processing event " + e);
if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Post-processing event " + e);
// Process ACCELERATORS
AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
......@@ -610,7 +610,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
}
}
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?
result = true;
}
......@@ -622,7 +622,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
exists = grabbed_keys.contains(key);
}
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);
result = true;
}
......@@ -641,9 +641,9 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
public void handleClientMessage(XEvent xev) {
super.handleClientMessage(xev);
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 (xembedLog.isLoggable(Level.FINE)) xembedLog.fine(xembed.XEmbedMessageToString(msg));
if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine(xembed.XEmbedMessageToString(msg));
}
if (isXEmbedActive()) {
switch ((int)msg.get_data(1)) {
......@@ -709,7 +709,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
}
public boolean processXEmbedDnDEvent(long ctxt, int eventID) {
if (xembedLog.isLoggable(Level.FINEST)) {
if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
xembedLog.finest(" Drop target=" + target.getDropTarget());
}
if (target.getDropTarget() instanceof XEmbedDropTarget) {
......@@ -744,7 +744,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
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);
if (new_mapped) {
XToolkit.awtLock();
......@@ -773,7 +773,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
public void handlePropertyNotify(XEvent xev) {
if (isXEmbedActive()) {
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) {
childResized();
} else if (ev.get_atom() == XEmbedInfo.getAtom()) {
......@@ -794,7 +794,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
void handleConfigureNotify(XEvent xev) {
if (isXEmbedActive()) {
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) {
childResized();
}
......@@ -845,7 +845,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
// We recognize only these masks
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 {
XlibWrapper.unsafe.freeMemory(data);
}
......
......@@ -26,10 +26,10 @@
package sun.awt.X11;
import java.awt.AWTKeyStroke;
import java.util.logging.*;
import sun.awt.SunToolkit;
import java.awt.Component;
import java.awt.Container;
import sun.util.logging.PlatformLogger;
import sun.awt.X11GraphicsConfig;
import sun.awt.X11GraphicsDevice;
......@@ -40,7 +40,7 @@ import sun.awt.X11GraphicsDevice;
* call install and forward all XClientMessageEvents to it.
*/
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 long server; // XEmbed server
......@@ -53,7 +53,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
}
void setClient(XEmbeddedFramePeer client) {
if (xembedLog.isLoggable(Level.FINE)) {
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
xembedLog.fine("XEmbed client: " + client);
}
if (embedded != null) {
......@@ -67,7 +67,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
}
void install() {
if (xembedLog.isLoggable(Level.FINE)) {
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
xembedLog.fine("Installing xembedder on " + embedded);
}
long[] info = new long[] { XEMBED_VERSION, XEMBED_MAPPED };
......@@ -95,9 +95,9 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
void handleClientMessage(XEvent xev) {
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 (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)) {
case XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
active = true;
......
......@@ -27,7 +27,8 @@ package sun.awt.X11;
import sun.misc.Unsafe;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.awt.AWTKeyStroke;
import java.awt.event.InputEvent;
......@@ -36,7 +37,7 @@ import java.awt.event.InputEvent;
* Contains constant definitions and helper routines.
*/
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 int XEMBED_VERSION = 0,
......@@ -81,11 +82,11 @@ public class XEmbedHelper {
XEmbedHelper() {
if (XEmbed == null) {
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) {
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);
XToolkit.awtLock();
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);
}
finally {
......
......@@ -28,7 +28,7 @@ package sun.awt.X11;
//import static sun.awt.X11.XEmbed.*;
import java.awt.*;
import java.awt.event.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import static sun.awt.X11.XConstants.*;
import java.util.LinkedList;
......@@ -37,7 +37,7 @@ import java.util.LinkedList;
* specification and references.
*/
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();
static final int SYSTEM_EVENT_MASK = 0x8000;
int my_version, server_version;
......@@ -544,7 +544,7 @@ public class XEmbedServerTester implements XEventDispatcher {
try {
EVENT_LOCK.wait(3000);
} catch (InterruptedException ie) {
xembedLog.log(Level.WARNING, "Event wait interrupted", ie);
xembedLog.warning("Event wait interrupted", ie);
}
eventWaited = -1;
if (checkEventList(position, event) == -1) {
......@@ -634,7 +634,7 @@ public class XEmbedServerTester implements XEventDispatcher {
if (ev.get_type() == ClientMessage) {
XClientMessageEvent msg = ev.get_xclient();
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)) {
case XEmbedHelper.XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
xembedActive = true;
......
......@@ -30,15 +30,14 @@ import java.awt.*;
import java.util.LinkedList;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.EmbeddedFrame;
import sun.awt.SunToolkit;
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;
......@@ -138,7 +137,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
{
assert (SunToolkit.isAWTLockHeldByCurrentThread());
XConfigureEvent xe = xev.get_xconfigure();
if (xembedLog.isLoggable(Level.FINE)) {
if (xembedLog.isLoggable(PlatformLogger.FINE)) {
xembedLog.fine(xe.toString());
}
......
......@@ -34,12 +34,12 @@ import java.util.Locale;
import java.util.Arrays;
import com.sun.java.swing.plaf.motif.*;
import javax.swing.plaf.ComponentUI;
import java.util.logging.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.util.logging.PlatformLogger;
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;
......
......@@ -26,7 +26,6 @@
package sun.awt.X11;
import java.awt.*;
import java.util.logging.*;
/**
* 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.
*/
public class XFocusProxyWindow extends XBaseWindow {
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XFocusProxyWindow");
XWindowPeer owner;
public XFocusProxyWindow(XWindowPeer owner) {
......
......@@ -34,14 +34,13 @@ import java.awt.Insets;
import java.awt.MenuBar;
import java.awt.Rectangle;
import java.awt.peer.FramePeer;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.AWTAccessor;
class XFramePeer extends XDecoratedPeer implements FramePeer {
private static Logger log = Logger.getLogger("sun.awt.X11.XFramePeer");
private static Logger stateLog = Logger.getLogger("sun.awt.X11.states");
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XFramePeer");
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XFramePeer");
private static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states");
private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XFramePeer");
XMenuBarPeer menubarPeer;
MenuBar menubar;
......@@ -76,10 +75,10 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
winAttr.isResizable = true; // target.isResizable();
winAttr.title = target.getTitle();
winAttr.initialResizability = target.isResizable();
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Frame''s initial attributes: decor {0}, resizable {1}, undecorated {2}, initial state {3}",
new Object[] {Integer.valueOf(winAttr.decorations), Boolean.valueOf(winAttr.initialResizability),
Boolean.valueOf(!winAttr.nativeDecor), Integer.valueOf(winAttr.initialState)});
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Frame''s initial attributes: decor {0}, resizable {1}, undecorated {2}, initial state {3}",
Integer.valueOf(winAttr.decorations), Boolean.valueOf(winAttr.initialResizability),
Boolean.valueOf(!winAttr.nativeDecor), Integer.valueOf(winAttr.initialState));
}
}
......@@ -208,7 +207,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
}
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;
maxBounds = new Rectangle(b);
XToolkit.awtLock();
......@@ -225,7 +224,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
} else {
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);
} finally {
XToolkit.awtUnlock();
......@@ -253,14 +252,14 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
int changed = state ^ newState;
int changeIconic = changed & Frame.ICONIFIED;
boolean iconic = (newState & Frame.ICONIFIED) != 0;
stateLog.log(Level.FINER, "Changing state, old state {0}, new state {1}(iconic {2})",
new Object[] {Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic)});
stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})",
Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(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();
try {
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 {
XToolkit.awtUnlock();
......@@ -270,7 +269,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
setExtendedState(newState);
}
if (changeIconic != 0 && !iconic) {
if (stateLog.isLoggable(Level.FINER)) stateLog.finer("DeIconifying " + this);
if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("DeIconifying " + this);
xSetVisible(true);
}
}
......@@ -283,7 +282,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
super.handlePropertyNotify(xev);
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
* 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();
hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
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);
}
finally {
......
......@@ -30,10 +30,10 @@ import sun.awt.X11GraphicsConfig;
import sun.awt.image.ToolkitImage;
import sun.awt.image.ImageRepresentation;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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;
Dimension size;
long iconPixmap = 0;
......@@ -61,7 +61,7 @@ public class XIconWindow extends XBaseWindow {
final long screen = adata.get_awt_visInfo().get_screen();
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 =
XlibWrapper.XGetIconSizes(display, XToolkit.getDefaultRootWindow(),
......@@ -71,11 +71,11 @@ public class XIconWindow extends XBaseWindow {
}
int count = Native.getInt(XlibWrapper.iarg1);
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];
for (int i = 0; i < count; i++, sizes_ptr += XIconSize.getSize()) {
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;
} finally {
......@@ -87,12 +87,12 @@ public class XIconWindow extends XBaseWindow {
if (XWM.getWMID() == XWM.ICE_WM) {
// ICE_WM has a bug - it only displays icons of the size
// 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);
}
XIconSize[] sizeList = getIconSizes();
log.log(Level.FINEST, "Icon sizes: {0}", new Object[] {sizeList});
log.finest("Icon sizes: {0}", sizeList);
if (sizeList == null) {
// No icon sizes so we simply fall back to 16x16
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);
}
if (!found) {
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("widthHint=" + widthHint + ", heightHint=" + heightHint
+ ", saveWidth=" + saveWidth + ", saveHeight=" + saveHeight
+ ", max_width=" + sizeList[0].get_max_width()
......@@ -159,7 +159,7 @@ public class XIconWindow extends XBaseWindow {
/* determine which way to scale */
int wdiff = widthHint - sizeList[0].get_max_width();
int hdiff = heightHint - sizeList[0].get_max_height();
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("wdiff=" + wdiff + ", hdiff=" + hdiff);
}
if (wdiff >= hdiff) { /* need to scale width more */
......@@ -191,7 +191,7 @@ public class XIconWindow extends XBaseWindow {
XToolkit.awtUnlock();
}
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("return " + saveWidth + "x" + saveHeight);
}
return new Dimension(saveWidth, saveHeight);
......@@ -418,7 +418,7 @@ public class XIconWindow extends XBaseWindow {
}
}
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);
}
}
......@@ -444,7 +444,7 @@ public class XIconWindow extends XBaseWindow {
}
Dimension iconSize = getIconSize(width, height);
if (iconSize != null) {
log.log(Level.FINEST, "Icon size: {0}", iconSize);
log.finest("Icon size: {0}", iconSize);
iconWidth = iconSize.width;
iconHeight = iconSize.height;
} else {
......
......@@ -33,7 +33,7 @@ import java.awt.im.spi.InputMethodContext;
import java.awt.peer.ComponentPeer;
import sun.awt.X11InputMethod;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* Input Method Adapter for XIM (without Motif)
......@@ -41,7 +41,7 @@ import java.util.logging.*;
* @author JavaSoft International
*/
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 {
super();
......@@ -102,13 +102,13 @@ public class XInputMethod extends X11InputMethod {
protected ComponentPeer getPeer(Component client) {
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);
while (client != null && peer == null) {
client = getParent(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)
return peer;
......
......@@ -36,15 +36,14 @@ import java.awt.peer.ComponentPeer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.CausedFocusEvent;
import sun.awt.SunToolkit;
import sun.awt.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 Component currentFocusOwner;
......@@ -82,7 +81,7 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
}
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;
synchronized(lock) {
......
......@@ -29,8 +29,7 @@ package sun.awt.X11;
import java.util.Hashtable;
import sun.misc.Unsafe;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
public class XKeysym {
......@@ -70,7 +69,7 @@ public class XKeysym {
static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
static long keysym_lowercase = 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 ) {
/* First check for Latin-1 characters (1:1 mapping) */
......
......@@ -34,13 +34,13 @@ import java.awt.peer.*;
import java.util.Vector;
import java.awt.geom.*;
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
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 SPACE = 1;
......@@ -578,10 +578,10 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
}
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 (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;
int i = y2index(mouseEvent.getY());
if (i >= 0) {
......@@ -618,14 +618,14 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
currentIndex = -1;
}
} 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;
vsb.handleMouseEvent(mouseEvent.getID(),
mouseEvent.getModifiers(),
mouseEvent.getX() - (width - SCROLLBAR_WIDTH),
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;
hsb.handleMouseEvent(mouseEvent.getID(),
mouseEvent.getModifiers(),
......@@ -808,7 +808,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
if (log.isLoggable(Level.FINE)) log.fine(e.toString());
if (log.isLoggable(PlatformLogger.FINE)) log.fine(e.toString());
switch(keyCode) {
case KeyEvent.VK_UP:
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) {
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();
if (obj == vsb) {
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
boolean repaintItems = !isItemHidden(addedIndex);
......@@ -1094,7 +1094,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
| ((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);
repaint(addedIndex, getLastVisibleItem(), options);
}
......@@ -1110,9 +1110,9 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
boolean vsbWasVisible = vsbVis;
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());
if (items.size() == 0) {
......@@ -1180,7 +1180,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
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
if (vsb.getValue() >= s) {
......@@ -1433,7 +1433,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
* y is the number of items to scroll
*/
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 h = getItemHeight();
int pixelsToScroll = y * h;
......@@ -1473,7 +1473,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
* x is the number of pixels to scroll
*/
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();
w -= ((2 * SPACE) + (2 * MARGIN));
int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
......@@ -1706,7 +1706,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
}
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(),
// because the latter may cause a deadlock with the tree lock
localBuffer =
......@@ -1743,7 +1743,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
private void paint(Graphics listG, int firstItem, int lastItem, int options,
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) {
int t = lastItem;
lastItem = firstItem;
......@@ -1832,7 +1832,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
}
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);
if (firstItem > lastItem) {
......@@ -1843,7 +1843,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
firstItem = Math.max(getFirstVisibleItem(), firstItem);
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());
for (int i = firstItem; i <= lastItem; i++) {
paintItem(g, i);
......@@ -1851,7 +1851,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
}
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
if (!isItemHidden(index)) {
Shape clip = g.getClip();
......@@ -1859,18 +1859,18 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
int h = getItemHeight();
int y = getItemY(index);
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));
// Always paint the background so that focus is unpainted in
// multiselect mode
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());
} else {
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);
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) {
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);
g.translate(x, y);
scr.paint(g, getSystemColors(), paintAll);
......@@ -1932,22 +1932,22 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
if (paintFocus && !hasFocus()) {
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);
Shape clip = g.getClip();
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();
if (prevFocusRect != null) {
// 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.drawRect(prevFocusRect.x, prevFocusRect.y, prevFocusRect.width, prevFocusRect.height);
prevFocusRect = null;
}
if (paintFocus) {
// 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.drawRect(rect.x, rect.y, rect.width, rect.height);
prevFocusRect = rect;
......
......@@ -32,8 +32,7 @@
package sun.awt.X11;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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 */
String selectionName;
......@@ -129,7 +128,7 @@ public class XMSelection {
long display = XToolkit.getDisplay();
synchronized(this) {
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);
XToolkit.addEventDispatcher(owner,
new XEventDispatcher() {
......@@ -149,19 +148,19 @@ public class XMSelection {
try {
try {
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);
synchronized(this) {
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);
selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
setAtom(atom,screen);
long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom());
if (owner != 0) {
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);
XToolkit.addEventDispatcher(owner,
new XEventDispatcher() {
......@@ -176,7 +175,7 @@ public class XMSelection {
e.printStackTrace();
}
finally {
if (log.isLoggable(Level.FINE)) log.fine("UnGrabbing XServer");
if (log.isLoggable(PlatformLogger.FINE)) log.fine("UnGrabbing XServer");
XlibWrapper.XUngrabServer(XToolkit.getDisplay());
}
} finally {
......@@ -188,7 +187,7 @@ public class XMSelection {
static boolean processClientMessage(XEvent xev, int screen) {
XClientMessageEvent xce = xev.get_xclient();
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 atom = xce.get_data(1);
long owner = xce.get_data(2);
......@@ -295,7 +294,7 @@ public class XMSelection {
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) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
......@@ -306,7 +305,7 @@ public class XMSelection {
}
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) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
......@@ -318,7 +317,7 @@ public class XMSelection {
}
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) {
XDestroyWindowEvent de = xev.get_xdestroywindow();
dispatchOwnerDeath( de, screen);
......
......@@ -30,7 +30,7 @@ import java.awt.event.*;
import java.lang.reflect.Field;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.SunToolkit;
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
......@@ -533,7 +533,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
*/
public void handleKeyPress(XEvent xev) {
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)) {
return;
}
......
......@@ -28,8 +28,6 @@ import java.awt.*;
import java.awt.peer.*;
import java.awt.event.*;
import java.util.logging.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
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
*/
......
......@@ -29,7 +29,7 @@ import java.awt.peer.*;
import java.lang.reflect.Field;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.SunToolkit;
public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
......@@ -39,7 +39,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
* 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
......@@ -122,7 +122,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
* for adding separators
*/
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) {
......@@ -130,7 +130,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
if (menuWindow != null) {
menuWindow.addItem(item);
} else {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Attempt to use XMenuWindowPeer without window");
}
}
......@@ -141,7 +141,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
if (menuWindow != null) {
menuWindow.delItem(index);
} else {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Attempt to use XMenuWindowPeer without window");
}
}
......
......@@ -32,7 +32,7 @@ import java.awt.image.BufferedImage;
import java.awt.geom.Point2D;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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
......@@ -399,7 +399,7 @@ public class XMenuWindow extends XBaseMenuWindow {
if (!isCreated()) {
return;
}
if (log.isLoggable(Level.FINER)) {
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("showing menu window + " + getWindow() + " at " + bounds);
}
XToolkit.awtLock();
......
......@@ -33,7 +33,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.SunToolkit;
......@@ -44,7 +44,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
* Data members
*
************************************************/
private static Logger log = Logger.getLogger("sun.awt.X11.XBaseMenuWindow");
private static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XBaseMenuWindow");
/*
* Primary members
......@@ -146,7 +146,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
* for adding separators
*/
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) {
XKeyEvent xkey = xev.get_xkey();
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine(xkey.toString());
}
if (isEventDisabled(xev)) {
......
......@@ -25,12 +25,12 @@
package sun.awt.X11;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.util.*;
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, Long> atomToAnchor = new HashMap<XAtom, Long>();
......@@ -54,7 +54,7 @@ class XProtocol {
} finally {
if (firstCheck) {
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;
import sun.misc.Unsafe;
import java.util.logging.*;
public class XQueryTree {
private static Unsafe unsafe = XlibWrapper.unsafe;
private static final Logger log = Logger.getLogger("sun.awt.X11.XQueryTree");
private boolean __executed = false;
long _w;
long root_ptr = unsafe.allocateMemory(Native.getLongSize());
......
......@@ -26,10 +26,10 @@
package sun.awt.X11;
// This class serves as the base class for all the wrappers.
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
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() {
String ret = "";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册