代码
    public class CollapsedFolderIcon implements Icon, UIResource{
        
private var iconImg:DisplayObject;
        
public function CollapsedFolderIcon(){
            iconImg 
= SystemImages.getJiahao2();
        }
        
        
public function getIconWidth(c:Component) : int {
            
return iconImg.width;
        }
        
        
public function getIconHeight(c:Component) : int {
            
return iconImg.height;
        }
        
        
public function updateIcon(com:Component, g:Graphics2D, x:int, y:int):void {
            
            
        }
        
        
public function getDisplay(c:Component):DisplayObject{
            
return iconImg;
        }
        
    }

 

代码
    public class ExpandedFolderIcon implements Icon, UIResource{
        
private var iconImg:DisplayObject;
        
public function ExpandedFolderIcon(){
            iconImg 
= SystemImages.getJianhao2();
        }
        
        
public function getIconWidth(c:Component) : int {
            
return iconImg.width;
        }
        
        
public function getIconHeight(c:Component) : int {
            
return iconImg.height;
        }
        
        
public function updateIcon(com:Component, g:Graphics2D, x:int, y:int):void {
            
            
        }
        
        
public function getDisplay(c:Component):DisplayObject{
            
return iconImg;
        }
        
    }

 

            var ui:ComponentUI = tree.getUI();
            ui.putDefault(
"Tree.folderExpandedIcon",ExpandedFolderIcon);
       //ui.putDefault("Tree.folderExpandedIcon",new AssetIcon(xxx));错误

            ui.putDefault(
"Tree.folderCollapsedIcon",CollapsedFolderIcon);

 

相关文章:

  • 2021-12-09
  • 2022-01-30
  • 2022-12-23
  • 2021-07-09
  • 2021-07-15
  • 2021-04-01
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-09-04
  • 2021-10-23
  • 2021-06-15
相关资源
相似解决方案