public class SizedIcon extends JBCachingScalableIcon implements MenuBarIconProvider, DarkIconProvider, RetrievableIcon
Constructor and Description |
---|
SizedIcon(javax.swing.Icon delegate,
int width,
int height) |
Modifier and Type | Method and Description |
---|---|
SizedIcon |
copy()
Returns a copy of this icon.
|
javax.swing.Icon |
getDarkIcon(boolean isDark) |
int |
getIconHeight() |
int |
getIconWidth() |
javax.swing.Icon |
getMenuBarIcon(boolean isDark) |
double |
getScale(DerivedScaleType type) |
double |
getScale(ScaleType type) |
T |
getScaleContext() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
javax.swing.Icon |
retrieveIcon()
Returns the wrapped icon.
|
boolean |
setScale(Scale scale)
Sets the new scale in the context
|
boolean |
updateScaleContext(UserScaleContext ctx)
Updates the current context with the state of the provided context.
|
scale
getScale, isIconPreScaled, scaleVal, scaleVal, scaleVal, setAutoUpdateScaleContext, setIconPreScaled, toString, withIconPreScaled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deepCopy
public SizedIcon copy()
CopyableIcon
The copy should be a new instance, it should preserve the original size and should paint equal to the original bitmap. The subtype of the new icon is up to an implementor. It may or may not be equal the original subtype.
copy
in interface CopyableIcon
copy
in class JBCachingScalableIcon
public javax.swing.Icon getMenuBarIcon(boolean isDark)
getMenuBarIcon
in interface MenuBarIconProvider
public javax.swing.Icon getDarkIcon(boolean isDark)
getDarkIcon
in interface DarkIconProvider
public javax.swing.Icon retrieveIcon()
RetrievableIcon
retrieveIcon
in interface RetrievableIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public T getScaleContext()
getScaleContext
in interface ScaleContextAware
public boolean updateScaleContext(UserScaleContext ctx)
ScaleContextAware
ctx
is null, then updates the current context via ScaleContext.update()
and returns the result.updateScaleContext
in interface ScaleContextAware
ctx
- the new scale contextpublic double getScale(ScaleType type)
getScale
in interface ScaleContextAware
public double getScale(DerivedScaleType type)
getScale
in interface ScaleContextAware
public boolean setScale(Scale scale)
ScaleContextAware
setScale
in interface ScaleContextAware