JComponent.java, [...]: New versions from classpath.
authorMichael Koch <konqueror@gmx.de>
Thu, 19 Jun 2003 16:30:09 +0000 (16:30 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 19 Jun 2003 16:30:09 +0000 (16:30 +0000)
2003-06-19  Michael Koch  <konqueror@gmx.de>

* javax/swing/JComponent.java,
javax/swing/JInternalFrame.java,
javax/swing/MenuSelectionManager.java,
javax/swing/SwingUtilities.java,
javax/swing/ToggleButtonModel.java:
New versions from classpath.

From-SVN: r68207

libjava/ChangeLog
libjava/javax/swing/JComponent.java
libjava/javax/swing/JInternalFrame.java
libjava/javax/swing/MenuSelectionManager.java
libjava/javax/swing/SwingUtilities.java
libjava/javax/swing/ToggleButtonModel.java

index d85f3a3acfbf272e9ca18447a46d87afb59ea706..28446b35ed50aa19ecf68af3878da8cf8fe07084 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-19  Michael Koch  <konqueror@gmx.de>
+
+       * javax/swing/JComponent.java,
+       javax/swing/JInternalFrame.java,
+       javax/swing/MenuSelectionManager.java,
+       javax/swing/SwingUtilities.java,
+       javax/swing/ToggleButtonModel.java:
+       New versions from classpath.
+
 2003-06-19  Michael Koch  <konqueror@gmx.de>
 
        * java/text/CollationElementIterator.java
index 7cfa7435d7be80e524e682d2fdfea99e70ad3e9c..a0409a4fbfe3bc9b45a23fea33b2efa32f29db70 100644 (file)
@@ -66,7 +66,6 @@ import java.util.Hashtable;
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleExtendedComponent;
-import javax.accessibility.AccessibleKeyBinding;
 import javax.accessibility.AccessibleRole;
 import javax.accessibility.AccessibleStateSet;
 import javax.swing.event.AncestorListener;
@@ -116,16 +115,6 @@ public abstract class JComponent extends Container implements Serializable
                 * AccessibleFocusHandler
                 */
                protected class AccessibleFocusHandler implements FocusListener {
-
-                       //-------------------------------------------------------------
-                       // Variables --------------------------------------------------
-                       //-------------------------------------------------------------
-
-
-                       //-------------------------------------------------------------
-                       // Initialization ---------------------------------------------
-                       //-------------------------------------------------------------
-
                        /**
                         * Constructor AccessibleFocusHandler
                         * @param component TODO
@@ -134,11 +123,6 @@ public abstract class JComponent extends Container implements Serializable
                                // TODO
                        } // AccessibleFocusHandler()
 
-
-                       //-------------------------------------------------------------
-                       // Methods ----------------------------------------------------
-                       //-------------------------------------------------------------
-
                        /**
                         * focusGained
                         * @param event TODO
@@ -154,24 +138,12 @@ public abstract class JComponent extends Container implements Serializable
                        public void focusLost(FocusEvent valevent) {
                                // TODO
                        } // focusLost()
-
-
                } // AccessibleFocusHandler
 
                /**
                 * AccessibleContainerHandler
                 */
                protected class AccessibleContainerHandler implements ContainerListener {
-
-                       //-------------------------------------------------------------
-                       // Variables --------------------------------------------------
-                       //-------------------------------------------------------------
-
-
-                       //-------------------------------------------------------------
-                       // Initialization ---------------------------------------------
-                       //-------------------------------------------------------------
-
                        /**
                         * Constructor AccessibleContainerHandler
                         * @param component TODO
@@ -180,11 +152,6 @@ public abstract class JComponent extends Container implements Serializable
                                // TODO
                        } // AccessibleContainerHandler()
 
-
-                       //-------------------------------------------------------------
-                       // Methods ----------------------------------------------------
-                       //-------------------------------------------------------------
-
                        /**
                         * componentAdded
                         * @param event TODO
@@ -200,15 +167,8 @@ public abstract class JComponent extends Container implements Serializable
                        public void componentRemoved(ContainerEvent valevent) {
                                // TODO
                        } // componentRemoved()
-
-
                } // AccessibleContainerHandler
 
-
-               //-------------------------------------------------------------
-               // Variables --------------------------------------------------
-               //-------------------------------------------------------------
-
                /**
                 * accessibleContainerHandler
                 */
@@ -219,11 +179,6 @@ public abstract class JComponent extends Container implements Serializable
                 */
                protected FocusListener accessibleFocusHandler;
 
-
-               //-------------------------------------------------------------
-               // Initialization ---------------------------------------------
-               //-------------------------------------------------------------
-
                /**
                 * Constructor AccessibleJComponent
                 * @param component TODO
@@ -233,11 +188,6 @@ public abstract class JComponent extends Container implements Serializable
                        // TODO
                } // AccessibleJComponent()
 
-
-               //-------------------------------------------------------------
-               // Methods ----------------------------------------------------
-               //-------------------------------------------------------------
-
                /**
                 * addPropertyChangeListener
                 * @param listener TODO
@@ -327,7 +277,6 @@ public abstract class JComponent extends Container implements Serializable
                //updateUI(); // get a proper ui
        }
 
-
        // protected EventListenerList listenerList
        public boolean contains(int x, int y)
        {
@@ -335,14 +284,12 @@ public abstract class JComponent extends Container implements Serializable
                return super.contains(x,y);
        }
 
-
        public  void addNotify()
        {
                //Notification to this component that it now has a parent component.
                super.addNotify();
        }
 
-
        Hashtable get_prop_hash()
        {
                if (prop_hash == null)
@@ -374,7 +321,6 @@ public abstract class JComponent extends Container implements Serializable
        public void putClientProperty(Object key, Object value)
        {    get_prop_hash().put(key, value);   }
 
-
        public void removeAncestorListener(AncestorListener listener)
        {  get_ancestor_list().removeElement(listener);  }
 
@@ -405,7 +351,6 @@ public abstract class JComponent extends Container implements Serializable
                //super.computeVisibleRect(rect);
        }
 
-
        public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
        {
                //Reports a bound property change.
@@ -446,7 +391,6 @@ public abstract class JComponent extends Container implements Serializable
                //       Reports a bound property change.
        }
 
-
        protected  void fireVetoableChange(String propertyName, Object oldValue, Object newValue)
        {
                //       Support for reporting constrained property changes.
@@ -658,16 +602,6 @@ public abstract class JComponent extends Container implements Serializable
                }
        }
 
-
-
-       /*********************************************************************
-        *
-        *
-        *  tooltips:
-        *
-        *
-        **************************************/
-
        public JToolTip createToolTip()
        {
                if (tooltip == null)
@@ -687,15 +621,6 @@ public abstract class JComponent extends Container implements Serializable
        public String getToolTipText(MouseEvent event)
        {       return tool_tip_text;    }
 
-       /*********************************************************************
-        *
-        *
-        *    things to do with visibility:
-        *
-        *
-        **************************************/
-
-
        public Container getTopLevelAncestor()
        {
                //      Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container.
@@ -953,7 +878,6 @@ public abstract class JComponent extends Container implements Serializable
                //      If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport
        }
 
-
        public void setDebugGraphicsOptions(int debugOptions)
        {
                //      Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.
@@ -977,6 +901,7 @@ public abstract class JComponent extends Container implements Serializable
                revalidate();
                repaint();
        }
+
        public void setBackground(Color bg)
        {
                super.setBackground(bg);
@@ -1043,16 +968,6 @@ public abstract class JComponent extends Container implements Serializable
                paint(g);
        }
 
-
-
-       /******************************************
-        *
-        *
-        *  UI management
-        * 
-        *
-        *********/
-
         public String getUIClassID()
        {
                ///          Return the UIDefaults key used to look up the name of the swing.
index 55162393412428424a8da4a6004e8bf5d6b0367c..034050b6456c25e187c0ed26e42e0dcab4e2d00b 100644 (file)
@@ -35,11 +35,27 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing;
-/**
- * STUBBED
- */
+
+import java.awt.Component;
+import java.awt.Container;
+import javax.accessibility.Accessible;
+
 public class JInternalFrame extends JComponent
 /*implements Accessible, WindowConstants, RootPaneContainer*/
 {
+  private static final long serialVersionUID = -5425177187760785402L;
+
+  public static final String CONTENT_PANE_PROPERTY = "contentPane";
+  public static final String MENU_BAR_PROPERTY = "JMenuBar";
+  public static final String TITLE_PROPERTY = "title";
+  public static final String LAYERED_PANE_PROPERTY = "layeredPane";
+  public static final String ROOT_PANE_PROPERTY = "rootPane";
+  public static final String GLASS_PANE_PROPERTY = "glassPane";
+  public static final String FRAME_ICON_PROPERTY = "frameIcon";
+  public static final String IS_SELECTED_PROPERTY = "selected";
+  public static final String IS_CLOSED_PROPERTY = "closed";
+  public static final String IS_MAXIMUM_PROPERTY = "maximum";
+  public static final String IS_ICON_PROPERTY = "icon";
 } // class JInternalFrame
index 4d635c0e81cc542adce86147a712112c08a87e97..9088968538ace28e196f3020cd9063d3e3c27dfa 100644 (file)
@@ -35,10 +35,42 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing;
-/**
- * STUBBED
- */
+
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+
 public class MenuSelectionManager
 {
+  protected ChangeEvent changeEvent;
+  
+  protected EventListenerList listenerList = new EventListenerList ();
+
+  protected void fireStateChanged ()
+  {
+    ChangeListener[] listeners = getChangeListeners ();
+
+    for (int i = 0; i < listeners.length; i++)
+      {
+        listeners [i].stateChanged (new ChangeEvent (this));
+      }
+  }
+
+  public void addChangeListener (ChangeListener listener)
+  {
+    listenerList.add (ChangeListener.class, listener);
+  }
+
+  public void removeChangeListener (ChangeListener listener)
+  {
+    listenerList.remove (ChangeListener.class, listener);
+  }
+
+  /** @since 1.4 */
+  public ChangeListener[] getChangeListeners ()
+  {
+    return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
+  }
 } // class MenuSelectionManager
index 974ee4f8d0e94dbfb8bb8bb7eab1e929e8258749..a123ad834385c94f1209fb79dc7cab25d671307e 100644 (file)
@@ -35,20 +35,34 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-package javax.swing;
-
-import java.awt.*;
 
+package javax.swing;
 
-public class SwingUtilities
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.EventQueue;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.InvocationTargetException;
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleStateSet;
+
+public class SwingUtilities implements SwingConstants
+{
+  public static FontMetrics getFontMetrics (Font font)
 {
-    
-    public static FontMetrics getFontMetrics ( Font font ) {
        return Toolkit.getDefaultToolkit().getFontMetrics(font);
     }
 
-
-    static JRootPane getRootPane(Component a)
+  public static JRootPane getRootPane (Component a)
     {
        if (a instanceof JRootPane)
            return (JRootPane) a;
@@ -63,11 +77,11 @@ public class SwingUtilities
        return null;
     }
 
-    static void updateComponentTreeUI(JFrame comp)
+  public static void updateComponentTreeUI(JFrame comp)
     {
     }
 
-    static public String layoutCompoundLabel(JComponent c, 
+  public static String layoutCompoundLabel(JComponent c, 
                                             FontMetrics fm,
                                             String text,
                                             Icon i,
index 0128258bd76741abd8c78d121fadd665716d1981..b268925d1b9957f9b05809e8667ba16fc7626b54 100644 (file)
@@ -35,14 +35,10 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-package javax.swing;
 
-import java.util.*;
-import java.awt.event.*;
-import javax.swing.event.*;
+package javax.swing;
 
-public 
-class ToggleButtonModel extends DefaultButtonModel
+public class ToggleButtonModel extends DefaultButtonModel
 {
     ToggleButtonModel(JComponent c)
     {