diff options
Diffstat (limited to 'libjava/classpath/javax/swing/event')
14 files changed, 509 insertions, 844 deletions
diff --git a/libjava/classpath/javax/swing/event/CaretEvent.java b/libjava/classpath/javax/swing/event/CaretEvent.java index c4870a8008f..7de05a81b74 100644 --- a/libjava/classpath/javax/swing/event/CaretEvent.java +++ b/libjava/classpath/javax/swing/event/CaretEvent.java @@ -1,5 +1,5 @@ /* CaretEvent.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,43 +37,34 @@ exception statement from your version. */ package javax.swing.event; -// Imports import java.util.EventObject; /** * CaretEvent * @author Andrew Selkirk */ -public abstract class CaretEvent extends EventObject { +public abstract class CaretEvent extends EventObject +{ - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * CaretEvent constructor - * @param source Source object - */ - public CaretEvent(Object source) { - super(source); - } // CaretEvent() + /** + * CaretEvent constructor + * @param source Source object + */ + public CaretEvent(Object source) + { + super(source); + } - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * Get caret location - * @returns the dot - */ - public abstract int getDot(); + /** + * Get caret location + * @return the dot + */ + public abstract int getDot(); - /** - * Get mark - * @returns the mark - */ - public abstract int getMark(); + /** + * Get mark + * @return the mark + */ + public abstract int getMark(); - -} // CaretEvent +} diff --git a/libjava/classpath/javax/swing/event/DocumentEvent.java b/libjava/classpath/javax/swing/event/DocumentEvent.java index 6cd8e61fee4..82230492520 100644 --- a/libjava/classpath/javax/swing/event/DocumentEvent.java +++ b/libjava/classpath/javax/swing/event/DocumentEvent.java @@ -1,5 +1,5 @@ /* DocumentEvent.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -54,25 +54,25 @@ public interface DocumentEvent { /** * getIndex - * @returns int + * @return int */ int getIndex(); /** * getElement - * @returns Element + * @return Element */ Element getElement(); /** * getChildrenRemoved - * @returns Element[] + * @return Element[] */ Element[] getChildrenRemoved(); /** * getChildrenAdded - * @returns Element[] + * @return Element[] */ Element[] getChildrenAdded(); @@ -81,7 +81,7 @@ public interface DocumentEvent /** * EventType */ - class EventType + final class EventType { /** * INSERT @@ -114,7 +114,7 @@ public interface DocumentEvent /** * toString - * @returns String + * @return String */ public String toString() { @@ -124,32 +124,32 @@ public interface DocumentEvent /** * getType - * @returns EventType + * @return EventType */ EventType getType(); /** * getOffset - * @returns int + * @return int */ int getOffset(); /** * getLength - * @returns int + * @return int */ int getLength(); /** * getDocument - * @returns Document + * @return Document */ Document getDocument(); /** * getChange * @param element TODO - * @returns ElementChange + * @return ElementChange */ ElementChange getChange(Element element); diff --git a/libjava/classpath/javax/swing/event/EventListenerList.java b/libjava/classpath/javax/swing/event/EventListenerList.java index 147d68ef184..a7fbec44d36 100644 --- a/libjava/classpath/javax/swing/event/EventListenerList.java +++ b/libjava/classpath/javax/swing/event/EventListenerList.java @@ -188,7 +188,7 @@ public class EventListenerList /** * Get a list of listenerType/listener pairs - * @returns Listener list + * @return Listener list */ public Object[] getListenerList() { @@ -214,7 +214,7 @@ public class EventListenerList * @throws NullPointerException if <code>c</code> is * <code>null</code>. * - * @returns an array of <code>c</code> whose elements are the + * @return an array of <code>c</code> whose elements are the * currently subscribed listeners of the specified type. If there * are no such listeners, an empty array is returned. * diff --git a/libjava/classpath/javax/swing/event/ListSelectionEvent.java b/libjava/classpath/javax/swing/event/ListSelectionEvent.java index e5e4c33bad9..d79cbfa507f 100644 --- a/libjava/classpath/javax/swing/event/ListSelectionEvent.java +++ b/libjava/classpath/javax/swing/event/ListSelectionEvent.java @@ -1,5 +1,5 @@ /* ListSelectionEvent.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,90 +37,99 @@ exception statement from your version. */ package javax.swing.event; -// Imports import java.util.EventObject; +import javax.swing.ListSelectionModel; + /** - * ListSelectionEvent + * An event that indicates a change to a list selection, including the source + * of the change (a {@link ListSelectionModel}) and the range of items in the + * list that have potentially changed their selection status. + * * @author Andrew Selkirk * @author Ronald Veldema */ -public class ListSelectionEvent extends EventObject { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * firstIndex - */ - private int firstIndex = 0; - - /** - * lastIndex - */ - private int lastIndex = 0; - - /** - * isAdjusting - */ - private boolean isAdjusting = false; - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor ListSelectionEvent - * @param source Source - * @param firstIndex First index - * @param lastIndex Last index - * @param isAdjusting Is Adjusting? - */ - public ListSelectionEvent(Object source, int firstIndex, - int lastIndex, boolean isAdjusting) { - super(source); - this.firstIndex = firstIndex; - this.lastIndex = lastIndex; - this.isAdjusting = isAdjusting; - } // ListSelectionEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getFirstIndex - * @returns firstIndex - */ - public int getFirstIndex() { - return firstIndex; - } // getFirstIndex() - - /** - * getLastIndex - * @returns lastIndex - */ - public int getLastIndex() { - return lastIndex; - } // getLastIndex() - - /** - * getValueIsAdjusting - * @returns isAdjusting - */ - public boolean getValueIsAdjusting() { - return isAdjusting; - } // getValueIsAdjusting() - - /** - * String representation - * @returns String representation - */ - public String toString() { - return null; // TODO - } // toString() - - -} // ListSelectionEvent +public class ListSelectionEvent extends EventObject +{ + + /** + * The index of the first list item in the range of items that has + * potentially had its selection status modified. + */ + private int firstIndex = 0; + + /** + * The index of the last list item in the range of items that has + * potentially had its selection status modified. + */ + private int lastIndex = 0; + + /** A flag that indicates that this event is one in a series of events. */ + private boolean isAdjusting = false; + + /** + * Creates a new <code>ListSelectionEvent</code>. + * + * @param source the event source (<code>null</code> not permitted). + * @param firstIndex the first index. + * @param lastIndex the last index. + * @param isAdjusting a flag indicating that this event is one in a series + * of events updating a selection. + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public ListSelectionEvent(Object source, int firstIndex, + int lastIndex, boolean isAdjusting) + { + super(source); + this.firstIndex = firstIndex; + this.lastIndex = lastIndex; + this.isAdjusting = isAdjusting; + } + + /** + * Returns the first index. + * + * @return The first index. + */ + public int getFirstIndex() + { + return firstIndex; + } + + /** + * Returns the last index. + * + * @return The last index. + */ + public int getLastIndex() + { + return lastIndex; + } + + /** + * Returns the flag that indicates that this event is one in a series of + * events updating a selection. + * + * @return A boolean. + */ + public boolean getValueIsAdjusting() + { + return isAdjusting; + } + + /** + * Returns a string representation of the event, typically used for debugging + * purposes. + * + * @return A string representation of the event. + */ + public String toString() + { + return this.getClass().toString() + "[ source=" + source.toString() + + " firstIndex= " + firstIndex + " lastIndex= " + lastIndex + + " isAdjusting= " + isAdjusting + " ]"; + } + +} diff --git a/libjava/classpath/javax/swing/event/ListSelectionListener.java b/libjava/classpath/javax/swing/event/ListSelectionListener.java index 4ebf5830432..a21dc7365bc 100644 --- a/libjava/classpath/javax/swing/event/ListSelectionListener.java +++ b/libjava/classpath/javax/swing/event/ListSelectionListener.java @@ -1,5 +1,5 @@ /* ListSelectionListener.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,21 +37,25 @@ exception statement from your version. */ package javax.swing.event; -// Imports import java.util.EventListener; +import javax.swing.ListSelectionModel; + /** - * ListSelectionListener public interface + * A listener that receives {@link ListSelectionEvent} notifications, + * typically from a {@link ListSelectionModel} when it is modified. + * * @author Andrew Selkirk * @author Ronald Veldema */ -public interface ListSelectionListener extends EventListener { - - /** - * Value changed - * @param event List Selection Event - */ - void valueChanged(ListSelectionEvent event); +public interface ListSelectionListener extends EventListener +{ + /** + * Receives notification of a {@link ListSelectionEvent}. + * + * @param event the event. + */ + void valueChanged(ListSelectionEvent event); -} // ListSelectionListener +}
\ No newline at end of file diff --git a/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java b/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java index 99761670629..6be11bcca71 100644 --- a/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java +++ b/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java @@ -1,5 +1,5 @@ /* MenuDragMouseEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,68 +48,57 @@ import javax.swing.MenuSelectionManager; * MenuDragMouseEvent * @author Andrew Selkirk */ -public class MenuDragMouseEvent extends MouseEvent { +public class MenuDragMouseEvent extends MouseEvent +{ - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * path - */ - private MenuElement[] path = null; + /** + * path + */ + private MenuElement[] path = null; - /** - * manager - */ - private MenuSelectionManager manager = null; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor MenuDragMouseEvent - * @param source Source - * @param id MouseEvent type - * @param when Time - * @param modifiers Key modifiers - * @param x Horizontal position - * @param y Vertical position - * @param clickCount Click count - * @param popupTrigger Popup trigger? - * @param path Path - * @param manager MenuSelectionManager - */ - public MenuDragMouseEvent(Component source, int id, long when, int modifiers, - int x, int y, int clickCount, boolean popupTrigger, - MenuElement[] path, MenuSelectionManager manager) { - super(source, id, when, modifiers, x, y, clickCount, popupTrigger); - this.path = path; - this.manager = manager; - } // MenuDragMouseEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * Get path - * @returns path - */ - public MenuElement[] getPath() { - return path; - } // getPath() - - /** - * Get menu selection manager - * @returns manager - */ - public MenuSelectionManager getMenuSelectionManager() { - return manager; - } // getMenuSelectionManager() - - -} // MenuDragMouseEvent + /** + * manager + */ + private MenuSelectionManager manager = null; + + /** + * Constructor MenuDragMouseEvent + * @param source Source + * @param id MouseEvent type + * @param when Time + * @param modifiers Key modifiers + * @param x Horizontal position + * @param y Vertical position + * @param clickCount Click count + * @param popupTrigger Popup trigger? + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuDragMouseEvent(Component source, int id, long when, int modifiers, + int x, int y, int clickCount, boolean popupTrigger, + MenuElement[] path, MenuSelectionManager manager) + { + super(source, id, when, modifiers, x, y, clickCount, popupTrigger); + this.path = path; + this.manager = manager; + } + + /** + * Get path + * @return path + */ + public MenuElement[] getPath() + { + return path; + } + + /** + * Get menu selection manager + * @return manager + */ + public MenuSelectionManager getMenuSelectionManager() + { + return manager; + } + +} diff --git a/libjava/classpath/javax/swing/event/MenuKeyEvent.java b/libjava/classpath/javax/swing/event/MenuKeyEvent.java index 511cb2254cd..3335850bced 100644 --- a/libjava/classpath/javax/swing/event/MenuKeyEvent.java +++ b/libjava/classpath/javax/swing/event/MenuKeyEvent.java @@ -1,5 +1,5 @@ /* MenuKeyEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,66 +48,55 @@ import javax.swing.MenuSelectionManager; * MenuKeyEvent * @author Andrew Selkirk */ -public class MenuKeyEvent extends KeyEvent { +public class MenuKeyEvent extends KeyEvent +{ - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * path - */ - private MenuElement[] path = null; + /** + * path + */ + private MenuElement[] path = null; - /** - * manager - */ - private MenuSelectionManager manager = null; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor MenuKeyEvent - * @param source Source - * @param id KeyEvent ID - * @param when Time - * @param modifiers Modifier keys - * @param keyCode Key code - * @param keyChar Key char - * @param path Path - * @param manager MenuSelectionManager - */ - public MenuKeyEvent(Component source, int id, long when, int modifiers, - int keyCode, char keyChar, MenuElement[] path, - MenuSelectionManager manager) { - super(source, id, when, modifiers, keyCode, keyChar); - this.path = path; - this.manager = manager; - } // MenuKeyEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getPath - * @returns path - */ - public MenuElement[] getPath() { - return path; - } // getPath() - - /** - * getMenuSelectionManager - * @returns MenuSelectionManager - */ - public MenuSelectionManager getMenuSelectionManager() { - return manager; - } // getMenuSelectionManager() - - -} // MenuKeyEvent + /** + * manager + */ + private MenuSelectionManager manager = null; + + /** + * Constructor MenuKeyEvent + * @param source Source + * @param id KeyEvent ID + * @param when Time + * @param modifiers Modifier keys + * @param keyCode Key code + * @param keyChar Key char + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuKeyEvent(Component source, int id, long when, int modifiers, + int keyCode, char keyChar, MenuElement[] path, + MenuSelectionManager manager) + { + super(source, id, when, modifiers, keyCode, keyChar); + this.path = path; + this.manager = manager; + } + + /** + * getPath + * @return path + */ + public MenuElement[] getPath() + { + return path; + } + + /** + * getMenuSelectionManager + * @return MenuSelectionManager + */ + public MenuSelectionManager getMenuSelectionManager() + { + return manager; + } + +} diff --git a/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java b/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java index 7e8ff0dc2e9..7fb8aa67d7a 100644 --- a/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java +++ b/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java @@ -1,5 +1,5 @@ /* SwingPropertyChangeSupport.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,48 +39,24 @@ package javax.swing.event; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeListenerProxy; import java.beans.PropertyChangeSupport; -import java.util.ArrayList; -import java.util.EventListener; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * Provides a mechanism for registering {@link PropertyChangeListener}s and * forwarding {@link PropertyChangeEvent}s to those listeners. - * + * + * As of JDK1.5 this class is no longer in use. Use + * {@link PropertyChangeSupport} instead. + * * @author Andrew Selkirk */ public final class SwingPropertyChangeSupport - extends PropertyChangeSupport + extends PropertyChangeSupport { private static final long serialVersionUID = 7162625831330845068L; /** - * Storage for the listeners that are not linked to a specific property. - */ - private transient EventListenerList listeners; - - /** - * Storage for the listeners that are linked (by name) to a specific property. - * The hash table maps <code>String</code> objects (the property names) to - * {@link EventListenerList} instances (which record the listener(s) for the - * given property). - */ - private Hashtable propertyListeners; - - /** - * The object that is used as the default source for the - * {@link PropertyChangeEvent}s generated by this class. - */ - private Object source; - - /** * Creates a new instance. * * @param source the source (<code>null</code> not permitted). @@ -90,247 +66,5 @@ public final class SwingPropertyChangeSupport public SwingPropertyChangeSupport(Object source) { super(source); - this.source = source; - this.listeners = new EventListenerList(); - this.propertyListeners = new Hashtable(); } - - /** - * Registers <code>listener</code> to receive notification of any future - * {@link PropertyChangeEvent}s generated by this instance. - * - * @param listener the listener (<code>null</code> is ignored). - * - * @see #removePropertyChangeListener(PropertyChangeListener) - */ - public synchronized void addPropertyChangeListener(PropertyChangeListener - listener) - { - listeners.add(PropertyChangeListener.class, listener); - } - - /** - * Registers <code>listener</code> to receive notification of any future - * {@link PropertyChangeEvent}s generated by this instance for the named - * property. - * - * @param propertyName the property name. - * @param listener the listener. - * - * @see #removePropertyChangeListener(String, PropertyChangeListener) - */ - public synchronized void addPropertyChangeListener(String propertyName, - PropertyChangeListener listener) - { - EventListenerList list; - list = (EventListenerList) propertyListeners.get(propertyName); - if (list == null) - { - list = new EventListenerList(); - propertyListeners.put(propertyName, list); - } - list.add(PropertyChangeListener.class, listener); - } - - /** - * Removes <code>listener</code> from the list of registered listeners, so - * that it will no longer receive notification of property change events. - * - * @param listener the listener to remove. - */ - public synchronized void removePropertyChangeListener(PropertyChangeListener - listener) - { - listeners.remove(PropertyChangeListener.class, listener); - } - - /** - * Removes <code>listener</code> from the list of registered listeners for - * the named property, so that it will no longer receive notification of - * property change events. - * - * @param propertyName the property name. - * @param listener the listener to remove. - */ - public synchronized void removePropertyChangeListener(String propertyName, - PropertyChangeListener listener) - { - EventListenerList list; - list = (EventListenerList) propertyListeners.get(propertyName); - if (list == null) - return; - list.remove(PropertyChangeListener.class, listener); - if (list.getListenerCount() == 0) - { - propertyListeners.remove(propertyName); - } - } - - /** - * Returns an array of the {@link PropertyChangeListener}s registered with - * this <code>SwingPropertyChangeSupport</code> instance. - * - * @return The array of listeners. - * - * @since 1.4 - */ - public synchronized PropertyChangeListener[] getPropertyChangeListeners() - { - // fetch the named listeners first so we know how many there are - List namedListeners = new ArrayList(); - Set namedListenerEntries = propertyListeners.entrySet(); - Iterator iterator = namedListenerEntries.iterator(); - while (iterator.hasNext()) - { - Map.Entry e = (Map.Entry) iterator.next(); - String propertyName = (String) e.getKey(); - EventListenerList ell = (EventListenerList) e.getValue(); - if (ell != null) - { - Object[] list = ell.getListenerList(); - for (int i = 0; i < list.length; i += 2) - { - namedListeners.add(new PropertyChangeListenerProxy(propertyName, - (PropertyChangeListener) list[i + 1])); - } - } - } - - // create an array that can hold everything - int size = listeners.getListenerCount() + namedListeners.size(); - PropertyChangeListener[] result = new PropertyChangeListener[size]; - - // copy in the general listeners - Object[] list = listeners.getListenerList(); - int index = 0; - for (int i = 0; i < list.length; i += 2) - result[index++] = (PropertyChangeListener) list[i + 1]; - - // ...and the named listeners - Iterator iterator2 = namedListeners.iterator(); - while (iterator2.hasNext()) - result[index++] = (PropertyChangeListenerProxy) iterator2.next(); - - return result; - } - - /** - * Returns an array of all listeners that are registered to receive - * notification of changes to the named property. This includes the general - * listeners as well as those registered specifically for the named - * property. - * - * @param propertyName the property name. - * - * @return An array of all listeners for the named property. - */ - public synchronized PropertyChangeListener[] getPropertyChangeListeners( - String propertyName) - { - EventListenerList list - = (EventListenerList) propertyListeners.get(propertyName); - if (list == null) - return getPropertyChangeListeners(); - int size = listeners.getListenerCount() + list.getListenerCount(); - PropertyChangeListener[] result = new PropertyChangeListener[size]; - - // copy in the general listeners - int index = 0; - for (int i = 0; i < listeners.listenerList.length; i += 2) - { - result[index++] - = (PropertyChangeListener) listeners.listenerList[i + 1]; - } - - // copy in the specific listeners - Object[] specificListeners = list.getListenerList(); - for (int i = 0; i < specificListeners.length; i += 2) - { - result[index++] = (PropertyChangeListener) specificListeners[i + 1]; - } - return result; - } - - /** - * Creates a new {@link PropertyChangeEvent} using the given arguments (and - * the default <code>source</code> for this - * <code>SwingPropertyChangeSupport</code> instance) and forwards it to all - * registered listeners via the - * {@link PropertyChangeListener#propertyChange(PropertyChangeEvent)} method. - * <p> - * Note that if <code>oldValue</code> and <code>newValue</code> are non-null - * and equal, no listeners will be notified. - * - * @param propertyName the property name. - * @param oldValue the old value - * @param newValue the new value. - */ - public void firePropertyChange(String propertyName, Object oldValue, - Object newValue) - { - PropertyChangeEvent event; - event = new PropertyChangeEvent(source, propertyName, oldValue, newValue); - firePropertyChange(event); - } - - /** - * Forwards <code>event</code> to registered listeners. - * <p> - * Note that if the event's <code>getOldValue()</code> and - * <code>getNewValue()</code> methods return non-null and equal values, no - * listeners will be notified. - * - * @param event the event. - */ - public void firePropertyChange(PropertyChangeEvent event) - { - EventListenerList list; - EventListener[] listenerList; - int index; - PropertyChangeListener listener; - - // if the old and new values are non-null and equal, don't notify listeners - if (event.getOldValue() != null && event.getNewValue() != null && - event.getOldValue().equals(event.getNewValue())) - return; - - // Process Main Listener List - listenerList = listeners.getListeners(PropertyChangeListener.class); - for (index = 0; index < listenerList.length; index++) - { - listener = (PropertyChangeListener) listenerList[index]; - listener.propertyChange(event); - } - - // Process Property Listener List - list = (EventListenerList) propertyListeners.get(event.getPropertyName()); - if (list != null) - { - listenerList = list.getListeners(PropertyChangeListener.class); - for (index = 0; index < listenerList.length; index++) - { - listener = (PropertyChangeListener) listenerList[index]; - listener.propertyChange(event); - } - } - - } - - /** - * Tell whether the specified property is being listened on or not. This - * will only return <code>true</code> if there are listeners on all - * properties or if there is a listener specifically on this property. - * - * @param propertyName the property that may be listened on - * @return whether the property is being listened on - * @throws NullPointerException if propertyName is null - */ - public synchronized boolean hasListeners(String propertyName) - { - if (listeners.getListenerCount() > 0) - return true; - else - return (propertyListeners.get(propertyName) != null); - } - } diff --git a/libjava/classpath/javax/swing/event/TableColumnModelEvent.java b/libjava/classpath/javax/swing/event/TableColumnModelEvent.java index 2ca4148aadb..cff49130e35 100644 --- a/libjava/classpath/javax/swing/event/TableColumnModelEvent.java +++ b/libjava/classpath/javax/swing/event/TableColumnModelEvent.java @@ -1,5 +1,5 @@ /* TableColumnModelEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,60 +46,48 @@ import javax.swing.table.TableColumnModel; * TableColumnModelEvent * @author Andrew Selkirk */ -public class TableColumnModelEvent extends EventObject { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * fromIndex - */ - protected int fromIndex = 0; - - /** - * toIndex - */ - protected int toIndex = 0; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor TableColumnModelEvent - * @param source Source TableColumnModel - * @param from From index - * @param to To index - */ - public TableColumnModelEvent(TableColumnModel source, - int from, int to) { - super(source); - fromIndex = from; - toIndex = to; - } // TableColumnModelEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getFromIndex. - * @returns From index - */ - public int getFromIndex() { - return fromIndex; - } // getFromIndex() - - /** - * getToIndex. - * @returns To index - */ - public int getToIndex() { - return toIndex; - } // getToIndex() - - -} // TableColumnModelEvent +public class TableColumnModelEvent extends EventObject +{ + + /** + * fromIndex + */ + protected int fromIndex = 0; + + /** + * toIndex + */ + protected int toIndex = 0; + + /** + * Constructor TableColumnModelEvent + * @param source Source TableColumnModel + * @param from From index + * @param to To index + */ + public TableColumnModelEvent(TableColumnModel source, int from, int to) + { + super(source); + fromIndex = from; + toIndex = to; + } + + /** + * getFromIndex. + * @return From index + */ + public int getFromIndex() + { + return fromIndex; + } + + /** + * getToIndex. + * @return To index + */ + public int getToIndex() + { + return toIndex; + } + +}
\ No newline at end of file diff --git a/libjava/classpath/javax/swing/event/TableModelListener.java b/libjava/classpath/javax/swing/event/TableModelListener.java index c8d6e8f8dbc..21e5ea0474e 100644 --- a/libjava/classpath/javax/swing/event/TableModelListener.java +++ b/libjava/classpath/javax/swing/event/TableModelListener.java @@ -1,5 +1,5 @@ /* TableModelListener.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,16 +40,21 @@ package javax.swing.event; import java.util.EventListener; /** - * TableModelListener public interface + * A <code>TableModelListener</code> can register with a + * {@link javax.swing.table.TableModel} and receive notification of updates to + * the model. + * * @author Andrew Selkirk */ -public interface TableModelListener extends EventListener { - - /** - * Table changed - * @param event Table Model Event - */ - void tableChanged(TableModelEvent event); - - -} // TableModelListener +public interface TableModelListener extends EventListener +{ + + /** + * Called to notify the listener that the + * {@link javax.swing.table.TableModel} has been updated. + * + * @param event contains details of the update. + */ + void tableChanged(TableModelEvent event); + +} diff --git a/libjava/classpath/javax/swing/event/TreeExpansionEvent.java b/libjava/classpath/javax/swing/event/TreeExpansionEvent.java index c4b33134694..5820b339172 100644 --- a/libjava/classpath/javax/swing/event/TreeExpansionEvent.java +++ b/libjava/classpath/javax/swing/event/TreeExpansionEvent.java @@ -1,5 +1,5 @@ /* TreeExpansionEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,44 +46,32 @@ import javax.swing.tree.TreePath; * TreeExpansionEvent * @author Andrew Selkirk */ -public class TreeExpansionEvent extends EventObject { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * path - */ - protected TreePath path = null; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor TreeExpansionEvent - * @param source Source object - * @param path Path - */ - public TreeExpansionEvent(Object source, TreePath path) { - super(source); - this.path = path; - } // TreeExpansionEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getPath - * @returns Tree path - */ - public TreePath getPath() { - return path; - } // getPath() - - -} // TreeExpansionEvent +public class TreeExpansionEvent extends EventObject +{ + + /** + * path + */ + protected TreePath path = null; + + /** + * Constructor TreeExpansionEvent + * @param source Source object + * @param path Path + */ + public TreeExpansionEvent(Object source, TreePath path) + { + super(source); + this.path = path; + } + + /** + * getPath + * @return Tree path + */ + public TreePath getPath() + { + return path; + } + +} diff --git a/libjava/classpath/javax/swing/event/TreeModelEvent.java b/libjava/classpath/javax/swing/event/TreeModelEvent.java index 8fa28a7eadb..2d562a5c4a8 100644 --- a/libjava/classpath/javax/swing/event/TreeModelEvent.java +++ b/libjava/classpath/javax/swing/event/TreeModelEvent.java @@ -1,5 +1,5 @@ /* TreeModelEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,128 +46,123 @@ import javax.swing.tree.TreePath; * TreeModelEvent * @author Andrew Selkirk */ -public class TreeModelEvent extends EventObject { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * childIndices - */ - protected int[] childIndices = null; - - /** - * children - */ - protected Object[] children = null; - - /** - * path - */ - protected TreePath path = null; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- +public class TreeModelEvent extends EventObject +{ + + /** + * childIndices + */ + protected int[] childIndices = null; + + /** + * children + */ + protected Object[] children = null; + + /** + * path + */ + protected TreePath path = null; - /** - * Constructor TreeModelEvent - * @param source Source object - * @param path - */ - public TreeModelEvent(Object source, Object[] path) { - super(source); - this.path = new TreePath(path); - } // TreeModelEvent() - - /** - * Constructor TreeModelEvent - * @param source Source object - * @param path path - * @param childIndices Child indices - * @param children Children - */ - public TreeModelEvent(Object source, Object[] path, - int[] childIndices, Object[] children) { - super(source); - this.path = new TreePath(path); - this.childIndices = childIndices; - this.children = children; - } // TreeModelEvent() - - /** - * Constructor TreeModelEvent - * @param source Source object - * @param path Path - */ - public TreeModelEvent(Object source, TreePath path) { - super(source); - this.path = path; - } // TreeModelEvent() - - /** - * Constructor TreeModelEvent - * @param source Source object - * @param path Path - * @param childIndices Child indices - * @param children Children - */ - public TreeModelEvent(Object source, TreePath path, - int[] childIndices, Object[] children) { - super(source); - this.path = path; - this.childIndices = childIndices; - this.children = children; - } // TreeModelEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getChildIndices - * @returns child indices - */ - public int[] getChildIndices() { - return childIndices; - } // getChildIndices() - - /** - * getChildren - * @returns children - */ - public Object[] getChildren() { - return children; - } // getChildren() - - /** - * getPath - * @returns path - */ - public Object[] getPath() { - return path.getPath(); - } // getPath() - - /** - * getTreePath - * @returns TreePath - */ - public TreePath getTreePath() { - return path; - } // getTreePath() - - /** - * String representation - * @returns String representation - */ - public String toString() { - return getClass() + " [Source: " + getSource() + ", TreePath: " + getTreePath() + - ", Child Indicies: " + getChildIndices() + ", Children: " + getChildren() + - ", Path: " + getPath() +"]"; - } // toString() - - -} // TreeModelEvent + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path + */ + public TreeModelEvent(Object source, Object[] path) + { + super(source); + this.path = new TreePath(path); + } + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, Object[] path, + int[] childIndices, Object[] children) + { + super(source); + this.path = new TreePath(path); + this.childIndices = childIndices; + this.children = children; + } + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + */ + public TreeModelEvent(Object source, TreePath path) + { + super(source); + this.path = path; + } + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, TreePath path, + int[] childIndices, Object[] children) + { + super(source); + this.path = path; + this.childIndices = childIndices; + this.children = children; + } + + /** + * getChildIndices + * @return child indices + */ + public int[] getChildIndices() + { + return childIndices; + } + + /** + * getChildren + * @return children + */ + public Object[] getChildren() + { + return children; + } + + /** + * getPath + * @return path + */ + public Object[] getPath() + { + return path.getPath(); + } + + /** + * getTreePath + * @return TreePath + */ + public TreePath getTreePath() + { + return path; + } + + /** + * String representation + * @return String representation + */ + public String toString() + { + return getClass() + " [Source: " + getSource() + ", TreePath: " + + getTreePath() + ", Child Indicies: " + getChildIndices() + + ", Children: " + getChildren() + ", Path: " + getPath() +"]"; + } + +} diff --git a/libjava/classpath/javax/swing/event/TreeSelectionEvent.java b/libjava/classpath/javax/swing/event/TreeSelectionEvent.java index 9b87667a387..1930677af9f 100644 --- a/libjava/classpath/javax/swing/event/TreeSelectionEvent.java +++ b/libjava/classpath/javax/swing/event/TreeSelectionEvent.java @@ -1,5 +1,5 @@ /* TreeSelectionEvent.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,10 +49,6 @@ import javax.swing.tree.TreePath; */ public class TreeSelectionEvent extends EventObject { - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - /** * paths */ @@ -73,11 +69,6 @@ public class TreeSelectionEvent extends EventObject { */ protected TreePath newLeadSelectionPath; - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - /** * Constructor TreeSelectionEvent * @param source TODO @@ -95,7 +86,7 @@ public class TreeSelectionEvent extends EventObject { this.areNew = areNew; this.oldLeadSelectionPath = oldLeadSelectionPath; this.newLeadSelectionPath = newLeadSelectionPath; - } // TreeSelectionEvent() + } /** * Constructor TreeSelectionEvent @@ -114,29 +105,24 @@ public class TreeSelectionEvent extends EventObject { this.areNew = new boolean[]{isNew}; this.oldLeadSelectionPath = oldLeadSelectionPath; this.newLeadSelectionPath = newLeadSelectionPath; - } // TreeSelectionEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- + } /** - * @returns the first path element + * @return the first path element */ public TreePath getPath() { return paths[0]; - } // getPath() + } /** * - * @returns the paths with selection changed + * @return the paths with selection changed */ public TreePath[] getPaths() { return (TreePath[]) paths.clone(); - } // getPaths() + } /** * @return true if the first path is added to the selection, false otherwise @@ -144,7 +130,7 @@ public class TreeSelectionEvent extends EventObject { public boolean isAddedPath() { return areNew[0]; - } // isAddedPath() + } /** * @param path the path to check @@ -157,7 +143,7 @@ public class TreeSelectionEvent extends EventObject { return areNew[i]; return false; - } // isAddedPath() + } /** * @param index the index'th path @@ -166,7 +152,7 @@ public class TreeSelectionEvent extends EventObject { public boolean isAddedPath(int index) { return areNew[index]; - } // isAddedPath() + } /** * @return the previous lead selection path @@ -174,15 +160,15 @@ public class TreeSelectionEvent extends EventObject { public TreePath getOldLeadSelectionPath() { return oldLeadSelectionPath; - } // getOldLeadSelectionPath() + } /** - * @returns the current lead selection path + * @return the current lead selection path */ public TreePath getNewLeadSelectionPath() { return newLeadSelectionPath; - } // getNewLeadSelectionPath() + } /** * @param source the new event source @@ -193,7 +179,6 @@ public class TreeSelectionEvent extends EventObject { return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath, newLeadSelectionPath); - } // cloneWithSource() - + } -} // TreeSelectionEvent +} diff --git a/libjava/classpath/javax/swing/event/UndoableEditEvent.java b/libjava/classpath/javax/swing/event/UndoableEditEvent.java index 147c2e5b1c5..b59ceadc9c2 100644 --- a/libjava/classpath/javax/swing/event/UndoableEditEvent.java +++ b/libjava/classpath/javax/swing/event/UndoableEditEvent.java @@ -1,5 +1,5 @@ /* UndoableEditEvent.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,46 +47,34 @@ import javax.swing.undo.UndoableEdit; * @author Andrew Selkirk * @author Ronald Veldema */ -public class UndoableEditEvent extends EventObject { +public class UndoableEditEvent extends EventObject +{ private static final long serialVersionUID = 4418044561759134484L; - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * edit - */ - private UndoableEdit edit; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor UndoableEditEvent - * @param source TODO - * @param edit TODO - */ - public UndoableEditEvent(Object source, UndoableEdit edit) { - super(source); - this.edit = edit; - } // UndoableEditEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getEdit - * @returns UndoableEdit - */ - public UndoableEdit getEdit() { - return edit; - } // getEdit() - - -} // UndoableEditEvent + /** + * edit + */ + private UndoableEdit edit; + + /** + * Constructor UndoableEditEvent + * @param source TODO + * @param edit TODO + */ + public UndoableEditEvent(Object source, UndoableEdit edit) + { + super(source); + this.edit = edit; + } + + /** + * getEdit + * @return UndoableEdit + */ + public UndoableEdit getEdit() + { + return edit; + } + +} |

