jmtree.java.svn-base

来自「梦界家园程序开发基底框架」· SVN-BASE 代码 · 共 62 行

SVN-BASE
62
字号
package jm.framework.gui.module.jmtree ;

import java.awt.* ;
import javax.swing.* ;

import jm.framework.gui.module.jmtree.model.*;

public class JMTree
    extends JTree
{
    /**
	 *
	 */
	private static final long serialVersionUID = 4287079459436872933L;
    Color selectionForeground = Color.white;
    Color selectionBackground = Color.blue;
    public JMTree() {
        super();
    }

    public JMTree (JMTreeNode root)
    {
        super(root);
    }
    public void showAngledLine(boolean show)
    {
        if(show)
        {
            this.putClientProperty ( "JTree.lineStyle" , "Angled" ) ;
        }
        else
        {
            this.putClientProperty ( "JTree.lineStyle" , "None" ) ;
        }
    }

    public void setSelectionForeground(Color fore)
    {
        if(fore!=null)
            selectionForeground = fore;
    }
    public Color getSelectionForeground()
    {
          return  selectionForeground ;
    }

    public void setSelectionBackground(Color back)
    {
        if(back!=null)
            selectionBackground = back;
    }

    public Color getSelectionBackground()
    {
          return  selectionBackground ;
    }

    public JMTreeNode getLastSelectedPathComponent(){
        return (JMTreeNode)super.getLastSelectedPathComponent();
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?