[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: SwingPropertyChangeSupport.java reformatted
From: |
David Gilbert |
Subject: |
[cp-patches] FYI: SwingPropertyChangeSupport.java reformatted |
Date: |
Mon, 22 Aug 2005 20:47:37 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050728) |
I committed this patch:
2005-08-22 David Gilbert <address@hidden>
* javax/swing/event/SwingPropertyChangeSupport.java: reformatted.
Regards,
Dave
Index: javax/swing/event/SwingPropertyChangeSupport.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/event/SwingPropertyChangeSupport.java,v
retrieving revision 1.5
diff -u -r1.5 SwingPropertyChangeSupport.java
--- javax/swing/event/SwingPropertyChangeSupport.java 2 Jul 2005 20:32:50
-0000 1.5
+++ javax/swing/event/SwingPropertyChangeSupport.java 22 Aug 2005 19:40:59
-0000
@@ -1,5 +1,5 @@
/* SwingPropertyChangeSupport.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -36,7 +36,6 @@
exception statement from your version. */
package javax.swing.event;
-
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -49,207 +48,195 @@
/**
* SwingPropertyChangeSupport
* @author Andrew Selkirk
-*/
-public final class SwingPropertyChangeSupport
- extends PropertyChangeSupport {
+ */
+public final class SwingPropertyChangeSupport
+ extends PropertyChangeSupport
+{
private static final long serialVersionUID = 7162625831330845068L;
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * listeners
- */
- private transient EventListenerList listeners;
-
- /**
- * propertyListeners
- */
- private Hashtable propertyListeners;
-
- /**
- * source
- */
- private Object source;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SwingPropertyChangeSupport
- * @param source TODO
- */
- public SwingPropertyChangeSupport(Object source) {
- super(source);
- this.source = source;
- this.listeners = new EventListenerList();
- this.propertyListeners = new Hashtable();
- } // SwingPropertyChangeSupport()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * writeObject
- * @param stream TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream stream) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * readObject
- * @param stream TODO
- * @exception ClassNotFoundException TODO
- * @exception IOException TODO
- */
- private void readObject(ObjectInputStream stream) throws
ClassNotFoundException, IOException {
- // TODO
- } // readObject()
-
- /**
- * addPropertyChangeListener
- * @param listener TODO
- */
- public synchronized void
addPropertyChangeListener(PropertyChangeListener listener) {
- listeners.add(PropertyChangeListener.class, listener);
- } // addPropertyChangeListener()
-
- /**
- * addPropertyChangeListener
- * @param propertyName TODO
- * @param listener TODO
- */
- public synchronized void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener) {
-
- // Variables
- EventListenerList list;
-
- // Get Listener list
- list = (EventListenerList) propertyListeners.get(propertyName);
- if (list == null) {
- list = new EventListenerList();
- propertyListeners.put(propertyName, list);
- } // if
-
- // Add Listeners
- list.add(PropertyChangeListener.class, listener);
-
- } // addPropertyChangeListener()
-
- /**
- * removePropertyChangeListener
- * @param listener TODO
- */
- public synchronized void
removePropertyChangeListener(PropertyChangeListener listener) {
- listeners.remove(PropertyChangeListener.class, listener);
- } // removePropertyChangeListener()
-
- /**
- * removePropertyChangeListener
- * @param propertyName TODO
- * @param listener TODO
- */
- public synchronized void removePropertyChangeListener(String
propertyName, PropertyChangeListener listener) {
-
- // Variables
- EventListenerList list;
-
- // Get Listener list
- list = (EventListenerList) propertyListeners.get(propertyName);
- if (list == null) {
- return;
- } // if
-
- // Remove Listeners
- list.remove(PropertyChangeListener.class, listener);
-
- // Clean up propertyListeners
- if (list.getListenerCount() == 0) {
- propertyListeners.remove(propertyName);
- } // if
-
- } // removePropertyChangeListener()
-
- /**
- * firePropertyChange
- * @param propertyName TODO
- * @param oldValue TODO
- * @param newValue TODO
- */
- public void firePropertyChange(String propertyName, Object oldValue,
Object newValue) {
-
- // Variables
- PropertyChangeEvent event;
-
- // Create Property Change Event
- event = new PropertyChangeEvent(source, propertyName, oldValue,
newValue);
-
- // Fire Event
- firePropertyChange(event);
-
- } // firePropertyChange()
-
- /**
- * firePropertyChange
- * @param event TODO
- */
- public void firePropertyChange(PropertyChangeEvent event) {
-
- // Variables
- EventListenerList list;
- EventListener[] listenerList;
- int index;
- PropertyChangeListener listener;
-
- // Check Values if they are equal
- if (event.getOldValue() == null && event.getNewValue() == null
||
- (event.getOldValue() != null && event.getNewValue() != null
&&
- event.getOldValue().equals(event.getNewValue()))) {
- return;
- } // if
-
- // Process Main Listener List
- listenerList =
listeners.getListeners(PropertyChangeListener.class);
- for (index = 0; index < listenerList.length; index++) {
- listener = (PropertyChangeListener) listenerList[index];
- listener.propertyChange(event);
- } // for
-
- // 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);
- } // for
- } // if
-
- } // firePropertyChange()
-
- /**
- * hasListeners
- * @param propertyName TODO
- * @returns boolean
- */
- public synchronized boolean hasListeners(String propertyName) {
-
- // Get Listener list
- if (propertyListeners.get(propertyName) == null) {
- return false;
- } // if
-
- return true;
-
- } // hasListeners()
-
+ /**
+ * listeners
+ */
+ private transient EventListenerList listeners;
+
+ /**
+ * propertyListeners
+ */
+ private Hashtable propertyListeners;
+
+ /**
+ * source
+ */
+ private Object source;
+
+ /**
+ * Constructor SwingPropertyChangeSupport
+ * @param source TODO
+ */
+ public SwingPropertyChangeSupport(Object source)
+ {
+ super(source);
+ this.source = source;
+ this.listeners = new EventListenerList();
+ this.propertyListeners = new Hashtable();
+ }
+
+ /**
+ * writeObject
+ * @param stream TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream stream) throws IOException
+ {
+ // TODO
+ }
+
+ /**
+ * readObject
+ * @param stream TODO
+ * @exception ClassNotFoundException TODO
+ * @exception IOException TODO
+ */
+ private void readObject(ObjectInputStream stream)
+ throws ClassNotFoundException, IOException
+ {
+ // TODO
+ }
+
+ /**
+ * addPropertyChangeListener
+ * @param listener TODO
+ */
+ public synchronized void addPropertyChangeListener(PropertyChangeListener
+ listener)
+ {
+ listeners.add(PropertyChangeListener.class, listener);
+ }
+
+ /**
+ * addPropertyChangeListener
+ * @param propertyName TODO
+ * @param listener TODO
+ */
+ public synchronized void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener listener)
+ {
+ EventListenerList list;
+
+ // Get Listener list
+ list = (EventListenerList) propertyListeners.get(propertyName);
+ if (list == null)
+ {
+ list = new EventListenerList();
+ propertyListeners.put(propertyName, list);
+ }
+
+ // Add Listeners
+ list.add(PropertyChangeListener.class, listener);
+
+ }
+
+ /**
+ * removePropertyChangeListener
+ * @param listener TODO
+ */
+ public synchronized void removePropertyChangeListener(PropertyChangeListener
+ listener)
+ {
+ listeners.remove(PropertyChangeListener.class, listener);
+ }
+
+ /**
+ * removePropertyChangeListener
+ * @param propertyName TODO
+ * @param listener TODO
+ */
+ public synchronized void removePropertyChangeListener(String propertyName,
+ PropertyChangeListener listener)
+ {
+ EventListenerList list;
+
+ list = (EventListenerList) propertyListeners.get(propertyName);
+ if (list == null)
+ return;
+
+ // Remove Listeners
+ list.remove(PropertyChangeListener.class, listener);
+
+ // Clean up propertyListeners
+ if (list.getListenerCount() == 0)
+ {
+ propertyListeners.remove(propertyName);
+ }
+
+ }
+
+ /**
+ * firePropertyChange
+ * @param propertyName TODO
+ * @param oldValue TODO
+ * @param newValue TODO
+ */
+ public void firePropertyChange(String propertyName, Object oldValue,
+ Object newValue)
+ {
+ PropertyChangeEvent event;
+ event = new PropertyChangeEvent(source, propertyName, oldValue, newValue);
+ firePropertyChange(event);
+ }
+
+ /**
+ * firePropertyChange
+ * @param event TODO
+ */
+ public void firePropertyChange(PropertyChangeEvent event)
+ {
+ EventListenerList list;
+ EventListener[] listenerList;
+ int index;
+ PropertyChangeListener listener;
+
+ // Check Values if they are equal
+ if (event.getOldValue() == null && event.getNewValue() == null ||
+ (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);
+ }
+ }
+
+ }
+
+ /**
+ * hasListeners
+ * @param propertyName TODO
+ * @returns boolean
+ */
+ public synchronized boolean hasListeners(String propertyName)
+ {
+ if (propertyListeners.get(propertyName) == null)
+ {
+ return false;
+ }
+ return true;
+ }
-} // SwingPropertyChangeSupport
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: SwingPropertyChangeSupport.java reformatted,
David Gilbert <=