From 80d4281fc5c07c3b183d87f3e7da94b12f747caf Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 27 Jan 2004 18:55:11 +0000 Subject: [PATCH] AbstractCellEditor.java: Reformated. 2004-01-27 Michael Koch * javax/swing/AbstractCellEditor.java: Reformated. * javax/swing/DefaultListSelectionModel.java (listenerList): Made protected. (addListSelectionListener): Javadoc added. (removeListSelectionListener): Likewise. (getListeners): Likewise. (getListSelectionListeners): Likewise. * javax/swing/JComboBox.java: Merged copyright year. * javax/swing/plaf/basic/BasicGraphicsUtils.java: Merged empty line. From-SVN: r76737 --- libjava/ChangeLog | 1 + libjava/javax/swing/AbstractCellEditor.java | 22 ++++---- .../swing/DefaultListSelectionModel.java | 53 +++++++++++++++---- libjava/javax/swing/JComboBox.java | 2 +- .../swing/plaf/basic/BasicGraphicsUtils.java | 1 + 5 files changed, 56 insertions(+), 23 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d9869d017ea..f0ce8982342 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -9,6 +9,7 @@ (getListSelectionListeners): Likewise. * javax/swing/JComboBox.java: Merged copyright year. * javax/swing/plaf/basic/BasicGraphicsUtils.java: Merged empty line. + 2004-01-26 Andrew Haley * javax/swing/table/JTableHeader.java: Extend JComponent diff --git a/libjava/javax/swing/AbstractCellEditor.java b/libjava/javax/swing/AbstractCellEditor.java index b2a4f4c7b50..bc4652388dc 100644 --- a/libjava/javax/swing/AbstractCellEditor.java +++ b/libjava/javax/swing/AbstractCellEditor.java @@ -1,5 +1,5 @@ /* AbstractCellEditor.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -54,15 +54,15 @@ public abstract class AbstractCellEditor { static final long serialVersionUID = -1048006551406220959L; - /** - * listenerList - */ - protected EventListenerList listenerList; + /** + * listenerList + */ + protected EventListenerList listenerList; - /** - * changeEvent - */ - protected transient ChangeEvent changeEvent; + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent; /** * Constructor AbstractCellEditor @@ -165,6 +165,4 @@ public abstract class AbstractCellEditor listeners [index].editingCanceled (changeEvent); } } - - -} // AbstractCellEditor +} diff --git a/libjava/javax/swing/DefaultListSelectionModel.java b/libjava/javax/swing/DefaultListSelectionModel.java index 7ad66b0e302..093e3e616af 100644 --- a/libjava/javax/swing/DefaultListSelectionModel.java +++ b/libjava/javax/swing/DefaultListSelectionModel.java @@ -1,5 +1,5 @@ /* DefaultListSelectionModel.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,15 +47,12 @@ import javax.swing.event.ListSelectionListener; public class DefaultListSelectionModel implements Cloneable, ListSelectionModel, Serializable { - private EventListenerList listenerList = new EventListenerList(); + protected EventListenerList listenerList = new EventListenerList(); int mode = SINGLE_SELECTION; Vector sel = new Vector(); - { - } - class Range { int i0, i1; @@ -169,23 +166,59 @@ public class DefaultListSelectionModel implements Cloneable, ListSelectionModel, sel.addElement(new Range(index0, index1)); } + /** + * Adds a listener. + * + * @param listener the listener to add + * + * @see removeListSelectionListener + * @see getListSelectionListeners + */ public void addListSelectionListener(ListSelectionListener listener) { listenerList.add (ListSelectionListener.class, listener); } + /** + * Removes a registered listener. + * + * @param listener the listener to remove + * + * @see addListSelectionListener + * @see getListSelectionListeners + */ public void removeListSelectionListener(ListSelectionListener listener) { listenerList.remove (ListSelectionListener.class, listener); } - - public ListSelectionListener[] getListSelectionListeners() - { - return (ListSelectionListener[]) getListeners (ListSelectionListener.class); - } + /** + * Returns an array of all registerers listeners. + * + * @return the array + * + * @since 1.3 + * + * @see getListSelectionListener + */ public EventListener[] getListeners (Class listenerType) { return listenerList.getListeners (listenerType); } + + /** + * Returns an array of all registerd list selection listeners. + * + * @return the array + * + * @since 1.4 + * + * @see addListSelectionListener + * @see removeListSelectionListener + * @see getListeners + */ + public ListSelectionListener[] getListSelectionListeners() + { + return (ListSelectionListener[]) getListeners (ListSelectionListener.class); + } } diff --git a/libjava/javax/swing/JComboBox.java b/libjava/javax/swing/JComboBox.java index b0192936c29..b3c5ccf8834 100644 --- a/libjava/javax/swing/JComboBox.java +++ b/libjava/javax/swing/JComboBox.java @@ -1,5 +1,5 @@ /* JComboBox.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java index f88bf928747..20713739da2 100644 --- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java +++ b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java @@ -621,6 +621,7 @@ public class BasicGraphicsUtils viewRect, iconRect, textRect, textIconGap); + /* +------------------------+ +------------------------+ * | | | | * | ICON | | CONTENTCONTENTCONTENT |