home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / plaf / basic / BasicRootPaneUI$DefaultAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  960 b   |  39 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.AbstractButton;
  6. import javax.swing.ButtonModel;
  7. import javax.swing.JButton;
  8. import javax.swing.JRootPane;
  9. import javax.swing.SwingUtilities;
  10.  
  11. class BasicRootPaneUI$DefaultAction extends AbstractAction {
  12.    JRootPane root;
  13.    boolean press;
  14.  
  15.    BasicRootPaneUI$DefaultAction(JRootPane var1, boolean var2) {
  16.       this.root = var1;
  17.       this.press = var2;
  18.    }
  19.  
  20.    public void actionPerformed(ActionEvent var1) {
  21.       JButton var2 = this.root.getDefaultButton();
  22.       if (var2 != null && SwingUtilities.getRootPane(var2) == this.root) {
  23.          ButtonModel var3 = ((AbstractButton)var2).getModel();
  24.          if (this.press) {
  25.             var3.setArmed(true);
  26.             var3.setPressed(true);
  27.          } else {
  28.             var3.setPressed(false);
  29.          }
  30.       }
  31.  
  32.    }
  33.  
  34.    public boolean isEnabled() {
  35.       JButton var1 = this.root.getDefaultButton();
  36.       return var1 != null && ((AbstractButton)var1).getModel().isEnabled();
  37.    }
  38. }
  39.