public static final class IconLoader.CachedImageIcon extends LazyImageIcon
myLock, myRealIcon
Constructor and Description |
---|
CachedImageIcon(java.net.URL url) |
Modifier and Type | Method and Description |
---|---|
IconLoader.CachedImageIcon |
copy()
Returns a copy of this icon.
|
void |
detachClassLoader(java.lang.ClassLoader loader) |
javax.swing.Icon |
getDarkIcon(boolean isDark) |
javax.swing.Icon |
getMenuBarIcon(boolean isDark) |
java.lang.String |
getOriginalPath() |
protected javax.swing.ImageIcon |
getRealIcon(ScaleContext ctx) |
double |
getScale(DerivedScaleType type) |
double |
getScale(ScaleType type) |
T |
getScaleContext() |
java.net.URL |
getURL() |
javax.swing.Icon |
scale(float scale)
Creates and returns a scaled instance of the icon.
|
boolean |
setScale(Scale scale)
Sets the new scale in the context
|
java.lang.String |
toString() |
boolean |
updateScaleContext(UserScaleContext ctx)
Updates the current context with the state of the provided context.
|
doGetRealIcon, getIconHeight, getIconWidth, getRealIcon, getScale, paintIcon, unwrapIcon
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deepCopy
public java.lang.String getOriginalPath()
protected javax.swing.ImageIcon getRealIcon(ScaleContext ctx)
getRealIcon
in class LazyImageIcon
public java.lang.String toString()
toString
in class java.lang.Object
public javax.swing.Icon scale(float scale)
ScalableIcon
scale(1f)
will
return the icon in its original scale.
To scale this instance by n
times: scale(n * getScale())
.
Note that the methods Icon.getIconWidth()
and Icon.getIconHeight()
should return the scaled size of the icon.scale
- scalepublic javax.swing.Icon getDarkIcon(boolean isDark)
public javax.swing.Icon getMenuBarIcon(boolean isDark)
public IconLoader.CachedImageIcon 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.
public java.net.URL getURL()
public void detachClassLoader(java.lang.ClassLoader loader)
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