aboutsummaryrefslogtreecommitdiff
path: root/libjava/java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-02-15 09:21:55 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-02-15 09:21:55 +0000
commit30df932c23db0f7d3b7353f6fee11c4ec27dd9c2 (patch)
tree7b1568d550111d47732726dd7a7f5bdc5e660ddf /libjava/java
parente898926c9d597ef2cfd08f278b20ed916a18a98b (diff)
downloadgcc-30df932c23db0f7d3b7353f6fee11c4ec27dd9c2.zip
gcc-30df932c23db0f7d3b7353f6fee11c4ec27dd9c2.tar.gz
gcc-30df932c23db0f7d3b7353f6fee11c4ec27dd9c2.tar.bz2
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. From-SVN: r62933
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java28
-rw-r--r--libjava/java/awt/Choice.java28
-rw-r--r--libjava/java/awt/Container.java64
-rw-r--r--libjava/java/awt/ContainerOrderFocusTraversalPolicy.java15
-rw-r--r--libjava/java/awt/Dialog.java32
-rw-r--r--libjava/java/awt/Font.java3
-rw-r--r--libjava/java/awt/Frame.java3
-rw-r--r--libjava/java/awt/List.java35
-rw-r--r--libjava/java/awt/Menu.java12
-rw-r--r--libjava/java/awt/Scrollbar.java25
-rw-r--r--libjava/java/awt/TextComponent.java24
-rw-r--r--libjava/java/awt/TextField.java29
-rw-r--r--libjava/java/awt/Window.java66
-rw-r--r--libjava/java/awt/datatransfer/DataFlavor.java56
14 files changed, 406 insertions, 14 deletions
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
index 8821839..4f41568 100644
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ b/libjava/java/awt/CheckboxMenuItem.java
@@ -43,6 +43,7 @@ import java.awt.peer.MenuItemPeer;
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
@@ -51,8 +52,7 @@ import java.awt.event.ItemListener;
* @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
{
/*
@@ -296,5 +296,29 @@ paramString()
+ "," + 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
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
index 4c7b505..cb8bb03 100644
--- a/libjava/java/awt/Choice.java
+++ b/libjava/java/awt/Choice.java
@@ -44,6 +44,7 @@ import java.awt.event.ItemEvent;
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.
@@ -474,4 +475,31 @@ paramString()
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
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index 9494d8c..91804d7 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -728,6 +728,9 @@ public class Container extends Component
* 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)
@@ -994,15 +997,48 @@ public class Container extends Component
}
}
- 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 &&
@@ -1014,6 +1050,20 @@ public class Container extends Component
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 &&
@@ -1060,8 +1110,16 @@ public class Container extends Component
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 ();
diff --git a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
index e3cf31c..71267a5 100644
--- a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
+++ b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
@@ -48,8 +48,11 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
{
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");
@@ -82,17 +85,19 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
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
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index 471826c..9aa2ea6 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -49,7 +49,7 @@ import java.awt.peer.ComponentPeer;
* @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
{
/*
@@ -92,6 +92,10 @@ private String title;
* 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)
@@ -108,6 +112,10 @@ 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)
@@ -124,6 +132,10 @@ 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)
@@ -160,12 +172,30 @@ Dialog (Dialog owner)
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)
{
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index 730a700..3723a45 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt;
import java.awt.peer.FontPeer;
+import java.io.Serializable;
import java.util.StringTokenizer;
/**
@@ -47,7 +48,7 @@ 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
{
/*
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
index a25af9c..8c08a2e 100644
--- a/libjava/java/awt/Frame.java
+++ b/libjava/java/awt/Frame.java
@@ -42,7 +42,6 @@ import java.awt.peer.FramePeer;
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;
@@ -52,7 +51,7 @@ 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
{
/*
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
index d182e56..9e59041 100644
--- a/libjava/java/awt/List.java
+++ b/libjava/java/awt/List.java
@@ -45,6 +45,7 @@ import java.awt.event.ItemEvent;
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;
@@ -1030,4 +1031,38 @@ paramString()
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
diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java
index 326101b..2ca9467 100644
--- a/libjava/java/awt/Menu.java
+++ b/libjava/java/awt/Menu.java
@@ -175,6 +175,18 @@ getItemCount()
{
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 ();
+}
/*************************************************************************/
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
index 76daee3..f78f402 100644
--- a/libjava/java/awt/Scrollbar.java
+++ b/libjava/java/awt/Scrollbar.java
@@ -42,6 +42,7 @@ import java.awt.peer.ScrollbarPeer;
import java.awt.peer.ComponentPeer;
import java.awt.event.AdjustmentListener;
import java.awt.event.AdjustmentEvent;
+import java.util.EventListener;
import javax.accessibility.Accessible;
/**
@@ -699,5 +700,29 @@ paramString()
+ 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
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
index 6dc904c..cbe7dc9 100644
--- a/libjava/java/awt/TextComponent.java
+++ b/libjava/java/awt/TextComponent.java
@@ -42,6 +42,7 @@ import java.awt.event.TextEvent;
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
@@ -442,5 +443,28 @@ paramString()
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
diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java
index 335edc6..c2c2be7 100644
--- a/libjava/java/awt/TextField.java
+++ b/libjava/java/awt/TextField.java
@@ -43,6 +43,7 @@ import java.awt.event.ActionListener;
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
@@ -489,4 +490,32 @@ paramString()
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
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index dbfe92c..805152e 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -39,7 +39,9 @@ exception statement from your version. */
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;
@@ -61,6 +63,8 @@ public class Window extends Container
private int windowSerializedDataVersion = 0; // FIXME
private transient WindowListener windowListener;
+ private transient WindowFocusListener windowFocusListener;
+ private transient WindowStateListener windowStateListener;
private transient GraphicsConfiguration graphicsConfiguration;
/**
@@ -381,6 +385,68 @@ public class Window extends Container
}
/**
+ * 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
* method.
diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java
index 86d1f53..f542bd8 100644
--- a/libjava/java/awt/datatransfer/DataFlavor.java
+++ b/libjava/java/awt/datatransfer/DataFlavor.java
@@ -47,6 +47,8 @@ import java.io.ObjectInput;
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
@@ -999,5 +1001,59 @@ public Reader getReaderForText(Transferable transferable)
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