Package com.github.weisj.darklaf.icons
Class DarkUIAwareIcon
java.lang.Object
com.github.weisj.darklaf.icons.DarkUIAwareIcon
- All Implemented Interfaces:
UIAwareIcon,Serializable,Icon,UIResource
public class DarkUIAwareIcon extends Object implements UIAwareIcon, UIResource, Serializable
Icon that is aware of the current ui theme and adjusts the icon accordingly. Icons are loaded lazily at their point
of usage.
- Since:
- 2019
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DarkUIAwareIcon(String darkKey, String lightKey, int w, int h, Class<?> parentClass)Create new ui aware icon. -
Method Summary
Modifier and Type Method Description DarkUIAwareIcongetDual()intgetIconHeight()intgetIconWidth()voidpaintIcon(Component c, Graphics g, int x, int y)voidpaintIcon(Component c, Graphics g2, int x, int y, double scale)
-
Constructor Details
-
DarkUIAwareIcon
Create new ui aware icon.- Parameters:
darkKey- key to load icon for dark mode.lightKey- key to load icon for light mode.w- width of icon.h- height of icon.parentClass- the class to resolve the path while lazy loading.
-
-
Method Details
-
paintIcon
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
getDual
- Specified by:
getDualin interfaceUIAwareIcon
-