[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: various swing cleanups

Kaffe CVS cvs-commits at kaffe.org
Wed Dec 22 16:44:37 PST 2004


PatchSet 5710 
Date: 2004/12/23 00:40:18
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: various swing cleanups

Members: 
	ChangeLog:1.3255->1.3256 
	libraries/javalib/javax/swing/JApplet.java:1.3->1.4 
	libraries/javalib/javax/swing/JInternalFrame.java:1.6->1.7 
	libraries/javalib/javax/swing/JWindow.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3255 kaffe/ChangeLog:1.3256
--- kaffe/ChangeLog:1.3255	Wed Dec 22 20:01:56 2004
+++ kaffe/ChangeLog	Thu Dec 23 00:40:18 2004
@@ -1,5 +1,49 @@
 2004-12-22  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/javax/swing/JApplet.java,
+	libraries/javalib/javax/swing/JInternalFrame.java,
+	libraries/javalib/javax/swing/JWindow.java:
+	Resynced with GNU Classpath.
+
+	2004-12-21  Michael Koch  <konqueror at gmx.de>
+
+	* javax/swing/JFrame.java
+	(setDefaultLookAndFeelDecorated): Removed wrong code again.
+	* javax/swing/JInternalFrame.java
+	(setDefaultCloseOperation): Fixed typo.
+
+	2004-12-21  Michael Koch  <konqueror at gmx.de>
+
+	* javax/swing/JApplet.java
+	(HIDE_ON_CLOSE): Removed.
+	(EXIT_ON_CLOSE): Likewise.
+	(DISPOSE_ON_CLOSE): Likewise.
+	(DO_NOTHING_ON_CLOSE): Likewise.
+	(close_action): Likewise.
+	(getDefaultCloseOperation): Likewise.
+	(setDefaultCloseOperation): Likewise.
+	(processWindowEvent): Likewise.
+	(getPreferredSize): Simplified.
+	* javax/swing/JDialog.java
+	(setDefaultLookAndFeelDecorated): Throw exception on wrong argument
+	value.
+	* javax/swing/JFrame.java
+	(setDefaultLookAndFeelDecorated): Likewise.
+	* javax/swing/JInternalFrame.java
+	(setDefaultCloseOperation): Fixed throwing exception on wrong argument
+	value.
+	* javax/swing/JWindow.java
+	(HIDE_ON_CLOSE): Removed.
+	(EXIT_ON_CLOSE): Likewise.
+	(DISPOSE_ON_CLOSE): Likewise.
+	(DO_NOTHING_ON_CLOSE): Likewise.
+	(close_action): Likewise.
+	(processKeyEvent): Likewise.
+	(setDefaultCloseOperation): Likewise.
+	(getPreferredSize): Simplified.
+
+2004-12-22  Dalibor Topic  <robilad at kaffe.org>
+
 	* configure.ac: Disable gjdoc by default because it needs 
 	external ANTLR.
 
Index: kaffe/libraries/javalib/javax/swing/JApplet.java
diff -u kaffe/libraries/javalib/javax/swing/JApplet.java:1.3 kaffe/libraries/javalib/javax/swing/JApplet.java:1.4
--- kaffe/libraries/javalib/javax/swing/JApplet.java:1.3	Sun Oct 24 13:39:10 2004
+++ kaffe/libraries/javalib/javax/swing/JApplet.java	Thu Dec 23 00:40:21 2004
@@ -55,13 +55,6 @@
 {
   private static final long serialVersionUID = 7269359214497372587L;
   
-  public static final int HIDE_ON_CLOSE = 0;
-  public static final int EXIT_ON_CLOSE = 1;
-  public static final int DISPOSE_ON_CLOSE = 2;
-  public static final int DO_NOTHING_ON_CLOSE = 3;
-  
-  private int close_action = EXIT_ON_CLOSE;
-
   protected JRootPane rootPane;
   protected boolean rootPaneCheckingEnabled;
 
@@ -83,10 +76,7 @@
 
   public Dimension getPreferredSize()
   {
-    Dimension d = super.getPreferredSize();
-    System.out.println("JFrame.getPrefSize(): " + d + " , comp="
-                       + getComponentCount() + ", layout=" + getLayout());
-    return d;
+    return super.getPreferredSize();
   }
 
   public void setLayout(LayoutManager manager)
@@ -155,11 +145,6 @@
     return null;
   }
 
-  int getDefaultCloseOperation()
-  {
-    return close_action;
-  }
-
   public JMenuBar getJMenuBar()
   {
     return getRootPane().getJMenuBar();
@@ -179,54 +164,10 @@
   {
     super.processKeyEvent(e);
   }
-
-  protected void processWindowEvent(WindowEvent e)
-  {
-    //      System.out.println("PROCESS_WIN_EV-1: " + e);
-    //        super.processWindowEvent(e); 
-    //      System.out.println("PROCESS_WIN_EV-2: " + e);
-    switch (e.getID())
-      {
-      case WindowEvent.WINDOW_CLOSING:
-        {
-	  switch (close_action)
-	    {
-	    case EXIT_ON_CLOSE:
-	      {
-		System.out.println("user requested exit on close");
-		System.exit(1);
-		break;
-	      }
-	    case DISPOSE_ON_CLOSE:
-	      {
-		System.out.println("user requested dispose on close");
-		//dispose();
-		break;
-	      }
-	    case HIDE_ON_CLOSE:
-	    case DO_NOTHING_ON_CLOSE:
-	      break;
-	    }
-	  break;
-        }
-      case WindowEvent.WINDOW_CLOSED:
-      case WindowEvent.WINDOW_OPENED:
-      case WindowEvent.WINDOW_ICONIFIED:
-      case WindowEvent.WINDOW_DEICONIFIED:
-      case WindowEvent.WINDOW_ACTIVATED:
-      case WindowEvent.WINDOW_DEACTIVATED:
-	break;
-      }
-  }
-
+  
   public void remove(Component comp)
   {
     getContentPane().remove(comp);
-  }
-
-  void setDefaultCloseOperation(int operation)
-  {
-    close_action = operation;
   }
 
   protected boolean isRootPaneCheckingEnabled()
Index: kaffe/libraries/javalib/javax/swing/JInternalFrame.java
diff -u kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.6 kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.7
--- kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.6	Tue Dec 14 04:38:06 2004
+++ kaffe/libraries/javalib/javax/swing/JInternalFrame.java	Thu Dec 23 00:40:21 2004
@@ -1272,8 +1272,9 @@
    */
   public void setDefaultCloseOperation(int operation)
   {
-    if (operation != DO_NOTHING_ON_CLOSE || operation != HIDE_ON_CLOSE
-        || operation != DISPOSE_ON_CLOSE)
+    if (operation != DO_NOTHING_ON_CLOSE
+	&& operation != HIDE_ON_CLOSE
+        && operation != DISPOSE_ON_CLOSE)
       throw new Error("Close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
     defaultCloseOperation = operation;
   }
Index: kaffe/libraries/javalib/javax/swing/JWindow.java
diff -u kaffe/libraries/javalib/javax/swing/JWindow.java:1.3 kaffe/libraries/javalib/javax/swing/JWindow.java:1.4
--- kaffe/libraries/javalib/javax/swing/JWindow.java:1.3	Sun Oct 24 13:39:13 2004
+++ kaffe/libraries/javalib/javax/swing/JWindow.java	Thu Dec 23 00:40:21 2004
@@ -62,180 +62,125 @@
 {
   private static final long serialVersionUID = 5420698392125238833L;
   
-  public static final int HIDE_ON_CLOSE = 0;
-  public static final int EXIT_ON_CLOSE = 1;
-  public static final int DISPOSE_ON_CLOSE = 2;
-  public static final int DO_NOTHING_ON_CLOSE  = 3;
-
-    protected  AccessibleContext accessibleContext;
-
-    private int close_action = EXIT_ON_CLOSE;    
-    
-    
-    /***************************************************
-     *
-     *
-     *  constructors
-     *
-     *
-     *************/
-
-    public JWindow()
-    {      
-      super(SwingUtilities.getOwnerFrame());
-    }
-
-    // huuu ?
-    public JWindow(Frame f)
-    {
-	super(f);
-    }
-    
-    /***************************************************
-     *
-     *
-     *  methods, this part is shared with JDialog, JFrame
-     *
-     *
-     *************/
-
-  
-    private boolean checking;
-    protected  JRootPane         rootPane;
-
-    
-    protected  void frameInit()
-    {
-      super.setLayout(new BorderLayout(1, 1));
-      getRootPane(); // will do set/create
-    }
-  
+  protected AccessibleContext accessibleContext;
+
+  public JWindow()
+  {
+    super(SwingUtilities.getOwnerFrame());
+  }
+
+  public JWindow(Frame f)
+  {
+    super(f);
+  }
+
+  private boolean checking;
+  protected JRootPane rootPane;
+
+  protected void frameInit()
+  {
+    super.setLayout(new BorderLayout(1, 1));
+    getRootPane(); // will do set/create
+  }
+
   public Dimension getPreferredSize()
   {
-    Dimension d = super.getPreferredSize();
-    return d;
+    return super.getPreferredSize();
+  }
+
+  public void setLayout(LayoutManager manager)
+  {
+    super.setLayout(manager);
+  }
+
+  public void setLayeredPane(JLayeredPane layeredPane)
+  {
+    getRootPane().setLayeredPane(layeredPane);
+  }
+
+  public JLayeredPane getLayeredPane()
+  {
+    return getRootPane().getLayeredPane();
+  }
+
+  public JRootPane getRootPane()
+  {
+    if (rootPane == null)
+      setRootPane(createRootPane());
+    return rootPane;
+  }
+
+  public void setRootPane(JRootPane root)
+  {
+    if (rootPane != null)
+      remove(rootPane);
+
+    rootPane = root;
+    add(rootPane, BorderLayout.CENTER);
+  }
+
+  public JRootPane createRootPane()
+  {
+    return new JRootPane();
+  }
+
+  public Container getContentPane()
+  {
+    return getRootPane().getContentPane();
+  }
+
+  public void setContentPane(Container contentPane)
+  {
+    getRootPane().setContentPane(contentPane);
+  }
+
+  public Component getGlassPane()
+  {
+    return getRootPane().getGlassPane();
   }
 
-  public  void setLayout(LayoutManager manager)
-  {    super.setLayout(manager);  }
+  public void setGlassPane(Component glassPane)
+  {
+    getRootPane().setGlassPane(glassPane);
+  }
 
-    public void setLayeredPane(JLayeredPane layeredPane) 
-    {   getRootPane().setLayeredPane(layeredPane);   }
-  
-    public JLayeredPane getLayeredPane()
-    {   return getRootPane().getLayeredPane();     }
-  
-    public JRootPane getRootPane()
-    {
-	if (rootPane == null)
-	    setRootPane(createRootPane());
-	return rootPane;          
-    }
-
-    public void setRootPane(JRootPane root)
-    {
-	if (rootPane != null)
-	    remove(rootPane);
-	    
-	rootPane = root; 
-	add(rootPane, BorderLayout.CENTER);
-    }
-
-    public JRootPane createRootPane()
-    {   return new JRootPane();    }
-
-    public Container getContentPane()
-    {    return getRootPane().getContentPane();     }
-
-    public void setContentPane(Container contentPane)
-    {    getRootPane().setContentPane(contentPane);    }
-  
-    public Component getGlassPane()
-    {    return getRootPane().getGlassPane();   }
-  
-    public void setGlassPane(Component glassPane)
-    {   getRootPane().setGlassPane(glassPane);   }
-
-    
-    protected  void addImpl(Component comp, Object constraints, int index)
-    {	super.addImpl(comp, constraints, index);    }
-
-
-    public void remove(Component comp)
-    {   getContentPane().remove(comp);  }
-  
-    protected  boolean isRootPaneCheckingEnabled()
-    {    return checking;        }
-
-
-    protected  void setRootPaneCheckingEnabled(boolean enabled)
-    { checking = enabled;  }
-
-
-    public void update(Graphics g)
-    {   paint(g);  }
-
-    protected  void processKeyEvent(KeyEvent e)
-    {	super.processKeyEvent(e);    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-  
-    public AccessibleContext getAccessibleContext()
-    {    return null;  }
-  
-    int getDefaultCloseOperation()
-    {    return close_action;   }    
-    
-    protected  String paramString()
-    {   return "JWindow";     }
-
-
-    protected  void processWindowEvent(WindowEvent e)
-    {
-	//	System.out.println("PROCESS_WIN_EV-1: " + e);
-	super.processWindowEvent(e); 
-	//	System.out.println("PROCESS_WIN_EV-2: " + e);
-	switch (e.getID())
-	    {
-	    case WindowEvent.WINDOW_CLOSING:
-		{
-		    switch(close_action)
-			{
-			case EXIT_ON_CLOSE:
-			    {
-				System.out.println("user requested exit on close");
-				System.exit(1);
-				break;
-			    }
-			case DISPOSE_ON_CLOSE:
-			    {
-				System.out.println("user requested dispose on close");
-				dispose();
-				break;
-			    }
-			case HIDE_ON_CLOSE:
-			    {
-				setVisible(false);
-				break;
-			    }
-			case DO_NOTHING_ON_CLOSE:
-			    break;
-			}
-		    break;
-		}
-		
-	    case WindowEvent.WINDOW_CLOSED:
-	    case WindowEvent.WINDOW_OPENED:
-	    case WindowEvent.WINDOW_ICONIFIED:
-	    case WindowEvent.WINDOW_DEICONIFIED:
-	    case WindowEvent.WINDOW_ACTIVATED:
-	    case WindowEvent.WINDOW_DEACTIVATED:
-		break;
-	    }
-    }   
- 
+  protected void addImpl(Component comp, Object constraints, int index)
+  {
+    super.addImpl(comp, constraints, index);
+  }
 
-    void setDefaultCloseOperation(int operation)
-    {  close_action = operation;   }
+  public void remove(Component comp)
+  {
+    getContentPane().remove(comp);
+  }
 
+  protected boolean isRootPaneCheckingEnabled()
+  {
+    return checking;
+  }
+
+  protected void setRootPaneCheckingEnabled(boolean enabled)
+  {
+    checking = enabled;
+  }
+
+  public void update(Graphics g)
+  {
+    paint(g);
+  }
+
+  protected void processKeyEvent(KeyEvent e)
+  {
+    super.processKeyEvent(e);
+  }
+
+  public AccessibleContext getAccessibleContext()
+  {
+    return null;
+  }
+
+  protected String paramString()
+  {
+    return "JWindow";
+  }
 }




More information about the kaffe mailing list