home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / JCheckBox.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.8 KB  |  106 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.beans.PropertyChangeListener;
  5. import java.io.IOException;
  6. import java.io.ObjectInputStream;
  7. import javax.accessibility.Accessible;
  8. import javax.accessibility.AccessibleContext;
  9. import javax.swing.plaf.ButtonUI;
  10.  
  11. public class JCheckBox extends JToggleButton implements Accessible {
  12.    public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = "borderPaintedFlat";
  13.    private boolean flat;
  14.    private static final String uiClassID = "CheckBoxUI";
  15.  
  16.    public JCheckBox() {
  17.       this((String)null, (Icon)null, false);
  18.    }
  19.  
  20.    public JCheckBox(Icon var1) {
  21.       this((String)null, var1, false);
  22.    }
  23.  
  24.    public JCheckBox(Icon var1, boolean var2) {
  25.       this((String)null, var1, var2);
  26.    }
  27.  
  28.    public JCheckBox(String var1) {
  29.       this(var1, (Icon)null, false);
  30.    }
  31.  
  32.    public JCheckBox(Action var1) {
  33.       this();
  34.       ((AbstractButton)this).setAction(var1);
  35.    }
  36.  
  37.    public JCheckBox(String var1, boolean var2) {
  38.       this(var1, (Icon)null, var2);
  39.    }
  40.  
  41.    public JCheckBox(String var1, Icon var2) {
  42.       this(var1, var2, false);
  43.    }
  44.  
  45.    public JCheckBox(String var1, Icon var2, boolean var3) {
  46.       super(var1, var2, var3);
  47.       this.flat = false;
  48.       ((AbstractButton)this).setBorderPainted(false);
  49.       ((AbstractButton)this).setHorizontalAlignment(2);
  50.    }
  51.  
  52.    public void setBorderPaintedFlat(boolean var1) {
  53.       this.flat = var1;
  54.       boolean var2 = this.flat;
  55.       this.flat = var1;
  56.       ((JComponent)this).firePropertyChange("borderPaintedFlat", var2, this.flat);
  57.       if (var1 != var2) {
  58.          ((JComponent)this).revalidate();
  59.          ((Component)this).repaint();
  60.       }
  61.  
  62.    }
  63.  
  64.    public boolean isBorderPaintedFlat() {
  65.       return this.flat;
  66.    }
  67.  
  68.    public void updateUI() {
  69.       ((AbstractButton)this).setUI((ButtonUI)UIManager.getUI(this));
  70.    }
  71.  
  72.    public String getUIClassID() {
  73.       return "CheckBoxUI";
  74.    }
  75.  
  76.    protected void configurePropertiesFromAction(Action var1) {
  77.       ((AbstractButton)this).setText(var1 != null ? (String)var1.getValue("Name") : null);
  78.       ((AbstractButton)this).setEnabled(var1 != null ? var1.isEnabled() : true);
  79.       ((JComponent)this).setToolTipText(var1 != null ? (String)var1.getValue("ShortDescription") : null);
  80.    }
  81.  
  82.    protected PropertyChangeListener createActionPropertyChangeListener(Action var1) {
  83.       return new 1(this, this, var1);
  84.    }
  85.  
  86.    private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
  87.       var1.defaultReadObject();
  88.       if (this.getUIClassID().equals("CheckBoxUI")) {
  89.          this.updateUI();
  90.       }
  91.  
  92.    }
  93.  
  94.    protected String paramString() {
  95.       return super.paramString();
  96.    }
  97.  
  98.    public AccessibleContext getAccessibleContext() {
  99.       if (super.accessibleContext == null) {
  100.          super.accessibleContext = new AccessibleJCheckBox(this);
  101.       }
  102.  
  103.       return super.accessibleContext;
  104.    }
  105. }
  106.