home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JCheckBox.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.8 KB  |  110 lines

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