+2003-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/CheckboxMenuItem.java
+ (CheckBoxMenuItem): Dont implement Serializable.
+ (getListeners): New method,
+ (getItemListeners): New method.
+ * java/awt/Choice.java
+ (getListeners): New method,
+ (getItemListeners): New method.
+ * java/awt/Container.java
+ (getListeners): Added exception documentation.
+ (setFocusTraversalKeys): Throw exceptions, added documentattion.
+ (getFocusTraversalKeys): Added documentation.
+ (areFocusTraversalKeysSet): Added documentation.
+ (applyComponentOrientation): Added documentation.
+ * java/awt/ContainerOrderFocusTraversalPolicy.java
+ (implicitDownCycleTraversal): Renamed from downCycle for
+ serialization.
+ (ContainerOrderFocusTraversalPolicy): Added documentation.
+ (accept): Reformated.
+ * java/awt/Dialog.java
+ (Dialog): Dont implement Serializable.
+ (Dialog): Added documentation.
+ * java/awt/Font.java
+ (Font): Dont use absolute class name.
+ * java/awt/Frame.java
+ (Frame): Font implement Serializable.
+ * java/awt/List.java
+ (getListeners): New method,
+ (getActionListeners): New method.
+ (getItemListeners): New method.
+ * java/awt/Menu.java
+ (countItems): New deprecated method.
+ * java/awt/Scrollbar.java
+ (getListeners): New method,
+ (getAdjustmentListeners): New method,
+ * java/awt/TextComponent.java
+ (getListeners): New method,
+ (getTextListeners): New method,
+ * java/awt/TextField.java
+ (getListeners): New method,
+ (getActionListeners): New method.
+ * java/awt/Window.java
+ (windowFocusListener): New member variable.
+ (windowStateListener): New member variable.
+ (getWindowFocusListeners): New method.
+ (getWindowStateListeners): New method.
+ (addWindowFocusListener): New method.
+ (addWindowStateListener): New method.
+ (removeWindowFocusListener): New method.
+ (removeWindowStateListener): New method.
+ * java/awt/datatransfer/DataFlavor.java
+ (isRepresentationClassByteBuffer): New method.
+ (isRepresentationClassCharBuffer): New method.
+ (isRepresentationClassReader): New method.
+
2003-02-14 Mark Wielaard <mark@klomp.org>
* java/math/BigDecimal.java (BigDecimal(String)): Always set scale to
import java.awt.peer.MenuComponentPeer;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.util.EventListener;
/**
* This class implements a menu item that has a checkbox on it indicating
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@redhat.com>
*/
-public class CheckboxMenuItem extends MenuItem implements ItemSelectable,
- java.io.Serializable
+public class CheckboxMenuItem extends MenuItem implements ItemSelectable
{
/*
+ "," + super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>CheckboxMenuItem</code>. FooListeners are registered using
+ * the addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns an aray of all item listeners currently registered to this
+ * <code>CheckBoxMenuItem</code>.
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class CheckboxMenuItem
import java.awt.event.ItemListener;
import java.io.Serializable;
import java.util.Vector;
+import java.util.EventListener;
/**
* This class implements a drop down choice list.
return ("selectedIndex=" + selectedIndex + "," + super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this Choice. FooListeners are registered using the addFooListener
+ * method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ *
+ * @since 1.3
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all registered item listeners.
+ *
+ * @since 1.4
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class Choice
* upon this Container. FooListeners are registered using the addFooListener
* method.
*
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements @see java.util.EventListener.
+ *
* @since 1.3
*/
public EventListener[] getListeners(Class listenerType)
}
}
- public void setFocusTraversalKeys(int id, Set keys)
+ /**
+ * Sets the focus traversal keys for a given traversal operation for this
+ * Container.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS,
+ * or if keystrokes contains null, or if any Object in keystrokes is not an
+ * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, or if any
+ * keystroke already maps to another focus traversal operation for this
+ * Container.
+ *
+ * @since 1.4
+ */
+ public void setFocusTraversalKeys(int id, Set keystrokes)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
throw new IllegalArgumentException ();
+
+ if (keystrokes == null)
+ throw new IllegalArgumentException ();
+
+ throw new Error ("not implemented");
}
+ /**
+ * Returns the Set of focus traversal keys for a given traversal operation for
+ * this Container.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
+ *
+ * @since 1.4
+ */
public Set getFocusTraversalKeys(int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
return null;
}
+ /**
+ * Returns whether the Set of focus traversal keys for the given focus
+ * traversal operation has been explicitly defined for this Container.
+ * If this method returns false, this Container is inheriting the Set from
+ * an ancestor, or from the current KeyboardFocusManager.
+ *
+ * @exception IllegalArgumentException If id is not one of
+ * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS,
+ * or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS.
+ *
+ * @since 1.4
+ */
public boolean areFocusTraversalKeysSet(int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
public void transferFocusDownCycle()
{
}
-
- public void applyComponentOrientation(ComponentOrientation o)
+
+ /**
+ * Sets the ComponentOrientation property of this container and all components
+ * contained within it.
+ *
+ * @exception NullPointerException If orientation is null
+ *
+ * @since 1.4
+ */
+ public void applyComponentOrientation (ComponentOrientation orientation)
{
if (orientation == null)
throw new NullPointerException ();
{
static final long serialVersionUID = 486933713763926351L;
- private boolean downCycle = true;
+ private boolean implicitDownCycleTraversal = true;
+ /**
+ * Creates the <code>ContainerOrderFocusTraversalPolicy</code> object.
+ */
public ContainerOrderFocusTraversalPolicy()
{
throw new Error("not implemented");
public void setImplicitDownCycleTraversal(boolean value)
{
- downCycle = value;
+ boolean implicitDownCycleTraversal = value;
}
public boolean getImplicitDownCycleTraversal()
{
- return downCycle;
+ return implicitDownCycleTraversal;
}
protected boolean accept(Component current)
{
- return current.visible && current.isDisplayable() && current.enabled
- && current.focusable;
+ return (current.visible
+ && current.isDisplayable()
+ && current.enabled
+ && current.focusable);
}
} // class ContainerOrderFocusTraversalPolicy
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@redhat.com>
*/
-public class Dialog extends Window implements java.io.Serializable
+public class Dialog extends Window
{
/*
* parent, that is not resizable and not modal, and which has no title.
*
* @param parent The parent frame of this dialog box.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent)
* @param parent The parent frame of this dialog box.
* @param modal <true> if this dialog box is modal, <code>false</code>
* otherwise.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent, boolean modal)
*
* @param parent The parent frame of this dialog box.
* @param title The title string for this dialog box.
+ *
+ * @exception IllegalArgumentException If the owner's GraphicsConfiguration
+ * is not from a screen device, or if owner is null. This exception is always
+ * thrown when GraphicsEnvironment.isHeadless() returns true.
*/
public
Dialog(Frame parent, String title)
this (owner, "", false);
}
+/**
+ * Initializes a new instance of <code>Dialog</code> with the specified,
+ * parent and title, that is not resizable.
+ *
+ * @exception IllegalArgumentException If parent is null. This exception is
+ * always thrown when GraphicsEnvironment.isHeadless() returns true.
+ *
+ * @since 1.2
+ */
public
Dialog (Dialog owner, String title)
{
this (owner, title, false);
}
+/**
+ * Initializes a new instance of <code>Dialog</code> with the specified,
+ * parent, title and modality, that is not resizable.
+ *
+ * @exception IllegalArgumentException If parent is null. This exception is
+ * always thrown when GraphicsEnvironment.isHeadless() returns true.
+ *
+ * @since 1.2
+ */
public
Dialog (Dialog owner, String title, boolean modal)
{
package java.awt;
import java.awt.peer.FontPeer;
+import java.io.Serializable;
import java.util.StringTokenizer;
/**
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy <warrenl@cygnus.com>
*/
-public class Font implements java.io.Serializable
+public class Font implements Serializable
{
/*
import java.awt.peer.WindowPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Frame extends Window implements MenuContainer, Serializable
+public class Frame extends Window implements MenuContainer
{
/*
import java.awt.event.ItemListener;
import java.awt.peer.ListPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
import java.util.Vector;
import javax.accessibility.Accessible;
return "multiple=" + multipleMode + ",rows=" + rows + super.paramString();
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>List</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ActionListener.class)
+ return AWTEventMulticaster.getListeners (action_listeners, listenerType);
+
+ if (listenerType == ItemListener.class)
+ return AWTEventMulticaster.getListeners (item_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all action listeners registered to this object.
+ */
+ public ActionListener[] getActionListeners ()
+ {
+ return (ActionListener[]) getListeners (ActionListener.class);
+ }
+
+ /**
+ * Returns all action listeners registered to this object.
+ */
+ public ItemListener[] getItemListeners ()
+ {
+ return (ItemListener[]) getListeners (ItemListener.class);
+ }
} // class List
{
return(items.size());
}
+
+/**
+ * Returns the number of items in this menu.
+ *
+ * @return The number of items in this menu.
+ *
+ * @deprecated As of JDK 1.1, replaced by getItemCount().
+ */
+public int countItems ()
+{
+ return getItemCount ();
+}
/*************************************************************************/
import java.awt.peer.ComponentPeer;
import java.awt.event.AdjustmentListener;
import java.awt.event.AdjustmentEvent;
+import java.util.EventListener;
import javax.accessibility.Accessible;
/**
+ super.paramString());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>Scrollbar</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == AdjustmentListener.class)
+ return AWTEventMulticaster.getListeners (adjustment_listeners,
+ listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns an array of all registered adjustment listeners.
+ */
+ public AdjustmentListener[] getAdjustmentListeners ()
+ {
+ return (AdjustmentListener[]) getListeners (AdjustmentListener.class);
+ }
} // class Scrollbar
import java.awt.event.TextListener;
import java.awt.peer.TextComponentPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
/**
* This class provides common functionality for widgets than
return(getClass().getName() + "(text=" + getText() + ")");
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>TextComponent</code>. FooListeners are registered using
+ * the addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == TextListener.class)
+ return AWTEventMulticaster.getListeners (textListener, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Returns all text listeners registered to this object.
+ */
+ public TextListener[] getTextListeners ()
+ {
+ return (TextListener[]) getListeners (TextListener.class);
+ }
} // class TextComponent
import java.awt.peer.TextFieldPeer;
import java.awt.peer.TextComponentPeer;
import java.awt.peer.ComponentPeer;
+import java.util.EventListener;
/**
* This class implements a single line text entry field widget
getEchoChar());
}
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this <code>TextField</code>. FooListeners are registered using the
+ * addFooListener method.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements java.util.EventListener.
+ *
+ * @since 1.3
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ if (listenerType == ActionListener.class)
+ return AWTEventMulticaster.getListeners (action_listeners, listenerType);
+
+ return super.getListeners (listenerType);
+ }
+
+ /**
+ * Return all ActionListeners register to this <code>TextField</code> object
+ * as an array.
+ *
+ * @since 1.4
+ */
+ public ActionListener[] getActionListeners ()
+ {
+ return (ActionListener[]) getListeners (ActionListener.class);
+ }
} // class TextField
package java.awt;
import java.awt.event.WindowEvent;
+import java.awt.event.WindowFocusListener;
import java.awt.event.WindowListener;
+import java.awt.event.WindowStateListener;
import java.awt.peer.WindowPeer;
import java.awt.peer.ComponentPeer;
import java.util.EventListener;
private int windowSerializedDataVersion = 0; // FIXME
private transient WindowListener windowListener;
+ private transient WindowFocusListener windowFocusListener;
+ private transient WindowStateListener windowStateListener;
private transient GraphicsConfiguration graphicsConfiguration;
/**
WindowListener.class);
}
+ /**
+ * Returns an array of all the window focus listeners registered on this
+ * window.
+ *
+ * @since 1.4
+ */
+ public synchronized WindowFocusListener[] getWindowFocusListeners()
+ {
+ return (WindowFocusListener[])
+ AWTEventMulticaster.getListeners(windowFocusListener,
+ WindowFocusListener.class);
+ }
+
+ /**
+ * Returns an array of all the window state listeners registered on this
+ * window.
+ *
+ * @since 1.4
+ */
+ public synchronized WindowStateListener[] getWindowStateListeners()
+ {
+ return (WindowStateListener[])
+ AWTEventMulticaster.getListeners(windowStateListener,
+ WindowStateListener.class);
+ }
+
+ /**
+ * Adds the specified listener to this window.
+ */
+ public void addWindowFocusListener (WindowFocusListener wfl)
+ {
+ AWTEventMulticaster.add (windowFocusListener, wfl);
+ }
+
+ /**
+ * Adds the specified listener to this window.
+ *
+ * @since 1.4
+ */
+ public void addWindowStateListener (WindowStateListener wsl)
+ {
+ AWTEventMulticaster.add (windowStateListener, wsl);
+ }
+
+ /**
+ * Removes the specified listener from this window.
+ */
+ public void removeWindowFocusListener (WindowFocusListener wfl)
+ {
+ AWTEventMulticaster.remove (windowFocusListener, wfl);
+ }
+
+ /**
+ * Removes the specified listener from this window.
+ *
+ * @since 1.4
+ */
+ public void removeWindowStateListener (WindowStateListener wsl)
+ {
+ AWTEventMulticaster.remove (windowStateListener, wsl);
+ }
+
/**
* Returns an array of all the objects currently registered as FooListeners
* upon this Window. FooListeners are registered using the addFooListener
import java.io.Reader;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
/**
* This class represents a particular data format used for transferring
throw new UnsupportedFlavorException(this);
}
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.nio.ByteBuffer or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassByteBuffer ()
+ {
+ try
+ {
+ return ByteBuffer.class.isAssignableFrom (representationClass);
+ }
+ catch (ClassNotFoundException e)
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.nio.CharBuffer or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassCharBuffer ()
+ {
+ try
+ {
+ return CharBuffer.class.isAssignableFrom (representationClass);
+ }
+ catch (ClassNotFoundException e)
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Returns whether the representation class for this DataFlavor is
+ * @see java.io.Reader or a subclass thereof.
+ *
+ * @since 1.4
+ */
+ public boolean isRepresentationClassReader ()
+ {
+ try
+ {
+ return Reader.class.isAssignableFrom (representationClass);
+ }
+ catch (ClassNotFoundException e)
+ {
+ return false;
+ }
+ }
+
} // class DataFlavor