![JAR search and dependency download from the Maven repository](/logo.png)
freeseawind.lf.basic.tree.LuckTreeUIBundle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of littleluck Show documentation
Show all versions of littleluck Show documentation
Java Swing cross platform LookAndFeel
The newest version!
package freeseawind.lf.basic.tree;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import freeseawind.lf.cfg.LuckResourceBundle;
/**
* TreeUI 资源绑定类。
*
* A TreeUI resource bundle class.
*
* @author freeseawind@github
* @version 1.0
*/
public class LuckTreeUIBundle extends LuckResourceBundle
{
/**
* TreeUI展开子菜单时父节点图标属性key。
*
* expand the sub-menu icon properties.
*/
public static final String OPENICON = "Tree.openIcon";
/**
* TreeUI收起子菜单时父节点图标属性key。
*
* Collapse the sub-menu icon properties.
*/
public static final String CLOSEDICON = "Tree.closedIcon";
/**
* TreeUI收起子菜单时箭头图标属性key。
*
* Collapse the sub-menu arrow icon properties.
*/
public static final String COLLAPSEDICON = "Tree.collapsedIcon";
/**
* TreeUI展开子菜单时箭头图标属性key。
*
* expand the sub-menu arrow icon properties.
*/
public static final String EXPANDEDICON = "Tree.expandedIcon";
/**
* TreeUI叶子节点头图标属性key。
*
* leaf node icon properties.
*/
public static final String LEAFICON = "Tree.leafIcon";
/**
*
* [LittleLuck属性]TreeUI层次线绘制属性key(true:绘制层次线), 默认false。
*
*
*
* [LittLeLuck Attributes] Level line drawing
* attributes(true is drawn), Defaults false.
*
*/
public static final String PAINTLINES = "Tree.paintLines";
/**
* TreeUI选中时背景颜色属性key。
*
* Select the Background Color property.
*/
public static final String SELECTIONBACKGROUND = "Tree.selectionBackground";
/**
* TreeUI选中时前景颜色属性key。
*
* Select the Foreground Color property.
*/
public static final String SELECTIONFOREGROUND = "Tree.selectionForeground";
/**
* TreeUI编辑时边框属性key。
*
* Edit border properties.
*/
public static final String EDITORBORDER = "Tree.editorBorder";
public void uninitialize()
{
// remove color.
UIManager.put(SELECTIONBACKGROUND, null);
UIManager.put(SELECTIONFOREGROUND, null);
// remove border.
UIManager.put(EDITORBORDER, null);
// remove image and icon.
UIManager.put(OPENICON, null);
UIManager.put(COLLAPSEDICON, null);
UIManager.put(CLOSEDICON, null);
UIManager.put(EXPANDEDICON, null);
UIManager.put(COLLAPSEDICON, null);
UIManager.put(LEAFICON, null);
// remove other.
UIManager.put(PAINTLINES, null);
}
@Override
protected void installColor(UIDefaults table)
{
table.put(SELECTIONBACKGROUND, getColorRes(171, 225, 235));
table.put(SELECTIONFOREGROUND, getColorRes(Color.WHITE));
}
@Override
protected void installBorder(UIDefaults table)
{
table.put(EDITORBORDER, getBorderRes(new LineBorder(new Color(3, 158, 211))));
}
@Override
protected void loadImages(UIDefaults table)
{
UIManager.put(OPENICON, getIconRes("tree/folder_open.png"));
UIManager.put(CLOSEDICON, getIconRes("tree/folder_normal.png"));
UIManager.put(EXPANDEDICON, getIconRes("tree/expanded.png"));
UIManager.put(COLLAPSEDICON, getIconRes("tree/collapsed.png"));
UIManager.put(LEAFICON, getIconRes(new ImageIcon()));
}
@Override
protected void installOther(UIDefaults table)
{
table.put(PAINTLINES, Boolean.FALSE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy