All Downloads are FREE. Search and download functionalities are using the official Maven repository.

freeseawind.lf.basic.tree.LuckTreeUIBundle Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show 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;
import freeseawind.lf.utils.LuckRes;

/**
 * 

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) { UIManager.put(SELECTIONBACKGROUND, getColorRes(171, 225, 235)); UIManager.put(SELECTIONFOREGROUND, Color.WHITE); } @Override protected void installBorder(UIDefaults table) { UIManager.put(EDITORBORDER, new LineBorder(new Color(3, 158, 211))); } @Override protected void loadImages(UIDefaults table) { UIManager.put(OPENICON, new ImageIcon(LuckRes.getImage("tree/folder_open.png"))); UIManager.put(CLOSEDICON, new ImageIcon(LuckRes.getImage("tree/folder_normal.png"))); UIManager.put(EXPANDEDICON, new ImageIcon(LuckRes.getImage("tree/expanded.png"))); UIManager.put(COLLAPSEDICON, new ImageIcon(LuckRes.getImage("tree/collapsed.png"))); UIManager.put(LEAFICON, new ImageIcon()); } @Override protected void installOther(UIDefaults table) { UIManager.put(PAINTLINES, false); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy