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: Small swing public access violation fixes


Hi,

While importing the latest gui-branch-merge into GNU Classpath I noticed
a few small compile issues (with jikes).

2004-04-17  Mark Wielaard  <mark@klomp.org>
 
        * javax/swing/JToggleButton.java (ToggleButtonModel):
        Make public static inner class.
        * javax/swing/JTabbedPane.java (setComponentAt):
        Call Page.setComponent().
        (SCROLL_TAB_LAYOUT): Make public, value is 1.
        (WRAP_TAB_LAYOUT): Make public, value is 0.
        * javax/swing/plaf/basic/BasicTabbedPaneUI.java (ScrollingButton):
        Make private static inner class.

Committed to head. It should also go into the gui branch probably
(but I don't have that checked out, so someone else should do that).

Cheers,

Mark
Index: javax/swing/JToggleButton.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JToggleButton.java,v
retrieving revision 1.4
diff -u -r1.4 JToggleButton.java
--- javax/swing/JToggleButton.java	12 Feb 2004 00:17:23 -0000	1.4
+++ javax/swing/JToggleButton.java	17 Apr 2004 22:28:59 -0000
@@ -1,5 +1,5 @@
 /* JToggleButton.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -45,7 +45,7 @@
 public class JToggleButton extends AbstractButton implements Accessible
 {
 
-  public class ToggleButtonModel extends DefaultButtonModel
+  public static class ToggleButtonModel extends DefaultButtonModel
   {
     public void setPressed(boolean b)  
     {
Index: javax/swing/JTabbedPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JTabbedPane.java,v
retrieving revision 1.5
diff -u -r1.5 JTabbedPane.java
--- javax/swing/JTabbedPane.java	16 Apr 2004 18:44:44 -0000	1.5
+++ javax/swing/JTabbedPane.java	17 Apr 2004 22:28:59 -0000
@@ -544,10 +544,10 @@
   protected SingleSelectionModel model;
 
   /** Indicates that the TabbedPane is in scrolling mode. */
-  static int SCROLL_TAB_LAYOUT = 0;
+  public static int SCROLL_TAB_LAYOUT = 1;
 
   /** Indicates that the TabbedPane is in wrap mode. */
-  static int WRAP_TAB_LAYOUT = 1;
+  public static int WRAP_TAB_LAYOUT = 0;
 
   /** The current tabPlacement of the TabbedPane. */
   protected int tabPlacement = SwingConstants.TOP;
@@ -1338,7 +1338,7 @@
   public void setComponentAt(int index, Component component)
   {
     checkIndex(index, 0, tabs.size());
-    ((Page) tabs.elementAt(index)).setEnabled(enabled);
+    ((Page) tabs.elementAt(index)).setComponent(component);
   }
 
   /**
Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.4
diff -u -r1.4 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java	16 Apr 2004 18:44:38 -0000	1.4
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java	17 Apr 2004 22:28:59 -0000
@@ -1191,7 +1191,8 @@
    * This is a helper class that implements UIResource so it is not added as a
    * tab when an object of this class is added to the JTabbedPane.
    */
-  private class ScrollingButton extends BasicArrowButton implements UIResource
+  private static class ScrollingButton extends BasicArrowButton
+    implements UIResource
   {
     /**
      * Creates a ScrollingButton given the direction.

Attachment: signature.asc
Description: This is a digitally signed message part


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