public abstract class JBCachingScalableIcon<T extends JBCachingScalableIcon> extends JBUI.JBIcon implements CopyableIcon
JBScalableIcon providing an immutable caching implementation of the ScalableIcon.scale(float) method.| Modifier | Constructor and Description |
|---|---|
protected |
JBCachingScalableIcon() |
protected |
JBCachingScalableIcon(JBCachingScalableIcon icon) |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
copy()
Returns a copy of this icon.
|
double |
getScale(DerivedScaleType type) |
double |
getScale(ScaleType type) |
T |
getScaleContext() |
T |
scale(float scale)
Creates and returns a scaled instance of the 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.
|
getScale, isIconPreScaled, scaleVal, scaleVal, scaleVal, setAutoUpdateScaleContext, setIconPreScaled, toString, withIconPreScaledclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdeepCopyprotected JBCachingScalableIcon()
protected JBCachingScalableIcon(JBCachingScalableIcon icon)
public T scale(float scale)
ScalableIconscale(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 ScalableIconscale in class JBScalableIconscale - scalepublic abstract T copy()
CopyableIconThe 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 CopyableIconpublic T getScaleContext()
getScaleContext in interface ScaleContextAwarepublic boolean updateScaleContext(UserScaleContext ctx)
ScaleContextAwarectx is null, then updates the current context via ScaleContext.update()
and returns the result.updateScaleContext in interface ScaleContextAwarectx - the new scale contextpublic double getScale(ScaleType type)
getScale in interface ScaleContextAwarepublic double getScale(DerivedScaleType type)
getScale in interface ScaleContextAwarepublic boolean setScale(Scale scale)
ScaleContextAwaresetScale in interface ScaleContextAware