1  /**
     2   * @author firdosh
     3   */
     4   
     5   import org.aswing.*;
     6  import org.aswing.geom.*;
     7  import org.aswing.border.*;
     8  import org.aswing.graphices.*;
     9  import org.aswing.plaf.*;
    10   
    11  class org.aswing.plaf.winxp.border.CheckBoxBorder implements Border, UIResource{
    12  	
    13  	 private var darkShadow:ASColor;
    14      private var highlight:ASColor;	
    15  	
    16  	private static var winxpInstance:CheckBoxBorder;
    17  	/**
    18  	 * this make shared instance and construct when use.
    19  	 */	
    20  	public static function createInstance():CheckBoxBorder{
    21  		if(winxpInstance == null){
    22  			winxpInstance = new CheckBoxBorder();
    23  		}
    24  		return winxpInstance;
    25  	}
    26  	
    27  	private function CheckBoxBorder(){
    28  		var table:UIDefaults = UIManager.getLookAndFeelDefaults();		
    29  		this.darkShadow = table.getColor("Button.darkShadow");
    30  		this.highlight = table.getColor("Button.highlight");		
    31  	}
    32  	
    33  	public function paintBorder(c:Component, g:Graphics, bounds:Rectangle):Void{
    34      	
    35      	var x1:Number = bounds.x;
    36  		var y1:Number = bounds.y;
    37  		var x2:Number = x1 + bounds.width;
    38  		var y2:Number = y1 + bounds.height;
    39      	
    40      	var brush:SolidBrush=new SolidBrush(highlight);
    41  		g.fillRectangle(brush,x1, y1, x2, y2);		
    42  	   
    43      	var isPressed:Boolean = false;
    44  		if(c instanceof AbstractButton){
    45  			isPressed = (AbstractButton(c)).getModel().isPressed();
    46  		}
    47  		
    48  		if(isPressed){
    49  				
    50  		}
    51  		
    52          
    53      }
    54  	
    55  	public function getBorderInsets(c:Component, bounds:Rectangle):Insets{
    56      	return new Insets(1, 1, 1, 1);
    57      }
    58      
    59      public function uninstallBorder(c:Component):Void{
    60      }
    61  }