public abstract class LazyImageIcon extends ScaleContextSupport implements CopyableIcon, ScalableIcon, DarkIconProvider, MenuBarIconProvider
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
myLock |
protected java.lang.Object |
myRealIcon |
Modifier | Constructor and Description |
---|---|
protected |
LazyImageIcon() |
Modifier and Type | Method and Description |
---|---|
javax.swing.ImageIcon |
doGetRealIcon() |
int |
getIconHeight() |
int |
getIconWidth() |
javax.swing.ImageIcon |
getRealIcon() |
protected abstract javax.swing.ImageIcon |
getRealIcon(ScaleContext ctx) |
float |
getScale() |
double |
getScale(DerivedScaleType type) |
double |
getScale(ScaleType type) |
T |
getScaleContext() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
boolean |
setScale(Scale scale)
Sets the new scale in the context
|
protected static javax.swing.ImageIcon |
unwrapIcon(java.lang.Object realIcon) |
boolean |
updateScaleContext(UserScaleContext ctx)
Updates the current context with the state of the provided context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copy, deepCopy
scale
getDarkIcon
getMenuBarIcon
protected final java.lang.Object myLock
protected volatile java.lang.Object myRealIcon
protected static javax.swing.ImageIcon unwrapIcon(java.lang.Object realIcon)
public final javax.swing.ImageIcon doGetRealIcon()
public final 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 float getScale()
getScale
in interface ScalableIcon
public final javax.swing.ImageIcon getRealIcon()
protected abstract javax.swing.ImageIcon getRealIcon(ScaleContext ctx)
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