Package ca.corbett.extras.dirtree
Class DirTreeNodeIcon
java.lang.Object
ca.corbett.extras.dirtree.DirTreeNodeIcon
- All Implemented Interfaces:
Icon
@Deprecated(since="swing-extras 2.7",
forRemoval=true)
public class DirTreeNodeIcon
extends Object
implements Icon
Deprecated, for removal: This API element is subject to removal in a future version.
This class hasn't been used in ages, and LookAndFeelManager makes it unnecessary.
Shamelessly stolen from StackOverflow. Draws nice simple little + and - icons next to tree
nodes to indicate expand/collapse ability, instead of the horrible icons included
in every major look and feel.
To use this code, you have to let the UIManager know about it:
static {
UIManager.put("Tree.collapsedIcon", new DirTreeNodeIcon('+'));
UIManager.put("Tree.expandedIcon", new DirTreeNodeIcon('-'));
}
But a better option is to use LookAndFeelManager to switch the LookAndFeel to something better than one of the Java built-in defaults. Then you won't need this at all.
- Since:
- 2017-11-09
- Author:
- StackOverflow
-
Constructor Summary
ConstructorsConstructorDescriptionDirTreeNodeIcon(char type) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
DirTreeNodeIcon
public DirTreeNodeIcon(char type) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
paintIcon
Deprecated, for removal: This API element is subject to removal in a future version. -
getIconWidth
public int getIconWidth()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getIconHeightin interfaceIcon
-