|
org.openide.util 7.18.1 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openide.util.ImageUtilities
public final class ImageUtilities
Useful static methods for manipulation with images/icons, results are cached.
Method Summary | |
---|---|
static Image |
addToolTipToImage(Image image,
String text)
Add text to tool tip for given image (creates new or returns cached, original remains unmodified) Text can contain HTML tags e.g. "<b>my</b> text" |
static Image |
assignToolTipToImage(Image image,
String text)
Assign tool tip text to given image (creates new or returns cached, original remains unmodified) Text can contain HTML tags e.g. "<b>my</b> text" |
static String |
getImageToolTip(Image image)
Get tool tip text for given image |
static Image |
icon2Image(Icon icon)
Converts given icon to a Image . |
static Icon |
image2Icon(Image image)
Converts given image to an icon. |
static Image |
loadImage(String resourceID)
Loads an image from the specified resource ID. |
static Image |
loadImage(String resource,
boolean localized)
Loads an image based on resource path. |
static Image |
mergeImages(Image image1,
Image image2,
int x,
int y)
This method merges two images into the new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final Image loadImage(String resourceID)
resourceID
- resource path of the icon (no initial slash)
public static final Image loadImage(String resource, boolean localized)
loadImage(String)
but may do a localized search.
For example, requesting org/netbeans/modules/foo/resources/foo.gif
might actually find org/netbeans/modules/foo/resources/foo_ja.gif
or org/netbeans/modules/foo/resources/foo_mybranding.gif.
Caching of loaded images can be used internally to improve performance.
public static final Image mergeImages(Image image1, Image image2, int x, int y)
image1
- underlying imageimage2
- second imagex
- x position of top-left cornery
- y position of top-left corner
public static final Icon image2Icon(Image image)
Warning: do not use this method if your icon is intended
to be used on an action which is not always enabled. Many look-and-feel
implementations are incapable of graying out any Icon
which is not
actually an ImageIcon
.
image
- to be converted
public static final Image icon2Image(Icon icon)
Image
.
icon
- Icon
to be converted.public static final Image assignToolTipToImage(Image image, String text)
image
- image to which tool tip should be settext
- tool tip text
public static final String getImageToolTip(Image image)
image
- image which is asked for tool tip text
public static final Image addToolTipToImage(Image image, String text)
text
- text to add to tool tip
|
org.openide.util 7.18.1 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |