public final class DeferredIconImpl<T> extends JBCachingScalableIcon<DeferredIconImpl<T>> implements RetrievableIcon
Constructor and Description |
---|
DeferredIconImpl(javax.swing.Icon baseIcon,
T param,
boolean needReadAction,
Function<? super T,? extends javax.swing.Icon> evaluator) |
Modifier and Type | Method and Description |
---|---|
DeferredIconImpl<T> |
copy()
Returns a copy of this icon.
|
boolean |
equals(java.lang.Object obj) |
javax.swing.Icon |
evaluate() |
javax.swing.Icon |
getBaseIcon() |
int |
getIconHeight() |
int |
getIconWidth() |
double |
getScale(DerivedScaleType type) |
double |
getScale(ScaleType type) |
T |
getScaleContext() |
int |
hashCode() |
boolean |
isDone() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
javax.swing.Icon |
retrieveIcon()
Returns the wrapped icon.
|
DeferredIconImpl<T> |
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.
|
getScale, isIconPreScaled, scaleVal, scaleVal, scaleVal, setAutoUpdateScaleContext, setIconPreScaled, withIconPreScaled
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
deepCopy
public DeferredIconImpl<T> 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<DeferredIconImpl<T>>
public DeferredIconImpl<T> 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
in interface ScalableIcon
scale
in class JBCachingScalableIcon<DeferredIconImpl<T>>
scale
- scalepublic javax.swing.Icon getBaseIcon()
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public javax.swing.Icon retrieveIcon()
RetrievableIcon
retrieveIcon
in interface RetrievableIcon
public javax.swing.Icon evaluate()
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public boolean isDone()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class JBScalableIcon
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