Package com.github.weisj.darklaf.icons
Class DefaultUIAwareIcon
- java.lang.Object
-
- com.github.weisj.darklaf.icons.DefaultUIAwareIcon
-
- All Implemented Interfaces:
DynamicIcon,UIAwareIcon,Icon
- Direct Known Subclasses:
LazyUIAwareIcon,SimpleUIAwareIcon
public abstract class DefaultUIAwareIcon extends Object implements UIAwareIcon
Default base implementation forUIAwareIcon. The specific loading mechanism needs to be implemented in the subclass.
-
-
Constructor Summary
Constructors Modifier Constructor Description DefaultUIAwareIcon()protectedDefaultUIAwareIcon(DefaultUIAwareIcon dual)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract UIAwareIconcreateDual()UIAwareIcongetDual()Return the dual version of the icon.intgetIconHeight()intgetIconWidth()protected abstract IconloadDarkIcon()Load the dark version of the icon.protected abstract IconloadLightIcon()Load the light version of the icon.voidpaintIcon(Component c, Graphics g, int x, int y)
-
-
-
Constructor Detail
-
DefaultUIAwareIcon
public DefaultUIAwareIcon()
-
DefaultUIAwareIcon
protected DefaultUIAwareIcon(DefaultUIAwareIcon dual)
-
-
Method Detail
-
createDual
protected abstract UIAwareIcon createDual()
-
getDual
public UIAwareIcon getDual()
Description copied from interface:UIAwareIconReturn the dual version of the icon. i.e. if the current icon is light then the dual version will be dark and vice versa. Implementations of this method should respect that the appearance of the icon after invoking this method twice should be the same.- Specified by:
getDualin interfaceUIAwareIcon- Returns:
- the dual icon.
-
loadLightIcon
protected abstract Icon loadLightIcon()
Load the light version of the icon. This method should never return a null value.- Returns:
- the light icon.
-
loadDarkIcon
protected abstract Icon loadDarkIcon()
Load the dark version of the icon. This method should never return a null value.- Returns:
- the dark icon.
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfaceIcon
-
-