< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java

Print this page




  24  */
  25 
  26 package javax.swing.plaf.metal;
  27 
  28 import javax.swing.*;
  29 
  30 import java.awt.*;
  31 import java.awt.event.*;
  32 import java.io.*;
  33 import javax.swing.plaf.*;
  34 
  35 /**
  36  * CheckboxIcon implementation for OrganicCheckBoxUI
  37  * <p>
  38  * <strong>Warning:</strong>
  39  * Serialized objects of this class will not be compatible with
  40  * future Swing releases. The current serialization support is
  41  * appropriate for short term storage or RMI between applications running
  42  * the same version of Swing.  As of 1.4, support for long term storage
  43  * of all JavaBeans&trade;
  44  * has been added to the <code>java.beans</code> package.
  45  * Please see {@link java.beans.XMLEncoder}.
  46  *
  47  * @author Steve Wilson
  48  */
  49 @SuppressWarnings("serial") // Same-version serialization only
  50 public class MetalCheckBoxIcon implements Icon, UIResource, Serializable {
  51 
  52     /**
  53      * Returns the size of the control.
  54      *
  55      * @return the size of the control
  56      */
  57     protected int getControlSize() { return 13; }
  58 
  59     public void paintIcon(Component c, Graphics g, int x, int y) {
  60 
  61         JCheckBox cb = (JCheckBox)c;
  62         ButtonModel model = cb.getModel();
  63         int controlSize = getControlSize();
  64 




  24  */
  25 
  26 package javax.swing.plaf.metal;
  27 
  28 import javax.swing.*;
  29 
  30 import java.awt.*;
  31 import java.awt.event.*;
  32 import java.io.*;
  33 import javax.swing.plaf.*;
  34 
  35 /**
  36  * CheckboxIcon implementation for OrganicCheckBoxUI
  37  * <p>
  38  * <strong>Warning:</strong>
  39  * Serialized objects of this class will not be compatible with
  40  * future Swing releases. The current serialization support is
  41  * appropriate for short term storage or RMI between applications running
  42  * the same version of Swing.  As of 1.4, support for long term storage
  43  * of all JavaBeans&trade;
  44  * has been added to the {@code java.beans} package.
  45  * Please see {@link java.beans.XMLEncoder}.
  46  *
  47  * @author Steve Wilson
  48  */
  49 @SuppressWarnings("serial") // Same-version serialization only
  50 public class MetalCheckBoxIcon implements Icon, UIResource, Serializable {
  51 
  52     /**
  53      * Returns the size of the control.
  54      *
  55      * @return the size of the control
  56      */
  57     protected int getControlSize() { return 13; }
  58 
  59     public void paintIcon(Component c, Graphics g, int x, int y) {
  60 
  61         JCheckBox cb = (JCheckBox)c;
  62         ButtonModel model = cb.getModel();
  63         int controlSize = getControlSize();
  64 


< prev index next >