Commit 11e56db0 by Michael Koch Committed by Michael Koch

2005-02-21 Michael Koch <konqueror@gmx.de>

	* java/awt/Checkbox.java
	(next_checkbox_number): New static variable.
	(generateName): New method.
	(getUniqueLong): Likewise.
	* java/awt/Window.java
	(next_window_number): New static variable.
	(generateName): New method.
	(getUniqueLong): Likewise.

From-SVN: r95354
parent 74421469
2005-02-21 Michael Koch <konqueror@gmx.de>
* java/awt/Checkbox.java
(next_checkbox_number): New static variable.
(generateName): New method.
(getUniqueLong): Likewise.
* java/awt/Window.java
(next_window_number): New static variable.
(generateName): New method.
(getUniqueLong): Likewise.
2005-02-21 Mark Wielaard <mark@klomp.org> 2005-02-21 Mark Wielaard <mark@klomp.org>
* java/util/jar/JarFile.java (verifyHashes): Check whether ZipEntry * java/util/jar/JarFile.java (verifyHashes): Check whether ZipEntry
......
/* Checkbox.java -- An AWT checkbox widget /* Checkbox.java -- An AWT checkbox widget
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -95,6 +95,11 @@ private boolean state; ...@@ -95,6 +95,11 @@ private boolean state;
// The list of listeners for this object. // The list of listeners for this object.
private transient ItemListener item_listeners; private transient ItemListener item_listeners;
/*
* The number used to generate the name returned by getName.
*/
private static transient long next_checkbox_number;
/** /**
* This class provides accessibility support for the * This class provides accessibility support for the
* checkbox. * checkbox.
...@@ -106,7 +111,6 @@ protected class AccessibleAWTCheckbox ...@@ -106,7 +111,6 @@ protected class AccessibleAWTCheckbox
extends AccessibleAWTComponent extends AccessibleAWTComponent
implements ItemListener, AccessibleAction, AccessibleValue implements ItemListener, AccessibleAction, AccessibleValue
{ {
/** /**
* Serialization constant to match JDK 1.5 * Serialization constant to match JDK 1.5
*/ */
...@@ -627,4 +631,18 @@ public AccessibleContext getAccessibleContext() ...@@ -627,4 +631,18 @@ public AccessibleContext getAccessibleContext()
return accessibleContext; return accessibleContext;
} }
} // class Checkbox /**
* Generate a unique name for this checkbox.
*
* @return A unique name for this checkbox.
*/
String generateName()
{
return "checkbox" + getUniqueLong();
}
private static synchronized long getUniqueLong()
{
return next_checkbox_number++;
}
}
...@@ -92,6 +92,11 @@ public class Window extends Container implements Accessible ...@@ -92,6 +92,11 @@ public class Window extends Container implements Accessible
private transient Component windowFocusOwner; private transient Component windowFocusOwner;
/*
* The number used to generate the name returned by getName.
*/
private static transient long next_window_number;
protected class AccessibleAWTWindow extends AccessibleAWTContainer protected class AccessibleAWTWindow extends AccessibleAWTContainer
{ {
public AccessibleRole getAccessibleRole() public AccessibleRole getAccessibleRole()
...@@ -945,4 +950,19 @@ public class Window extends Container implements Accessible ...@@ -945,4 +950,19 @@ public class Window extends Container implements Accessible
getToolkit().getSystemEventQueue().postEvent(ce); getToolkit().getSystemEventQueue().postEvent(ce);
} }
} }
/**
* Generate a unique name for this window.
*
* @return A unique name for this window.
*/
String generateName()
{
return "win" + getUniqueLong();
}
private static synchronized long getUniqueLong()
{
return next_window_number++;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment