This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: javax.swing


Hi list,


I commited the attached patch to libgcj trunk and classpath to fix some 
javax.swing issues.


Michael


2004-02-05  Michael Koch  <konqueror@gmx.de>

	* javax/swing/AbstractCellEditor.java
	(getCellEditorValue): Removed.
	* javax/swing/Box.java: Reformated.
	(serialVersionUID): New field.
	* javax/swing/ButtonGroup.java:
	Removed some weird whitespace.
	* javax/swing/CellEditor.java: Reformated.
	* javax/swing/CellRendererPane.java
	(serialVersionUID): New field.
	(AccessibleCellRendererPaneserialVersionUID): New field.
	* javax/swing/DefaultListModel.java
	(serialVersionUID): New field.
	* javax/swing/JEditorPane.java
	(serialVersionUID): New field.
	(setPage): Throws IOException.
	(addHyperlinkListener): Implemented.
	(removeHyperlinkListener): Implemented.
	(getHyperlinkListener): New method.
	* javax/swing/JFileChooser.java
	(serialVersionUID): New field.
	(AccessibleJFileChooser.serialVersionUID): New field.
	(addActionListener): Implemented.
	(removeActionListener): Implemented.
	(getActionListeners): New method.
	* javax/swing/JFormattedTextField.java
	(serialVersionUID): New field.
	(AbstractFormatter.serialVersionUID): New field.
	(clone): Throws CloneNotSupportedException
	(setEditValid): Add missing argument.
	(stringToValue): Throws ParseExcpetion.
	(valueToString): Throws ParseException.
	(commitEdit): Throws ParseException.
	* javax/swing/JLabel.java
	(serialVersionUID): New field.
	* javax/swing/JList.java
	(serialVersionUID): New field.
	(addListSelectionListener): Reformated.
	(removeListSelectionListener): Reformated.
	(getListSelectionListeners): New method.
	* javax/swing/colorchooser/AbstractColorChooserPanel.java:
	Reformated.
	(serialVersionUID): New field.
	* javax/swing/table/AbstractTableModel.java
	(getValueAt): Removed.
	(getColumnCount): Removed.
	(getRowCount): Removed.

Index: javax/swing/AbstractCellEditor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/AbstractCellEditor.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 AbstractCellEditor.java
--- javax/swing/AbstractCellEditor.java	27 Jan 2004 18:55:11 -0000	1.5
+++ javax/swing/AbstractCellEditor.java	5 Feb 2004 18:48:27 -0000
@@ -104,12 +104,6 @@
 		// TODO
 	} // cancelCellEditing()
 
-	/**
-	 * getCellEditorValue
-	 * @returns Object
-	 */
-	public abstract Object getCellEditorValue();
-
   /**
    * addCellEditorListener
    *
Index: javax/swing/Box.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/Box.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 Box.java
--- javax/swing/Box.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/Box.java	5 Feb 2004 18:48:27 -0000
@@ -47,9 +47,10 @@
  */
 public class Box extends JComponent implements Accessible
 {
-    Box(int a)
+  private static final long serialVersionUID = 1525417495883046342L;
+  
+  public Box(int a)
     {
-        setLayout(new BoxLayout(this, 
-				a));	
+    setLayout(new BoxLayout(this, a));	
     }
 }
Index: javax/swing/ButtonGroup.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/ButtonGroup.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 ButtonGroup.java
Index: javax/swing/CellEditor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/CellEditor.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 CellEditor.java
--- javax/swing/CellEditor.java	9 Jan 2004 10:18:47 -0000	1.3
+++ javax/swing/CellEditor.java	5 Feb 2004 18:48:27 -0000
@@ -45,12 +45,8 @@
  * @author	Andrew Selkirk
  * @version	1.0
  */
-public interface CellEditor {
-
-	//-------------------------------------------------------------
-	// Methods ----------------------------------------------------
-	//-------------------------------------------------------------
-
+public interface CellEditor
+{
 	/**
 	 * getCellEditorValue
 	 * @returns Object
Index: javax/swing/CellRendererPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/CellRendererPane.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 CellRendererPane.java
--- javax/swing/CellRendererPane.java	9 Jan 2004 10:18:47 -0000	1.2
+++ javax/swing/CellRendererPane.java	5 Feb 2004 18:48:27 -0000
@@ -52,7 +52,9 @@
  * @author	Andrew Selkirk
  * @version	1.0
  */
-public class CellRendererPane extends Container implements Accessible {
+public class CellRendererPane extends Container implements Accessible
+{
+  private static final long serialVersionUID = -7642183829532984273L;
 
 	//-------------------------------------------------------------
 	// Classes ----------------------------------------------------
@@ -62,6 +64,8 @@
 	 * AccessibleCellRendererPane
 	 */
 	protected class AccessibleCellRendererPane extends AccessibleAWTContainer {
+
+          private static final long serialVersionUID = 7300340301783504481L;
 
 		//-------------------------------------------------------------
 		// Initialization ---------------------------------------------
Index: javax/swing/DefaultListModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/DefaultListModel.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 DefaultListModel.java
--- javax/swing/DefaultListModel.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/DefaultListModel.java	5 Feb 2004 18:48:28 -0000
@@ -50,6 +50,7 @@
  */
 public class DefaultListModel extends AbstractListModel
 {
+  private static final long serialVersionUID = 2315945659722172272L;
 
 	//-------------------------------------------------------------
 	// Variables --------------------------------------------------
Index: javax/swing/JEditorPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JEditorPane.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 JEditorPane.java
--- javax/swing/JEditorPane.java	28 Jan 2004 19:37:59 -0000	1.3
+++ javax/swing/JEditorPane.java	5 Feb 2004 18:48:28 -0000
@@ -52,6 +52,8 @@
 
 public class JEditorPane extends JTextComponent
 {
+  private static final long serialVersionUID = 3140472492599046285L;
+
     URL page_url;
     EditorKit kit;
     String ctype = "text/plain";
@@ -82,9 +84,6 @@
 	setPage(url);
     }
 
-    void addHyperlinkListener(HyperlinkListener listener)
-    {  }
-    
     protected  EditorKit createDefaultEditorKit()
     {	return new PlainEditorKit();    }
     
@@ -174,11 +173,6 @@
 	//Establishes the default bindings of type to classname.  
     }
     
-    void removeHyperlinkListener(HyperlinkListener listener)
-    {
-	//Removes a hyperlink listener.  
-    }
-    
     void replaceSelection(String content)
     {
 	//Replaces the currently selected content with new content represented by the given string. 
@@ -210,11 +204,13 @@
     }
   
   void setPage(String url)
+    throws IOException
     {
 	//  Sets the current URL being displayed.  
     }
     
     void setPage(URL page)
+    throws IOException
     {
 	//    Sets the current URL being displayed.  
     }
@@ -223,4 +219,23 @@
     {	
 	super.setText(t);
     }
+
+  public void addHyperlinkListener(HyperlinkListener listener)
+  {
+    listenerList.add (HyperlinkListener.class, listener);
+  }
+    
+  public void removeHyperlinkListener (HyperlinkListener listener)
+  {
+    listenerList.remove (HyperlinkListener.class, listener);
+  }
+
+  /**
+   * @since 1.4
+   */
+  public HyperlinkListener[] getHyperlinkListeners()
+  {
+    return (HyperlinkListener[]) getListeners (HyperlinkListener.class);
+  }
+    
 } // class JEditorPane
Index: javax/swing/JFileChooser.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JFileChooser.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 JFileChooser.java
--- javax/swing/JFileChooser.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/JFileChooser.java	5 Feb 2004 18:48:28 -0000
@@ -59,6 +59,8 @@
  */
 public class JFileChooser extends JComponent implements Accessible {
 
+  private static final long serialVersionUID = 3162921138695327837L;
+
 	//-------------------------------------------------------------
 	// Classes ----------------------------------------------------
 	//-------------------------------------------------------------
@@ -68,6 +70,8 @@
 	 */
 	protected class AccessibleJFileChooser extends AccessibleJComponent {
 
+          private static final long serialVersionUID = 3318922050345221200L;
+
 		//-------------------------------------------------------------
 		// Variables --------------------------------------------------
 		//-------------------------------------------------------------
@@ -906,17 +910,24 @@
 	 * addActionListener
 	 * @param listener TODO
 	 */
-	public void addActionListener(ActionListener listener) {
-		// TODO
-	} // addActionListener()
+	public void addActionListener(ActionListener listener)
+	{
+		listenerList.add (ActionListener.class, listener);
+	}
 
 	/**
 	 * removeActionListener
 	 * @param listener TODO
 	 */
-	public void removeActionListener(ActionListener listener) {
-		// TODO
-	} // removeActionListener()
+	public void removeActionListener(ActionListener listener)
+	{
+		listenerList.remove (ActionListener.class, listener);
+	}
+
+	public ActionListener[] getActionListeners()
+	{
+		return (ActionListener[]) listenerList.getListeners (ActionListener.class);
+	}
 
 	/**
 	 * fireActionPerformed
Index: javax/swing/JFormattedTextField.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JFormattedTextField.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 JFormattedTextField.java
--- javax/swing/JFormattedTextField.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/JFormattedTextField.java	5 Feb 2004 18:48:28 -0000
@@ -52,14 +52,19 @@
  */
 public class JFormattedTextField extends JTextField
 {
+  private static final long serialVersionUID = 2889768923115424035L;
+
   public abstract static class AbstractFormatter implements Serializable
   {
+    private static final long serialVersionUID = -5193212041738979680L;
+    
     public AbstractFormatter ()
     {
       //Do nothing here.
     }
 
     protected Object clone ()
+      throws CloneNotSupportedException
     {
       throw new InternalError ("not implemented");
     }
@@ -99,14 +104,16 @@
       throw new InternalError ("not implemented");
     }
 
-    protected void setEditValid ()
+    protected void setEditValid (boolean valid)
     {
       throw new InternalError ("not implemented");
     }
 
-    public abstract Object stringToValue (String text);
+    public abstract Object stringToValue (String text)
+      throws ParseException;
 
-    public abstract String valueToString (Object value);
+    public abstract String valueToString (Object value)
+      throws ParseException;
   }
   
   public abstract static class AbstractFormatterFactory
@@ -155,6 +162,7 @@
   }
 
   public void commitEdit ()
+    throws ParseException
   {
     throw new InternalError ("not implemented");
   }
Index: javax/swing/JLabel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JLabel.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 JLabel.java
--- javax/swing/JLabel.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/JLabel.java	5 Feb 2004 18:48:28 -0000
@@ -46,6 +46,8 @@
 
 public class JLabel extends JComponent implements Accessible, SwingConstants
 {
+  private static final long serialVersionUID = 5496508283662221534L;
+  
     String text;
     Icon icon;
     int gap;
Index: javax/swing/JList.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JList.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 JList.java
--- javax/swing/JList.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/JList.java	5 Feb 2004 18:48:28 -0000
@@ -51,6 +51,8 @@
 
 public class JList extends JComponent implements Accessible, Scrollable
 {
+  private static final long serialVersionUID = 4406629526391098046L;
+
     Color select_back, select_fore;
     ListCellRenderer render;
     int visibles = 8;
@@ -105,10 +107,23 @@
 	repaint();
     }
 
-    void addListSelectionListener(ListSelectionListener listener)
-    { sel_model.addListSelectionListener(listener);    }
-    void removeListSelectionListener(ListSelectionListener listener)
-    { sel_model.removeListSelectionListener(listener);    }
+  public void addListSelectionListener (ListSelectionListener listener)
+  {
+    sel_model.addListSelectionListener (listener);
+  }
+  
+  public void removeListSelectionListener (ListSelectionListener listener)
+  {
+    sel_model.removeListSelectionListener (listener);
+  }
+
+  /**
+   * @since 1.4
+   */
+  public ListSelectionListener[] getListSelectionListeners()
+  {
+    throw new Error ("not implemented");
+  }
 
     void setSelectionMode(int a)
     {  sel_model.setSelectionMode(a);   }
Index: javax/swing/colorchooser/AbstractColorChooserPanel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/colorchooser/AbstractColorChooserPanel.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 AbstractColorChooserPanel.java
--- javax/swing/colorchooser/AbstractColorChooserPanel.java	11 Jun 2003 13:20:40 -0000	1.2
+++ javax/swing/colorchooser/AbstractColorChooserPanel.java	5 Feb 2004 18:48:28 -0000
@@ -49,22 +49,15 @@
  * @author	Andrew Selkirk
  * @version	1.0
  */
-public abstract class AbstractColorChooserPanel extends JPanel {
-
-	//-------------------------------------------------------------
-	// Variables --------------------------------------------------
-	//-------------------------------------------------------------
+public abstract class AbstractColorChooserPanel extends JPanel
+{
+  private static final long serialVersionUID = -977469671210173863L;
 
 	/**
 	 * chooser
 	 */
 	private JColorChooser chooser;
 
-
-	//-------------------------------------------------------------
-	// Initialization ---------------------------------------------
-	//-------------------------------------------------------------
-
 	/**
 	 * Constructor AbstractColorChooserPanel
 	 */
@@ -72,11 +65,6 @@
 		// TODO
 	} // AbstractColorChooserPanel()
 
-
-	//-------------------------------------------------------------
-	// Methods ----------------------------------------------------
-	//-------------------------------------------------------------
-
 	/**
 	 * getDisplayName
 	 * @returns String
Index: javax/swing/table/AbstractTableModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/table/AbstractTableModel.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 AbstractTableModel.java
--- javax/swing/table/AbstractTableModel.java	8 Oct 2003 15:29:52 -0000	1.5
+++ javax/swing/table/AbstractTableModel.java	5 Feb 2004 18:48:28 -0000
@@ -271,25 +270,4 @@
   {
     return listenerList.getListeners (listenerType);
   }
-
-  /**
-   * getValueAt
-   * @param value0 TODO
-   * @param value1 TODO
-   * @return Object
-   */
-  public abstract Object getValueAt (int row, int column);
-
-  /**
-   * getColumnCount
-   * @return int
-   */
-  public abstract int getColumnCount();
-
-  /**
-   * getRowCount
-   * @return int
-   */
-  public abstract int getRowCount();
-
-} // AbstractTableModel
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]