Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.plaf.basic
Class BasicBorders.RadioButtonBorder  view BasicBorders.RadioButtonBorder download BasicBorders.RadioButtonBorder.java

java.lang.Object
  extended byjavax.swing.border.AbstractBorder
      extended byjavax.swing.plaf.basic.BasicBorders.ButtonBorder
          extended byjavax.swing.plaf.basic.BasicBorders.RadioButtonBorder
All Implemented Interfaces:
javax.swing.border.Border, java.io.Serializable, javax.swing.plaf.UIResource
Enclosing class:
BasicBorders

public static class BasicBorders.RadioButtonBorder
extends BasicBorders.ButtonBorder

A border for drawing radio buttons in the Basic look and feel.

[A screen shot of this border]

Note about the screen shot: Normally, the borderPainted property is false for JRadioButtons. For this screen shot, it has been set to true so the borders get drawn. Also, a concretization of the Basic look and would typically provide icons for the various states of radio buttons.

Note that the focus rectangle is invisible If the radio button is currently selected. While it might be debatable whether this makes a lot of sense, this behavior can be observed in the Sun reference implementation (in JDK 1.3.1 and 1.4.1). The Classpath implementation tries to exactly replicate the JDK appearance.


Field Summary
(package private) static long serialVersionUID
          Determined using the serialver tool of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
 
Fields inherited from class javax.swing.plaf.basic.BasicBorders.ButtonBorder
darkShadow, highlight, lightHighlight, shadow
 
Constructor Summary
BasicBorders.RadioButtonBorder(java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
          Constructs a new border for drawing a JRadioButton in the Basic look and feel.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Measures the width of this border.
 java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
          Measures the width of this border, storing the results into a pre-existing Insets object.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the RadioButtonBorder around a given component.
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Determined using the serialver tool of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.

See Also:
Constant Field Values
Constructor Detail

BasicBorders.RadioButtonBorder

public BasicBorders.RadioButtonBorder(java.awt.Color shadow,
                                      java.awt.Color darkShadow,
                                      java.awt.Color highlight,
                                      java.awt.Color lightHighlight)
Constructs a new border for drawing a JRadioButton in the Basic look and feel.

Method Detail

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the RadioButtonBorder around a given component.

The Sun implementation always seems to draw exactly the same border, irrespective of the state of the button. This is rather surprising, but GNU Classpath emulates the observable behavior.

Specified by:
paintBorder in interface javax.swing.border.Border
Overrides:
paintBorder in class BasicBorders.ButtonBorder

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Measures the width of this border.

Specified by:
getBorderInsets in interface javax.swing.border.Border
Overrides:
getBorderInsets in class BasicBorders.ButtonBorder

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c,
                                       java.awt.Insets insets)
Measures the width of this border, storing the results into a pre-existing Insets object.

Overrides:
getBorderInsets in class BasicBorders.ButtonBorder