Imported GNU Classpath 0.92

2006-08-14  Mark Wielaard  <mark@klomp.org>

       Imported GNU Classpath 0.92
       * HACKING: Add more importing hints. Update automake version
       requirement.

       * configure.ac (gconf-peer): New enable AC argument.
       Add --disable-gconf-peer and --enable-default-preferences-peer
       to classpath configure when gconf is disabled.
       * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and
       gnu/java/awt/dnd/peer/gtk to bc. Classify
       gnu/java/security/Configuration.java as generated source file.

       * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java,
       gnu/java/lang/management/VMClassLoadingMXBeanImpl.java,
       gnu/java/lang/management/VMRuntimeMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java,
       gnu/java/lang/management/VMThreadMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryMXBeanImpl.java,
       gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub
       classes.
       * java/lang/management/VMManagementFactory.java: Likewise.
       * java/net/VMURLConnection.java: Likewise.
       * gnu/java/nio/VMChannel.java: Likewise.

       * java/lang/Thread.java (getState): Add stub implementation.
       * java/lang/Class.java (isEnum): Likewise.
       * java/lang/Class.h (isEnum): Likewise.

       * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed.

       * javax/naming/spi/NamingManager.java: New override for StackWalker
       functionality.

       * configure, sources.am, Makefile.in, gcj/Makefile.in,
       include/Makefile.in, testsuite/Makefile.in: Regenerated.

From-SVN: r116139
This commit is contained in:
Mark Wielaard 2006-08-14 23:12:35 +00:00
parent abab460491
commit ac1ed908de
1294 changed files with 99479 additions and 35933 deletions

View file

@ -304,10 +304,7 @@ public abstract class KeyboardFocusManager
*/
public Component getFocusOwner ()
{
Component owner = (Component) getObject (currentFocusOwners);
if (owner == null)
owner = (Component) getObject (currentPermanentFocusOwners);
return owner;
return (Component) getObject (currentFocusOwners);
}
/**
@ -323,10 +320,7 @@ public abstract class KeyboardFocusManager
*/
protected Component getGlobalFocusOwner ()
{
// Check if there is a temporary focus owner.
Component focusOwner = (Component) getGlobalObject (currentFocusOwners);
return (focusOwner == null) ? getGlobalPermanentFocusOwner () : focusOwner;
return (Component) getGlobalObject(currentFocusOwners, true);
}
/**
@ -409,7 +403,7 @@ public abstract class KeyboardFocusManager
*/
protected Component getGlobalPermanentFocusOwner ()
{
return (Component) getGlobalObject (currentPermanentFocusOwners);
return (Component) getGlobalObject (currentPermanentFocusOwners, true);
}
/**
@ -455,7 +449,7 @@ public abstract class KeyboardFocusManager
*/
protected Window getGlobalFocusedWindow ()
{
return (Window) getGlobalObject (currentFocusedWindows);
return (Window) getGlobalObject (currentFocusedWindows, true);
}
/**
@ -497,7 +491,7 @@ public abstract class KeyboardFocusManager
*/
protected Window getGlobalActiveWindow()
{
return (Window) getGlobalObject (currentActiveWindows);
return (Window) getGlobalObject (currentActiveWindows, true);
}
/**
@ -663,7 +657,7 @@ public abstract class KeyboardFocusManager
*/
protected Container getGlobalCurrentFocusCycleRoot ()
{
return (Container) getGlobalObject (currentFocusCycleRoots);
return (Container) getGlobalObject (currentFocusCycleRoots, true);
}
/**
@ -1105,11 +1099,9 @@ public abstract class KeyboardFocusManager
*/
public final void redispatchEvent (Component target, AWTEvent e)
{
synchronized (e)
{
e.setSource (target);
target.dispatchEvent (e);
}
e.isFocusManagerEvent = true;
target.dispatchEvent (e);
e.isFocusManagerEvent = false;
}
/**
@ -1355,17 +1347,19 @@ public abstract class KeyboardFocusManager
* @see #getGlobalActiveWindow()
* @see #getGlobalCurrentFocusCycleRoot()
*/
private Object getGlobalObject (Map globalMap)
private Object getGlobalObject (Map globalMap, boolean checkThread)
{
ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
KeyboardFocusManager managerForCallingThread
= (KeyboardFocusManager) currentKeyboardFocusManagers.get (currentGroup);
if (this != managerForCallingThread)
throw new SecurityException ("Attempted to retrieve an object from a "
+ "keyboard focus manager that isn't "
+ "associated with the current thread group.");
if (checkThread)
{
ThreadGroup currentGroup = Thread.currentThread ().getThreadGroup ();
KeyboardFocusManager managerForCallingThread =
(KeyboardFocusManager) currentKeyboardFocusManagers.get(currentGroup);
if (this != managerForCallingThread)
throw new SecurityException ("Attempted to retrieve an object from a "
+ "keyboard focus manager that isn't "
+ "associated with the current thread group.");
}
synchronized (globalMap)
{
Collection globalObjects = globalMap.values ();
@ -1406,7 +1400,7 @@ public abstract class KeyboardFocusManager
synchronized (globalMap)
{
// Save old object.
Object oldObject = getGlobalObject (globalMap);
Object oldObject = getGlobalObject(globalMap, false);
// Nullify old object.
Collection threadGroups = globalMap.keySet ();
@ -1436,4 +1430,48 @@ public abstract class KeyboardFocusManager
}
}
}
/**
* Maps focus requests from heavyweight to lightweight components.
*/
private static HashMap focusRequests = new HashMap();
/**
* Retargets focus events that come from the peer (which only know about
* heavyweight components) to go to the correct lightweight component
* if appropriate.
*
* @param ev the event to check
*
* @return the retargetted event
*/
static AWTEvent retargetFocusEvent(AWTEvent ev)
{
if (ev instanceof FocusEvent)
{
FocusEvent fe = (FocusEvent) ev;
Component target = fe.getComponent();
if (focusRequests.containsKey(target))
{
Component lightweight = (Component) focusRequests.get(target);
ev = new FocusEvent(lightweight, fe.id, fe.isTemporary());
focusRequests.remove(target);
}
}
return ev;
}
/**
* Adds a lightweight focus request for a heavyweight component.
*
* @param heavyweight the heavyweight from which we will receive a focus
* event soon
* @param lightweight the lightweight that ultimately receives the request
*/
static void addLightweightFocusRequest(Component heavyweight,
Component lightweight)
{
focusRequests.put(heavyweight, lightweight);
}
}