|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.ImageIcon
com.wordpress.tipsforjava.swing.StretchIcon
com.wordpress.tipsforjava.swing.ShrinkIcon
public class ShrinkIcon extends StretchIcon
@(#)ShrinkIcon.java 1.0 04/05/12
| Field Summary |
|---|
| Fields inherited from class StretchIcon | |
|---|---|
| proportionate |
| Constructor Summary | |
ShrinkIcon(byte[] imageData)
Creates a |
|
ShrinkIcon(byte[] imageData, boolean proportionate)
Creates a |
|
ShrinkIcon(byte[] imageData, String description)
Creates a |
|
ShrinkIcon(byte[] imageData, String description, boolean proportionate)
Creates a |
|
ShrinkIcon(Image image)
Creates a ShrinkIcon from the image. |
|
ShrinkIcon(Image image, boolean proportionate)
Creates a ShrinkIcon from the image with the specified behavior. |
|
ShrinkIcon(Image image, String description)
Creates a ShrinkIcon from the image. |
|
ShrinkIcon(Image image, String description, boolean proportionate)
Creates a ShrinkIcon from the image with the specified behavior. |
|
ShrinkIcon(String filename)
Creates a ShrinkIcon from the specified file. |
|
ShrinkIcon(String filename, boolean proportionate)
Creates a ShrinkIcon from the specified file with the specified behavior. |
|
ShrinkIcon(String filename, String description)
Creates a ShrinkIcon from the specified file. |
|
ShrinkIcon(String filename, String description, boolean proportionate)
Creates a ShrinkIcon from the specified file with the specified behavior. |
|
ShrinkIcon(URL location)
Creates a ShrinkIcon from the specified URL. |
|
ShrinkIcon(URL location, boolean proportionate)
Creates a ShrinkIcon from the specified URL with the specified behavior. |
|
ShrinkIcon(URL location, String description)
Creates a ShrinkIcon from the specified URL. |
|
ShrinkIcon(URL location, String description, boolean proportionate)
Creates a ShrinkIcon from the specified URL with the specified behavior. |
|
| Method Summary | |
|---|---|
void
|
paintIcon(Component c, Graphics g, int x, int y)
Paints the icon. |
| Methods inherited from class StretchIcon | |
|---|---|
| getIconHeight, getIconWidth, paintIcon |
| Methods inherited from class ImageIcon | |
|---|---|
| toString, getDescription, getAccessibleContext, getIconWidth, getIconHeight, setDescription, paintIcon, getImage, setImage, getImageLoadStatus, getImageObserver, setImageObserver, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
| Constructor Detail |
|---|
public ShrinkIcon(byte[] imageData)
ShrinkIcon 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 ShrinkIcon(byte[] imageData, boolean proportionate)
ShrinkIcon from an array of bytes with the specified behavior.
imageData - an array of pixels in an image format supported by
the AWT Toolkit, such as GIF, JPEG, or (as of 1.3) PNGproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(byte[] imageData, String description)
ShrinkIcon 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 ShrinkIcon(byte[] imageData, String description, boolean proportionate)
ShrinkIcon from an array of bytes with the specified behavior.
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 imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(Image image)
image - the image
public ShrinkIcon(Image image, boolean proportionate)
image - the imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(Image image, String description)
image - the imagedescription - a brief textual description of the image
public ShrinkIcon(Image image, String description, boolean proportionate)
image - the imagedescription - a brief textual description of the imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(String filename)
filename - a String specifying a filename or path
public ShrinkIcon(String filename, boolean proportionate)
filename - a String specifying a filename or pathproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(String filename, String description)
filename - a String specifying a filename or pathdescription - a brief textual description of the image
public ShrinkIcon(String filename, String description, boolean proportionate)
filename - a String specifying a filename or pathdescription - a brief textual description of the imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(URL location)
location - the URL for the image
public ShrinkIcon(URL location, boolean proportionate)
location - the URL for the imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
public ShrinkIcon(URL location, String description)
location - the URL for the imagedescription - a brief textual description of the image
public ShrinkIcon(URL location, String description, boolean proportionate)
location - the URL for the imagedescription - a brief textual description of the imageproportionate - true to retain the image's aspect ratio,
false to allow distortion of the image to fit the
component.
| Method Detail |
|---|
@Override public void paintIcon(Component c, Graphics g, int x, int y)
If the proportion has not been specified, or has been specified as
true, the aspect ratio of the image will be preserved when
reducing the size, by padding and centering the image horizontally or
vertically.
If the proportion has been specified as false the image may be
reduced on one or both axes, each independent of the other, to fit the component.
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 usedy - not used
Groovy Documentation