/[classpath]/classpath/javax/swing/JMenuItem.java
ViewVC logotype

Diff of /classpath/javax/swing/JMenuItem.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10.2.6 by gnu_andrew, Tue Aug 2 20:12:37 2005 UTC revision 1.10.2.7 by gnu_andrew, Wed Nov 2 00:43:46 2005 UTC
# Line 44  import java.awt.event.KeyEvent; Line 44  import java.awt.event.KeyEvent;
44  import java.awt.event.MouseEvent;  import java.awt.event.MouseEvent;
45  import java.beans.PropertyChangeEvent;  import java.beans.PropertyChangeEvent;
46  import java.beans.PropertyChangeListener;  import java.beans.PropertyChangeListener;
 import java.io.IOException;  
 import java.io.ObjectInputStream;  
 import java.io.ObjectOutputStream;  
47  import java.util.EventListener;  import java.util.EventListener;
48    
49  import javax.accessibility.Accessible;  import javax.accessibility.Accessible;
# Line 84  public class JMenuItem extends AbstractB Line 81  public class JMenuItem extends AbstractB
81    public JMenuItem()    public JMenuItem()
82    {    {
83      super();      super();
84        init(null, null);
85    }    }
86    
87    /**    /**
# Line 118  public class JMenuItem extends AbstractB Line 116  public class JMenuItem extends AbstractB
116    {    {
117      super();      super();
118      super.setAction(action);      super.setAction(action);
119        init(null, null);
120    }    }
121    
122    /**    /**
# Line 147  public class JMenuItem extends AbstractB Line 146  public class JMenuItem extends AbstractB
146      setMnemonic(mnemonic);      setMnemonic(mnemonic);
147    }    }
148    
   private void readObject(ObjectInputStream stream)  
                    throws IOException, ClassNotFoundException  
   {  
   }  
   
   private void writeObject(ObjectOutputStream stream) throws IOException  
   {  
   }  
   
149    /**    /**
150     * Initializes this menu item     * Initializes this menu item
151     *     *
# Line 176  public class JMenuItem extends AbstractB Line 166  public class JMenuItem extends AbstractB
166      //borderPainted = false;      //borderPainted = false;
167      focusPainted = false;      focusPainted = false;
168      horizontalAlignment = JButton.LEFT;      horizontalAlignment = JButton.LEFT;
169      horizontalTextPosition = JButton.LEFT;      horizontalTextPosition = JButton.TRAILING;
170    }    }
171    
172    /**    /**
# Line 189  public class JMenuItem extends AbstractB Line 179  public class JMenuItem extends AbstractB
179    {    {
180      super.setUI(ui);      super.setUI(ui);
181    }    }
182      
183    /**    /**
184     * This method sets this menuItem's UI to the UIManager's default for the     * This method sets this menuItem's UI to the UIManager's default for the
185     * current look and feel.     * current look and feel.
# Line 255  public class JMenuItem extends AbstractB Line 245  public class JMenuItem extends AbstractB
245    }    }
246    
247    /**    /**
248     * Sets accelerator for this menu item.     * Sets the key combination which invokes the menu item's action
249     *     * listeners without navigating the menu hierarchy. Note that when the
250       * keyboard accelerator is typed, it will work whether or not the
251       * menu is currently displayed.
252       *
253     * @param keystroke accelerator for this menu item.     * @param keystroke accelerator for this menu item.
254     */     */
255    public void setAccelerator(KeyStroke keystroke)    public void setAccelerator(KeyStroke keystroke)
# Line 276  public class JMenuItem extends AbstractB Line 269  public class JMenuItem extends AbstractB
269      super.configurePropertiesFromAction(action);      super.configurePropertiesFromAction(action);
270    
271      if (! (this instanceof JMenu) && action != null)      if (! (this instanceof JMenu) && action != null)
272        setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));        {
273            setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));
274            super.registerKeyboardAction(action, accelerator,
275                                         JComponent.WHEN_IN_FOCUSED_WINDOW);
276          }
277    }    }
278    
279    /**    /**
# Line 667  public class JMenuItem extends AbstractB Line 664  public class JMenuItem extends AbstractB
664    
665      public void stateChanged(ChangeEvent event)      public void stateChanged(ChangeEvent event)
666      {      {
667          // TODO: What should be done here, if anything?
668      }      }
669    
670      public AccessibleRole getAccessibleRole()      public AccessibleRole getAccessibleRole()

Legend:
Removed from v.1.10.2.6  
changed lines
  Added in v.1.10.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26