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
Default base implementation for
UIAwareIcon. The specific loading mechanism needs to be
implemented in the subclass.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract UIAwareIcongetDual()Return the dual version of the icon.intintprotected abstract IconLoad the dark version of the icon.protected abstract IconLoad the light version of the icon.void
-
Field Details
-
light
-
dark
-
-
Constructor Details
-
DefaultUIAwareIcon
public DefaultUIAwareIcon() -
DefaultUIAwareIcon
-
-
Method Details
-
createDual
-
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
Load the light version of the icon. This method should never return a null value.- Returns:
- the light icon.
-
loadDarkIcon
Load the dark version of the icon. This method should never return a null value.- Returns:
- the dark icon.
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-