Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.62 diff -u -3 -p -u -r1.2386.2.62 ChangeLog --- ChangeLog 20 Jan 2005 15:14:59 -0000 1.2386.2.62 +++ ChangeLog 21 Jan 2005 02:10:46 -0000 @@ -1,3 +1,24 @@ +2005-01-20 Michael Koch
+ + * java/awt/print/PrinterJob.java + (pageDialog): Throws java.awt.HeadlessException. + (printDialog): Likewise. + +2005-01-20 Michael Koch + + * doc/hacking.texinfo: Fixed one typo and the paragraph about time + formats. + +2005-01-20 Michael Koch + + * javax/print/attribute/standard/Chromaticity.java + (serialVersionUID): Fixed value. + * javax/print/attribute/standard/Destination.java + (serialVersionUID): Fixed value. + * javax/print/attribute/standard/MediaPrintableArea.java, + javax/print/attribute/standard/MediaSize.java: + New files. + 2005-01-20 Andrew John Hughes * include/java_lang_VMSystem.h: @@ -16,7 +37,101 @@ (getenv()): removed (environ()): new native method (getenv(String)): made native like HEAD + +2005-01-20 Andrew John Hughes + + * java/util/Currency.java: + Added new countryMap which maps country codes + to international currency codes. The cache + has been altered to map currency codes to + Currency objects. + (getInstance(java.util.Locale)): adds to both + caches and attempts initial lookup from country map + (getInstance(java.lang.String)): attempts to + use code -> currency map first +2005-01-20 Andrew John Hughes + + * java/awt/Checkbox.java: + (AccessibleAWTCheckbox): Added class documentation + * java/awt/Scrollbar.java: + (AccessibleAWTScrollBar): typo corrected and docs added + (AccessibleAWTScrollBar.getAccessibleRole()): documented + (AccessibleAWTScrollBar.getAccessibleStateSet()): likewise + (AccessibleAWTScrollBar.getAccessibleValue()): likewise + (AccessibleAWTScrollBar.getCurrentAccessibleValue()): likewise + (AccessibleAWTScrollBar.setCurrentAccessibleValue(java.lang.Number)): likewise + (AccessibleAWTScrollBar.getMinimumAccessibleValue()): likewise + (AccessibleAWTScrollBar.getMaximumAccessibleValue()): likewise + (getAccessibleContext()): name of accessible class corrected + +2005-01-20 Mark Wielaard + + * java/util/Currency.java (Currency(Locale)): Add Locale to + IllegalArgumentException message. + +2005-01-20 Mark Wielaard + + * java/awt/BasicStroke.java (hashCode): Implement. + (equals): Document. + +2005-01-20 Michael Koch + + * javax/swing/JTable.java + (getValueAt): New method. + * javax/swing/table/JTableHeader.java + (columnAtPoint): New method. + +2005-01-20 Mark Wielaard + + * java/util/Currency.java (Currency(Locale)): Clarify + IllegalArgumentException message. + +2005-01-20 Mark Wielaard + + * javax/naming/directory/BasicAttributes.java (equals): Compare to any + Attributes and attribute order doesn't matter. + (BasicAttributesEnumeration.where): Initialize to zero. + (BasicAttributesEnumeration.nextElement): Update and compare where + appropriately (zero based). + +2005-01-20 Michael Koch + + * javax/swing/JTextField.java + (actions): New field. + (static): Initalize actions field. + (getActions): New method. + +2005-01-20 Mark Wielaard + + * native/jni/gtk-peer/gtkpeer.h (gdk_env): Fix prototype. + +2005-01-20 Graydon Hoare + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c + (env_union): Use union to avoid type-punning warning. + +2005-01-20 Andrew John Hughes + + * java/awt/Checkbox.java: + (AccessibleAWTCheckbox): name capitalization corrected + and serialization UID added. + (AccessibleAWTCheckbox.itemStateChanged(java.awt.event.ItemEvent)): + documented. + (AccessibleAWTCheckbox.getAccessibleAction()): likewise + (AccessibleAWTCheckbox.getAccessibleValue()): likewise + (AccessibleAWTCheckbox.getAccessibleActionCount()): likewise + (AccessibleAWTCheckbox.getAccessibleActionDescription(int)): likewise + (AccessibleAWTCheckbox.doAccessibleAction(int)): likewise + (AccessibleAWTCheckbox.getCurrentAccessibleValue()): likewise + (AccessibleAWTCheckbox.setCurrentAccessibleValue(java.lang.Number)): likewise + (AccessibleAWTCheckbox.getMinimumAccessibleValue()): likewise + (AccessibleAWTCheckbox.getMaximumAccessibleValue()): likewise + (AccessibleAWTCheckbox.getAccessibleRole()): likewise + (AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and + documented + (getAccessibleContext()): name of accessible class corrected + 2005-01-19 Michael Koch * javax/swing/DefaultListSelectionModel.java Index: doc/hacking.texinfo =================================================================== RCS file: /cvsroot/classpath/classpath/doc/hacking.texinfo,v retrieving revision 1.30.2.1 diff -u -3 -p -u -r1.30.2.1 hacking.texinfo --- doc/hacking.texinfo 16 Jan 2005 02:14:45 -0000 1.30.2.1 +++ doc/hacking.texinfo 21 Jan 2005 02:10:47 -0000 @@ -1553,7 +1553,7 @@ Date formatting and parsing is handled b @code{java.text.SimpleDateFormat} class in most locales. This class is configured by attaching an instance of the @code{java.text.DateFormatSymbols} class. That class simply reads properties from our locale specific -resource bundle. The following items are requiered (refer to the +resource bundle. The following items are required (refer to the documentation of the @code{java.text.DateFormatSymbols} class for details io what the actual values should be): @@ -1577,18 +1577,14 @@ locale. @code{DateFormat.LONG} @item fullDateFormat - The format string for dates used by @code{DateFormat.FULL} address@hidden defaultDateFormat - The format string for dates used by address@hidden address@hidden shortDateFormat - The format string for times used by address@hidden shortTimeFormat - The format string for times used by @code{DateFormat.SHORT} address@hidden mediumDateFormat - The format string for times used by address@hidden mediumTimeFormat - The format string for times used by @code{DateFormat.MEDIUM} address@hidden longDateFormat - The format string for times used by address@hidden longTimeFormat - The format string for times used by @code{DateFormat.LONG} address@hidden fullDateFormat - The format string for times used by address@hidden fullTimeFormat - The format string for times used by @code{DateFormat.FULL} address@hidden defaultDateFormat - The format string for times used by address@hidden @end itemize Note that it may not be possible to use this mechanism for all locales. Index: java/awt/BasicStroke.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/BasicStroke.java,v retrieving revision 1.4.2.1 diff -u -3 -p -u -r1.4.2.1 BasicStroke.java --- java/awt/BasicStroke.java 16 Jan 2005 02:14:46 -0000 1.4.2.1 +++ java/awt/BasicStroke.java 21 Jan 2005 02:10:47 -0000 @@ -1,5 +1,5 @@ /* BasicStroke.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,6 +48,7 @@ public class BasicStroke implements Stro public static final int JOIN_MITER = 0; public static final int JOIN_ROUND = 1; public static final int JOIN_BEVEL = 2; + public static final int CAP_BUTT = 0; public static final int CAP_ROUND = 1; public static final int CAP_SQUARE = 2; @@ -208,11 +209,33 @@ public class BasicStroke implements Stro return phase; } + /** + * Returns the hash code for this object. The hash is calculated by + * xoring the hash, cap, join, limit, dash array and phase values + * (converted toint
first with
+ * Float.floatToIntBits()
if the value is a
+ * float
).
+ */
public int hashCode()
{
- throw new Error("not implemented");
+ int hash = Float.floatToIntBits(width);
+ hash ^= cap;
+ hash ^= join;
+ hash ^= Float.floatToIntBits(limit);
+
+ for (int i = 0; i < dash.length; i++)
+ hash ^= Float.floatToIntBits(dash[i]);
+
+ hash ^= Float.floatToIntBits(phase);
+
+ return hash;
}
+ /**
+ * Returns true if the given Object is an instance of BasicStroke
+ * and the width, cap, join, limit, dash array and phase are all
+ * equal.
+ */
public boolean equals(Object o)
{
if (! (o instanceof BasicStroke))
Index: java/awt/Checkbox.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Checkbox.java,v
retrieving revision 1.10.2.2
diff -u -3 -p -u -r1.10.2.2 Checkbox.java
--- java/awt/Checkbox.java 16 Jan 2005 15:15:11 -0000 1.10.2.2
+++ java/awt/Checkbox.java 21 Jan 2005 02:10:48 -0000
@@ -48,6 +48,7 @@ import javax.accessibility.AccessibleAct
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleValue;
/**
@@ -55,7 +56,7 @@ import javax.accessibility.AccessibleVal
* or more Checkboxes can be grouped by a CheckboxGroup.
*
* @author Aaron M. Renn (address@hidden)
- * @author Tom Tromey
+ * @author Tom Tromey (address@hidden)
*/
public class Checkbox extends Component
implements ItemSelectable, Accessible, Serializable
@@ -94,13 +95,28 @@ private boolean state;
// The list of listeners for this object.
private transient ItemListener item_listeners;
-protected class AccessibleAWTCheckBox
+/**
+ * This class provides accessibility support for the
+ * checkbox.
+ *
+ * @author Jerry Quinn (address@hidden)
+ * @author Andrew John Hughes (address@hidden)
+ */
+protected class AccessibleAWTCheckbox
extends AccessibleAWTComponent
implements ItemListener, AccessibleAction, AccessibleValue
{
-
- /* (non-Javadoc)
+ /**
+ * Serialization constant to match JDK 1.5
+ */
+ private static final long serialVersionUID = 7881579233144754107L;
+
+ /**
+ * Captures changes to the state of the checkbox and
+ * fires appropriate accessible property change events.
+ *
+ * @param event the event fired.
* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
public void itemStateChanged(ItemEvent event)
@@ -110,58 +126,121 @@ protected class AccessibleAWTCheckBox
state ? AccessibleState.CHECKED : null);
}
+ /**
+ * Returns an implementation of the AccessibleAction
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible action as well as
+ * the context.
+ *
+ * @return the accessible action associated with this context.
+ * @see javax.accessibility.AccessibleAction
+ */
public AccessibleAction getAccessibleAction()
{
return this;
}
+ /**
+ * Returns an implementation of the AccessibleValue
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible value as well as
+ * the context.
+ *
+ * @return the accessible value associated with this context.
+ * @see javax.accessibility.AccessibleValue
+ */
public AccessibleValue getAccessibleValue()
{
return this;
}
- /* (non-Javadoc)
+ /*
+ * The following methods are implemented in the JDK (up to
+ * 1.5) as stubs. We do likewise here.
+ */
+
+ /**
+ * Returns the number of actions associated with this accessible
+ * object. This default implementation returns 0.
+ *
+ * @return the number of accessible actions available.
* @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
*/
public int getAccessibleActionCount()
{
- // 1.4.1 does this
+ // 1.4.1 and 1.5 do this
return 0;
}
- /* (non-Javadoc)
+ /**
+ * Returns a description of the action with the supplied id.
+ * This default implementation always returns null.
+ *
+ * @param i the id of the action whose description should be
+ * retrieved.
+ * @return a String
describing the action.
* @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
*/
public String getAccessibleActionDescription(int i)
{
+ // 1.5 does this
return null;
}
- /* (non-Javadoc)
+ /**
+ * Executes the action with the specified id. This
+ * default implementation simply returns false.
+ *
+ * @param i the id of the action to perform.
+ * @return true if the action was performed.
* @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
*/
public boolean doAccessibleAction(int i)
{
+ // 1.5 does this
return false;
}
- /* (non-Javadoc)
+ /**
+ * Returns the current value of this accessible object.
+ * If no value has been set, null is returned. This
+ * default implementation always returns null, regardless.
+ *
+ * @return the numeric value of this object, or null if
+ * no value has been set.
* @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
*/
public Number getCurrentAccessibleValue()
{
+ // 1.5 does this
return null;
}
- /* (non-Javadoc)
+ /**
+ * Sets the current value of this accessible object
+ * to that supplied. In this default implementation,
+ * the value is never set and the method always returns
+ * false.
+ *
+ * @param number the new accessible value.
+ * @return true if the value was set.
* @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
*/
public boolean setCurrentAccessibleValue(Number number)
{
+ // 1.5 does this
return false;
}
- /* (non-Javadoc)
+ /**
+ * Returns the minimum acceptable accessible value used
+ * by this object, or null if no minimum value exists.
+ * This default implementation always returns null.
+ *
+ * @return the minimum acceptable accessible value, or null
+ * if there is no minimum.
* @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
*/
public Number getMinimumAccessibleValue()
@@ -169,7 +248,13 @@ protected class AccessibleAWTCheckBox
return null;
}
- /* (non-Javadoc)
+ /**
+ * Returns the maximum acceptable accessible value used
+ * by this object, or null if no maximum value exists.
+ * This default implementation always returns null.
+ *
+ * @return the maximum acceptable accessible value, or null
+ * if there is no maximum.
* @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
*/
public Number getMaximumAccessibleValue()
@@ -177,11 +262,35 @@ protected class AccessibleAWTCheckBox
return null;
}
+ /**
+ * Returns the role of this accessible object.
+ *
+ * @return the instance of AccessibleRole
,
+ * which describes this object.
+ * @see javax.accessibility.AccessibleRole
+ */
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.CHECK_BOX;
}
+ /**
+ * Returns the state set of this accessible object.
+ *
+ * @return a set of AccessibleState
s
+ * which represent the current state of the
+ * accessible object.
+ * @see javax.accessibility.AccessibleState
+ * @see javax.accessibility.AccessibleStateSet
+ */
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet set = super.getAccessibleStateSet();
+ if (state)
+ set.add(AccessibleState.CHECKED);
+ return set;
+ }
+
}
/*************************************************************************/
@@ -491,7 +600,7 @@ paramString()
}
/**
- * Gets the AccessibleContext associated with this CheckBox
.
+ * Gets the AccessibleContext associated with this Checkbox
.
* The context is created, if necessary.
*
* @return the associated context
@@ -501,7 +610,7 @@ public AccessibleContext getAccessibleCo
/* Create the context if this is the first request */
if (accessibleContext == null)
{
- AccessibleAWTCheckBox ac = new AccessibleAWTCheckBox();
+ AccessibleAWTCheckbox ac = new AccessibleAWTCheckbox();
accessibleContext = ac;
addItemListener(ac);
}
Index: java/awt/Scrollbar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Scrollbar.java,v
retrieving revision 1.18.2.4
diff -u -3 -p -u -r1.18.2.4 Scrollbar.java
--- java/awt/Scrollbar.java 16 Jan 2005 15:15:11 -0000 1.18.2.4
+++ java/awt/Scrollbar.java 21 Jan 2005 02:10:48 -0000
@@ -55,7 +55,8 @@ import javax.accessibility.AccessibleVal
* This class implements a scrollbar widget.
*
* @author Aaron M. Renn (address@hidden)
- * @author Tom Tromey
+ * @author Tom Tromey (address@hidden)
+ * @author Andrew John Hughes (address@hidden)
*/
public class Scrollbar extends Component implements Accessible,
Adjustable
@@ -775,14 +776,43 @@ paramString()
return next_scrollbar_number++;
}
- protected class AccessibleAWTScrollbar extends AccessibleAWTComponent
+ /**
+ * This class provides accessibility support for the
+ * scrollbar.
+ *
+ * @author Jerry Quinn (address@hidden)
+ * @author Andrew John Hughes (address@hidden)
+ */
+ protected class AccessibleAWTScrollBar extends AccessibleAWTComponent
implements AccessibleValue
{
+
+ /**
+ * Serialization constant to match JDK 1.5
+ */
+ private static final long serialVersionUID = -344337268523697807L;
+
+ /**
+ * Returns the role of this accessible object.
+ *
+ * @return the instance of AccessibleRole
,
+ * which describes this object.
+ * @see javax.accessibility.AccessibleRole
+ */
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.SCROLL_BAR;
}
+ /**
+ * Returns the state set of this accessible object.
+ *
+ * @return a set of AccessibleState
s
+ * which represent the current state of the
+ * accessible object.
+ * @see javax.accessibility.AccessibleState
+ * @see javax.accessibility.AccessibleStateSet
+ */
public AccessibleStateSet getAccessibleStateSet()
{
AccessibleStateSet states = super.getAccessibleStateSet();
@@ -795,12 +825,28 @@ paramString()
return states;
}
+ /**
+ * Returns an implementation of the AccessibleValue
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible value as well as
+ * the context.
+ *
+ * @return the accessible value associated with this context.
+ * @see javax.accessibility.AccessibleValue
+ */
public AccessibleValue getAccessibleValue()
{
return this;
}
- /* (non-Javadoc)
+ /**
+ * Returns the current value of this accessible object.
+ * In this case, this is the same as the value for
+ * the scrollbar, wrapped in an Integer
+ * object.
+ *
+ * @return the numeric value of this scrollbar.
* @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
*/
public Number getCurrentAccessibleValue()
@@ -808,7 +854,14 @@ paramString()
return new Integer(getValue());
}
- /* (non-Javadoc)
+ /**
+ * Sets the current value of this accessible object
+ * to that supplied. In this case, the value of the
+ * scrollbar is set, and this method always returns
+ * true.
+ *
+ * @param number the new accessible value.
+ * @return true if the value was set.
* @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
*/
public boolean setCurrentAccessibleValue(Number number)
@@ -817,7 +870,13 @@ paramString()
return true;
}
- /* (non-Javadoc)
+ /**
+ * Returns the minimum acceptable accessible value used
+ * by this object. In this case, this is the same as
+ * the minimum value of the scrollbar, wrapped in an
+ * object.
+ *
+ * @return the minimum value of this scrollbar.
* @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
*/
public Number getMinimumAccessibleValue()
@@ -825,7 +884,13 @@ paramString()
return new Integer(getMinimum());
}
- /* (non-Javadoc)
+ /**
+ * Returns the maximum acceptable accessible value used
+ * by this object. In this case, this is the same as
+ * the maximum value of the scrollbar, wrapped in an
+ * object.
+ *
+ * @return the maximum value of this scrollbar.
* @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
*/
public Number getMaximumAccessibleValue()
@@ -844,7 +909,7 @@ paramString()
{
/* Create the context if this is the first request */
if (accessibleContext == null)
- accessibleContext = new AccessibleAWTScrollbar();
+ accessibleContext = new AccessibleAWTScrollBar();
return accessibleContext;
}
Index: java/awt/print/PrinterJob.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/print/PrinterJob.java,v
retrieving revision 1.6.2.2
diff -u -3 -p -u -r1.6.2.2 PrinterJob.java
--- java/awt/print/PrinterJob.java 16 Jan 2005 15:15:11 -0000 1.6.2.2
+++ java/awt/print/PrinterJob.java 21 Jan 2005 02:10:48 -0000
@@ -38,6 +38,8 @@ exception statement from your version. *
package java.awt.print;
+import java.awt.HeadlessException;
+
import javax.print.PrintService;
import javax.print.attribute.PrintRequestAttributeSet;
@@ -146,7 +148,8 @@ public abstract class PrinterJob
*
* @return The modified PageFormat
.
*/
- public abstract PageFormat pageDialog(PageFormat page_format);
+ public abstract PageFormat pageDialog(PageFormat page_format)
+ throws HeadlessException;
/**
* Prints the pages.
@@ -166,7 +169,8 @@ public abstract class PrinterJob
* @return false
if the user cancels the dialog box,
* true
otherwise.
*/
- public abstract boolean printDialog();
+ public abstract boolean printDialog()
+ throws HeadlessException;
/**
* Displays a dialog box to the user which allows the print job
@@ -175,7 +179,8 @@ public abstract class PrinterJob
* @return false
if the user cancels the dialog box,
* true
otherwise.
*/
- public abstract boolean printDialog(PrintRequestAttributeSet attributes);
+ public abstract boolean printDialog(PrintRequestAttributeSet attributes)
+ throws HeadlessException;
/**
* This sets the pages that are to be printed.
Index: java/util/Currency.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Currency.java,v
retrieving revision 1.4.2.3
diff -u -3 -p -u -r1.4.2.3 Currency.java
--- java/util/Currency.java 17 Jan 2005 02:20:55 -0000 1.4.2.3
+++ java/util/Currency.java 21 Jan 2005 02:10:48 -0000
@@ -106,11 +106,25 @@ public final class Currency
private transient String currencySymbol;
/**
+ * A cached map of country codes
+ * instances to international currency code
+ * String
s. Seperating this
+ * from the Currency
instances
+ * ensures we have a common lookup between
+ * the two getInstance()
methods.
+ *
+ * @see #getInstance(java.util.Locale)
+ * @serial ignored.
+ */
+ private static transient Map countryMap;
+
+ /**
* A cache of Currency
instances to
* ensure the singleton nature of this class. The key
- * is the locale of the currency.
+ * is the international currency code.
*
* @see #getInstance(java.util.Locale)
+ * @see #getInstance(java.lang.String)
* @see #readResolve()
* @serial ignored.
*/
@@ -121,6 +135,8 @@ public final class Currency
*/
static
{
+ /* Create a hash map for the locale mappings */
+ countryMap = new HashMap();
/* Create a hash map for the cache */
cache = new HashMap();
/* Create the properties object */
@@ -169,7 +185,8 @@ public final class Currency
if (countryCode.equals(""))
{
throw new
- IllegalArgumentException("The specified country code is invalid");
+ IllegalArgumentException("Invalid (empty) country code for locale:"
+ + loc);
}
/* Construct the key for the currency */
currencyKey = countryCode + ".currency";
@@ -249,31 +266,38 @@ public final class Currency
*/
Currency newCurrency;
- if (locale == null || locale.getCountry() == null)
+ String country = locale.getCountry();
+ if (locale == null || country == null)
{
throw new
NullPointerException("The locale or its country is null.");
}
/* Attempt to get the currency from the cache */
- newCurrency = (Currency) cache.get(locale);
- if (newCurrency == null)
+ String code = (String) countryMap.get(country);
+ if (code == null)
{
/* Create the currency for this locale */
- newCurrency = new Currency (locale);
+ newCurrency = new Currency(locale);
/*
* If the currency code is null, then creation failed
* and we return null.
*/
- if (newCurrency.getCurrencyCode() == null)
+ code = newCurrency.getCurrencyCode();
+ if (code == null)
{
return null;
}
else
{
/* Cache it */
- cache.put(locale, newCurrency);
+ countryMap.put(country, code);
+ cache.put(code, newCurrency);
}
}
+ else
+ {
+ newCurrency = (Currency) cache.get(code);
+ }
/* Return the instance */
return newCurrency;
}
@@ -299,31 +323,39 @@ public final class Currency
{
throw new NullPointerException("The supplied currency code is null.");
}
- /* Get all locales */
- allLocales = Locale.getAvailableLocales();
- /* Loop through each locale, looking for the code */
- for (int i = 0;i < allLocales.length; i++)
+ Currency newCurrency = (Currency) cache.get(currencyCode);
+ if (newCurrency == null)
{
- try
+ /* Get all locales */
+ allLocales = Locale.getAvailableLocales();
+ /* Loop through each locale, looking for the code */
+ for (int i = 0;i < allLocales.length; i++)
{
- Currency testCurrency = getInstance (allLocales[i]);
- if (testCurrency != null &&
- testCurrency.getCurrencyCode().equals(currencyCode))
+ try
{
- return testCurrency;
+ Currency testCurrency = getInstance (allLocales[i]);
+ if (testCurrency != null &&
+ testCurrency.getCurrencyCode().equals(currencyCode))
+ {
+ return testCurrency;
+ }
+ }
+ catch (IllegalArgumentException exception)
+ {
+ /* Ignore locales without valid countries */
}
}
- catch (IllegalArgumentException exception)
- {
- /* Ignore locales without valid countries */
- }
+ /*
+ * If we get this far, the code is not supported by any of
+ * our locales.
+ */
+ throw new IllegalArgumentException("The currency code, " + currencyCode +
+ ", is not supported.");
+ }
+ else
+ {
+ return newCurrency;
}
- /*
- * If we get this far, the code is not supported by any of
- * our locales.
- */
- throw new IllegalArgumentException("The currency code, " + currencyCode +
- ", is not supported.");
}
/**
Index: javax/naming/directory/BasicAttributes.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/naming/directory/BasicAttributes.java,v
retrieving revision 1.2.2.2
diff -u -3 -p -u -r1.2.2.2 BasicAttributes.java
--- javax/naming/directory/BasicAttributes.java 16 Jan 2005 02:14:49 -0000 1.2.2.2
+++ javax/naming/directory/BasicAttributes.java 21 Jan 2005 02:10:49 -0000
@@ -1,5 +1,5 @@
/* BasicAttributes.java --
- Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -83,19 +83,27 @@ public class BasicAttributes implements
return ba;
}
+ /**
+ * Returns true if and only if the given Object is an instance of
+ * Attributes, the given attributes both do or don't ignore case for
+ * IDs and the collection of attributes is the same.
+ */
public boolean equals (Object obj)
{
- if (! (obj instanceof BasicAttributes))
+ if (! (obj instanceof Attributes))
return false;
- BasicAttributes b = (BasicAttributes) obj;
- if (ignoreCase != b.ignoreCase
- || attributes.size () != b.attributes.size ())
+
+ Attributes bs = (Attributes) obj;
+ if (ignoreCase != bs.isCaseIgnored()
+ || attributes.size () != bs.size ())
return false;
- // Does order matter?
- for (int i = 0; i < attributes.size (); ++i)
+ NamingEnumeration bas = bs.getAll();
+ while (bas.hasMoreElements())
{
- if (! attributes.get (i).equals (b.attributes.get (i)))
+ Attribute a = (Attribute) bas.nextElement();
+ Attribute b = get(a.getID ());
+ if (! a.equals(b))
return false;
}
@@ -191,7 +199,7 @@ public class BasicAttributes implements
// Used when enumerating.
private class BasicAttributesEnumeration implements NamingEnumeration
{
- int where = -1;
+ int where = 0;
boolean id;
public BasicAttributesEnumeration (boolean id)
@@ -220,10 +228,10 @@ public class BasicAttributes implements
public Object nextElement () throws NoSuchElementException
{
- if (where + 1 >= attributes.size ())
+ if (where >= attributes.size ())
throw new NoSuchElementException ("no more elements");
- ++where;
Attribute at = (Attribute) attributes.get (where);
+ ++where;
return id ? (Object) at.getID () : (Object) at;
}
}
Index: javax/print/attribute/standard/Chromaticity.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/print/attribute/standard/Chromaticity.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Chromaticity.java
--- javax/print/attribute/standard/Chromaticity.java 18 Jan 2005 11:38:30 -0000 1.1.2.1
+++ javax/print/attribute/standard/Chromaticity.java 21 Jan 2005 02:10:49 -0000
@@ -49,7 +49,7 @@ import javax.print.attribute.PrintReques
public final class Chromaticity extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
{
- private static final long serialVersionUID = -6890309414893262822L;
+ private static final long serialVersionUID = 4660543931355214012L;
public static final Chromaticity MONOCHROME = new Chromaticity(0);
public static final Chromaticity COLOR = new Chromaticity(1);
Index: javax/print/attribute/standard/Destination.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/print/attribute/standard/Destination.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Destination.java
--- javax/print/attribute/standard/Destination.java 18 Jan 2005 11:38:30 -0000 1.1.2.1
+++ javax/print/attribute/standard/Destination.java 21 Jan 2005 02:10:49 -0000
@@ -1,5 +1,5 @@
/* Destination.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import javax.print.attribute.URISyntax;
public final class Destination extends URISyntax
implements PrintJobAttribute, PrintRequestAttribute
{
- private static final long serialVersionUID = 7923912792485606497L;
+ private static final long serialVersionUID = 6776739171700415321L;
/**
* Constructs a Destination
object.
Index: javax/swing/JTable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.9.2.4
diff -u -3 -p -u -r1.9.2.4 JTable.java
--- javax/swing/JTable.java 16 Jan 2005 15:15:13 -0000 1.9.2.4
+++ javax/swing/JTable.java 21 Jan 2005 02:10:49 -0000
@@ -1859,4 +1859,9 @@ public class JTable extends JComponent
setColumnSelectionInterval(0, getColumnCount() - 1);
setRowSelectionInterval(0, getRowCount() - 1);
}
+
+ public Object getValueAt(int row, int column)
+ {
+ return dataModel.getValueAt(row, convertColumnIndexToModel(column));
+ }
}
Index: javax/swing/JTextField.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v
retrieving revision 1.11.2.2
diff -u -3 -p -u -r1.11.2.2 JTextField.java
--- javax/swing/JTextField.java 16 Jan 2005 15:15:13 -0000 1.11.2.2
+++ javax/swing/JTextField.java 21 Jan 2005 02:10:49 -0000
@@ -47,9 +47,11 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.accessibility.AccessibleStateSet;
+import javax.swing.Action;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;
import javax.swing.text.PlainDocument;
+import javax.swing.text.TextAction;
public class JTextField extends JTextComponent
implements SwingConstants
@@ -80,12 +82,25 @@ public class JTextField extends JTextCom
private static final long serialVersionUID = 353853209832607592L;
+ private static final Action[] actions;
+
public static final String notifyAction = "notify-field-accept";
+ static
+ {
+ actions = new Action[1];
+ actions[0] = new TextAction(notifyAction)
+ {
+ public void actionPerformed(ActionEvent event)
+ {
+ JTextField textField = (JTextField) event.getSource();
+ textField.fireActionPerformed();
+ }
+ };
+ }
+
private int columns;
-
private int align;
-
private int scrollOffset;
/** @since 1.3 */
@@ -300,6 +315,11 @@ public class JTextField extends JTextCom
scrollOffset = offset;
}
+ public Action[] getActions()
+ {
+ return TextAction.augmentList(super.getActions(), actions);
+ }
+
public void postActionEvent()
{
ActionEvent event = new ActionEvent(this, 0, actionCommand);
Index: javax/swing/table/JTableHeader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/table/JTableHeader.java,v
retrieving revision 1.4.2.2
diff -u -3 -p -u -r1.4.2.2 JTableHeader.java
--- javax/swing/table/JTableHeader.java 15 Jan 2005 17:02:21 -0000 1.4.2.2
+++ javax/swing/table/JTableHeader.java 21 Jan 2005 02:10:49 -0000
@@ -1,5 +1,5 @@
/* JTableHeader.java --
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -616,4 +616,11 @@ public class JTableHeader extends JCompo
setUI((TableHeaderUI) UIManager.getUI(this));
}
+ public int columnAtPoint(Point point)
+ {
+ if (getBounds().contains(point))
+ return columnModel.getColumnIndexAtX(point.x);
+
+ return -1;
+ }
}
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c,v
retrieving revision 1.7.2.3
diff -u -3 -p -u -r1.7.2.3 gnu_java_awt_peer_gtk_GtkToolkit.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c 20 Jan 2005 00:37:23 -0000 1.7.2.3
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c 21 Jan 2005 02:10:50 -0000
@@ -72,12 +72,18 @@ jmethodID setCursorID;
JavaVM *java_vm;
+union env_union
+{
+ void *void_env;
+ JNIEnv *jni_env;
+};
+
JNIEnv *
gdk_env()
{
- JNIEnv *tmp;
- g_assert((*java_vm)->GetEnv(java_vm, (void **)&tmp, JNI_VERSION_1_2) == JNI_OK);
- return tmp;
+ union env_union tmp;
+ g_assert((*java_vm)->GetEnv(java_vm, &tmp.void_env, JNI_VERSION_1_2) == JNI_OK);
+ return tmp.jni_env;
}
Index: native/jni/gtk-peer/gtkpeer.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gtkpeer.h,v
retrieving revision 1.19.2.5
diff -u -3 -p -u -r1.19.2.5 gtkpeer.h
--- native/jni/gtk-peer/gtkpeer.h 20 Jan 2005 00:37:23 -0000 1.19.2.5
+++ native/jni/gtk-peer/gtkpeer.h 21 Jan 2005 02:10:50 -0000
@@ -465,7 +465,7 @@ extern jmethodID syncAttrsID;
extern jclass gdkColor;
extern jmethodID gdkColorID;
-JNIEnv *gdk_env();
+JNIEnv *gdk_env(void);
extern double dpi_conversion_factor;