1 7 8 package com.sun.java.swing.plaf.motif; 9 10 import javax.swing.*; 11 import javax.swing.border.*; 12 import javax.swing.plaf.basic.BasicRadioButtonUI ; 13 14 import javax.swing.plaf.*; 15 16 import java.awt.*; 17 18 31 public class MotifRadioButtonUI extends BasicRadioButtonUI { 32 33 private static final MotifRadioButtonUI motifRadioButtonUI = new MotifRadioButtonUI(); 34 35 protected Color focusColor; 36 37 private boolean defaults_initialized = false; 38 39 public static ComponentUI createUI(JComponent c) { 43 return motifRadioButtonUI; 44 } 45 46 public void installDefaults(AbstractButton b) { 50 super.installDefaults(b); 51 if(!defaults_initialized) { 52 focusColor = UIManager.getColor(getPropertyPrefix() + "focus"); 53 defaults_initialized = true; 54 } 55 } 56 57 protected void uninstallDefaults(AbstractButton b) { 58 super.uninstallDefaults(b); 59 defaults_initialized = false; 60 } 61 62 66 protected Color getFocusColor() { 67 return focusColor; 68 } 69 70 protected void paintFocus(Graphics g, Rectangle t, Dimension d){ 74 g.setColor(getFocusColor()); 75 g.drawRect(0,0,d.width-1,d.height-1); 76 } 77 78 } 79 | Popular Tags |