src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java

Print this page




 332 
 333            return insets;
 334         }
 335     }
 336 
 337     @SuppressWarnings("serial") // Superclass is not serializable across versions
 338     private class XPStatefulFillBorder extends XPFillBorder {
 339         private final Part part;
 340         private final Prop prop;
 341         XPStatefulFillBorder(Color color, int thickness, Part part, Prop prop) {
 342             super(color, thickness);
 343             this.part = part;
 344             this.prop = prop;
 345         }
 346 
 347         public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
 348             State state = State.NORMAL;
 349             // special casing for comboboxes.
 350             // there may be more special cases in the future
 351             if(c instanceof JComboBox) {
 352                 JComboBox cb = (JComboBox)c;
 353                 // note. in the future this should be replaced with a call
 354                 // to BasicLookAndFeel.getUIOfType()
 355                 if(cb.getUI() instanceof WindowsComboBoxUI) {
 356                     WindowsComboBoxUI wcb = (WindowsComboBoxUI)cb.getUI();
 357                     state = wcb.getXPComboBoxState(cb);
 358                 }
 359             }
 360             lineColor = getColor(c, part, state, prop, Color.black);
 361             super.paintBorder(c, g, x, y, width, height);
 362         }
 363     }
 364 
 365     @SuppressWarnings("serial") // Superclass is not serializable across versions
 366     private class XPImageBorder extends AbstractBorder implements UIResource {
 367         Skin skin;
 368 
 369         XPImageBorder(Component c, Part part) {
 370             this.skin = getSkin(c, part);
 371         }
 372 




 332 
 333            return insets;
 334         }
 335     }
 336 
 337     @SuppressWarnings("serial") // Superclass is not serializable across versions
 338     private class XPStatefulFillBorder extends XPFillBorder {
 339         private final Part part;
 340         private final Prop prop;
 341         XPStatefulFillBorder(Color color, int thickness, Part part, Prop prop) {
 342             super(color, thickness);
 343             this.part = part;
 344             this.prop = prop;
 345         }
 346 
 347         public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
 348             State state = State.NORMAL;
 349             // special casing for comboboxes.
 350             // there may be more special cases in the future
 351             if(c instanceof JComboBox) {
 352                 JComboBox<?> cb = (JComboBox)c;
 353                 // note. in the future this should be replaced with a call
 354                 // to BasicLookAndFeel.getUIOfType()
 355                 if(cb.getUI() instanceof WindowsComboBoxUI) {
 356                     WindowsComboBoxUI wcb = (WindowsComboBoxUI)cb.getUI();
 357                     state = wcb.getXPComboBoxState(cb);
 358                 }
 359             }
 360             lineColor = getColor(c, part, state, prop, Color.black);
 361             super.paintBorder(c, g, x, y, width, height);
 362         }
 363     }
 364 
 365     @SuppressWarnings("serial") // Superclass is not serializable across versions
 366     private class XPImageBorder extends AbstractBorder implements UIResource {
 367         Skin skin;
 368 
 369         XPImageBorder(Component c, Part part) {
 370             this.skin = getSkin(c, part);
 371         }
 372