• 替换AsWing的JTree组件中的图标


    代码
        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);
  • 相关阅读:
    ArcGIS 重新创建几何服务(GeometryService)
    ArcGIS Server10.4安装教程
    ArcGIS Desktop10.4安装教程
    elk使用不足及弥补报警措施
    数据链路层
    限制mongoDB内存的方法
    计算机网络原理,TCP&UDP
    生产中一次内存使用过高排查过程
    (坑爹错误)记录prometheus中配置alertmanager.yml一次报错
    prometheus监控(小试牛刀)
  • 原文地址:https://www.cnblogs.com/sagacite/p/1872766.html
Copyright © 2020-2023  润新知