public interface IRIcon extends HasResource
IGuiFactory.newRIcon(java.net.URL)
Modifier and Type | Method and Description |
---|---|
javax.swing.ImageIcon |
get()
Returns the lazily loaded icon.
|
javax.swing.ImageIcon |
get(boolean cache)
Returns the lazily loaded icon.
|
java.lang.String |
getCSS()
Returns a CSS style code which contains this image as a non-repeatable background image.
|
java.awt.Image |
getGrayedImage()
Returns a lazily created grayed version of the icon's image.
|
java.awt.Image |
getGrayedImage(boolean cache)
Returns a lazily created grayed version of the icon's image.
|
javax.swing.Icon |
size(int height)
Returns an icon with the specified height.
|
javax.swing.Icon |
size(int height,
boolean grayed,
boolean cache)
Returns an icon with the specified height.
|
java.lang.String |
toString()
Overrides
Object.toString() so that if this ricon is used in a table, copying cells will not result in a meaningless or strange text. |
getResource
javax.swing.ImageIcon get()
If the icon was loaded and cached previously, the cached instance is returned.
Else the icon is loaded and cached first, and returned.
get(boolean)
javax.swing.ImageIcon get(boolean cache)
If the icon was loaded and cached previously, the cached instance is returned.
Else the the icon will be loaded and the cache
parameter tells if the icon is to be cached.
The significance of not caching is that if a big resource is only need once (or in one place), with this it can be accessed and avoided for it to remain
in memory.
cache
- tells if the icon is to be cachedget()
java.awt.Image getGrayedImage()
It is guaranteed that when this method returns, the grayed version is ready to be rendered.
getGrayedImage(boolean)
java.awt.Image getGrayedImage(boolean cache)
It is guaranteed that when this method returns, the grayed version is ready to be rendered.
If the icon was loaded and cached previously, the cached instance is returned.
Else the the icon will be loaded and the cache
parameter tells if the icon is to be cached.
The significance of not caching is that if a big resource is only need once (or in one place), with this it can be accessed and avoided for it to remain
in memory.
cache
- tells if the icon is to be cachedgetGrayedImage()
javax.swing.Icon size(int height)
The returned icon will have a height specified by the parameter and a width calculated to keep aspect ratio.
height
- height of the icon in pixels to returnsize(int, boolean, boolean)
javax.swing.Icon size(int height, boolean grayed, boolean cache)
The returned icon will have a height specified by the parameter and a width calculated to keep aspect ratio.
If the icon was loaded and cached previously, the cached instance is returned.
Else the the icon will be loaded and the cache
parameter tells if the icon is to be cached.
The significance of not caching is that if a big resource is only need once (or in one place), with this it can be accessed and avoided for it to remain
in memory.
height
- height of the icon in pixels to returngrayed
- tells if the grayed version of the icon should be used (e.g. for disabled components)cache
- tells if the icon is to be cachedsize(int)
java.lang.String getCSS()
java.lang.String toString()
Object.toString()
so that if this ricon is used in a table, copying cells will not result in a meaningless or strange text.toString
in class java.lang.Object
This API documentation is public and is intended for / allowed to be used by anyone.
Scelight home page: https://sites.google.com/site/scelight/
Scelight is a trademark of András Belicza. Copyright © András Belicza, 2013-2015. All rights reserved.