|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.ImageIcon
com.wordpress.tipsforjava.swing.TileIcon
public class TileIcon extends ImageIcon
@(#)TileIcon.java 1.0 04/19/12
| Nested Class Summary | |
|---|---|
enum |
TileIcon.TileMode
The type of the tiling mode |
| Field Summary | |
|---|---|
private TileIcon.TileMode |
tileMode
@(#)TileIcon.java 1.0 04/19/12 |
| Constructor Summary | |
TileIcon(byte[] imageData)
Creates a |
|
TileIcon(byte[] imageData, String description)
Creates a |
|
TileIcon(Image image)
Creates a |
|
TileIcon(Image image, String description)
Creates a |
|
TileIcon(String filename)
Creates a |
|
TileIcon(String filename, String description)
Creates a |
|
TileIcon(URL location)
Creates a |
|
TileIcon(URL location, String description)
Creates a |
|
| Method Summary | |
|---|---|
int
|
getIconHeight()
Overridden to return 0. |
int
|
getIconWidth()
Overridden to return 0. |
TileIcon.TileMode
|
getTileMode()
Returns the tiling mode of this |
void
|
paintIcon(Component c, Graphics g, int x, int y)
Paints the icon. |
void
|
setTileMode(TileIcon.TileMode tileMode)
Sets the tiling mode. |
TileIcon
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
TileIcon[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class ImageIcon | |
|---|---|
| toString, getDescription, getAccessibleContext, getIconWidth, getIconHeight, setDescription, getImage, paintIcon, getImageLoadStatus, setImage, setImageObserver, getImageObserver, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private TileIcon.TileMode tileMode
| Constructor Detail |
|---|
public TileIcon(byte[] imageData)
TileIcon from an array of bytes.
imageData - an array of pixels in an image format supported by
the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNG
public TileIcon(byte[] imageData, String description)
TileIcon from an array of bytes.
imageData - an array of pixels in an image format supported by
the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNGdescription - a brief textual description of the image
public TileIcon(Image image)
TileIcon from the image.
image - the image
public TileIcon(Image image, String description)
TileIcon from the image.
image - the imagedescription - a brief textual description of the image
public TileIcon(String filename)
TileIcon from the specified file.
filename - a String specifying a filename or path
public TileIcon(String filename, String description)
TileIcon from the specified file.
filename - a String specifying a filename or pathdescription - a brief textual description of the image
public TileIcon(URL location)
TileIcon from the specified URL.
location - the URL for the image
public TileIcon(URL location, String description)
TileIcon from the specified URL.
location - the URL for the imagedescription - a brief textual description of the image
| Method Detail |
|---|
@Override public int getIconHeight()
@Override public int getIconWidth()
public TileIcon.TileMode getTileMode()
TileIcon
DEFAULT,
CENTER_CENTER or CENTER_CORNER
@Override public void paintIcon(Component c, Graphics g, int x, int y)
If this icon has no image observer,this method uses the c component
as the observer.
c - the component to which the Icon is painted. This is used as the
observer if this icon has no image observerg - the graphics contextx - not used.y - not used.
public void setTileMode(TileIcon.TileMode tileMode)
TileMode.DEFAULT,
the image will be tiled starting from the top left corner of the component.
tileMode - the tiling style. One of the following constants
defined in enum TileMode:
DEFAULTCENTER_CENTERCENTER_CORNER
TileIcon valueOf(String name)
TileIcon[] values()
Groovy Documentation