[kaffe] CVS kaffe (riccardo): copied over change property methods from classpath

Kaffe CVS cvs-commits at kaffe.org
Thu Apr 13 14:30:33 PDT 2006


PatchSet 7219 
Date: 2006/04/13 21:15:35
Author: riccardo
Branch: HEAD
Tag: (none) 
Log:
copied over change property methods from classpath

Members: 
	ChangeLog:1.4725->1.4726 
	libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.7->1.8 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4725 kaffe/ChangeLog:1.4726
--- kaffe/ChangeLog:1.4725	Tue Apr 11 23:59:52 2006
+++ kaffe/ChangeLog	Thu Apr 13 21:15:35 2006
@@ -1,3 +1,8 @@
+2006-04-13  Riccardo Mottola <riccardo at kaffe.org>
+
+	* libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:
+	copied over change property methods from classpath
+	
 2006-04-12  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/xprof/mangle.c (mangleClassType): 
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.7 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.8
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java:1.7	Wed Feb  8 11:58:04 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Component.java	Thu Apr 13 21:15:53 2006
@@ -43,6 +43,8 @@
 import java.io.Serializable;
 import java.util.Locale;
 import java.awt.dnd.DropTarget;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
 
 import org.kaffe.awt.DoNothingPeer;
 
@@ -110,6 +112,17 @@
 	final static int IS_MOUSE_AWARE = 0x10000;
 	final static int IS_TEMP_HIDDEN = 0x20000;
 	final static int IS_SHOWING = IS_ADD_NOTIFIED | IS_PARENT_SHOWING | IS_VISIBLE;
+	
+ /**
+   * Describes all registered PropertyChangeListeners.
+   *
+   * @see #addPropertyChangeListener(PropertyChangeListener)
+   * @see #removePropertyChangeListener(PropertyChangeListener)
+   * @see #firePropertyChange(String, Object, Object)
+   * @serial the property change listeners
+   * @since 1.2
+   */
+  PropertyChangeSupport changeSupport;
 
 static class TreeLock
 {
@@ -1903,6 +1916,8 @@
 public void addMouseWheelListener(MouseWheelListener l) {
 }
 
+
+
 synchronized void updateLinkedGraphics () {
 	GraphicsLink li, last, next;
 
@@ -1925,6 +1940,55 @@
 		}
 	}
 }
+
+  /**
+   * Adds the specified property listener to this component. This is harmless
+   * if the listener is null, but if the listener has already been registered,
+   * it will now be registered twice. The property listener ignores inherited
+   * properties. Recognized properties include:<br>
+   * <ul>
+   * <li>the font (<code>"font"</code>)</li>
+   * <li>the background color (<code>"background"</code>)</li>
+   * <li>the foreground color (<code>"foreground"</code>)</li>
+   * <li>the focusability (<code>"focusable"</code>)</li>
+   * <li>the focus key traversal enabled state
+   *     (<code>"focusTraversalKeysEnabled"</code>)</li>
+   * <li>the set of forward traversal keys
+   *     (<code>"forwardFocusTraversalKeys"</code>)</li>
+   * <li>the set of backward traversal keys
+   *     (<code>"backwardFocusTraversalKeys"</code>)</li>
+   * <li>the set of up-cycle traversal keys
+   *     (<code>"upCycleFocusTraversalKeys"</code>)</li>
+   * </ul>
+   *
+   * @param listener the new listener to add
+   * @see #removePropertyChangeListener(PropertyChangeListener)
+   * @see #getPropertyChangeListeners()
+   * @see #addPropertyChangeListener(String, PropertyChangeListener)
+   * @since 1.1
+   */
+  public void addPropertyChangeListener(PropertyChangeListener listener)
+  {
+    if (changeSupport == null)
+      changeSupport = new PropertyChangeSupport(this);
+    changeSupport.addPropertyChangeListener(listener);
+  }
+
+  /**
+   * Removes the specified property listener from the component. This is
+   * harmless if the listener was not previously registered.
+   *
+   * @param listener the listener to remove
+   * @see #addPropertyChangeListener(PropertyChangeListener)
+   * @see #getPropertyChangeListeners()
+   * @see #removePropertyChangeListener(String, PropertyChangeListener)
+   * @since 1.1
+   */
+  public void removePropertyChangeListener(PropertyChangeListener listener)
+  {
+    if (changeSupport != null)
+      changeSupport.removePropertyChangeListener(listener);
+  }
 
 public void validate () {
 	// we can't validate a not-yet-addNotifyed Component




More information about the kaffe mailing list