
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;
}
}
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;
}
}
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",ExpandedFolderIcon);
//ui.putDefault("Tree.folderExpandedIcon",new AssetIcon(xxx));错误
ui.putDefault("Tree.folderCollapsedIcon",CollapsedFolderIcon);
ui.putDefault("Tree.folderCollapsedIcon",CollapsedFolderIcon);