| java.lang.Object com.jeta.forms.gui.effects.ImagePainter
ImagePainter | public class ImagePainter implements Painter(Code) | | This class is an implementation of a painter that renders an image on a part
of a canvas or component. The caller specifies an Icon and alignment
properties for the painter. Since this is not an AWT component, the caller
must explicitly call paint. The caller must also pass a rectangle that
specifies the coordinates of the painting area relative to the given graphics
context.
author: Jeff Tassin |
Constructor Summary | |
public | ImagePainter() Creates an ImagePainter instance with no icon. | public | ImagePainter(Icon icon, int hAlign, int vAlign) Creates an ImagePainter instance with the specified icon
and alignment properties. |
Method Summary | |
public int | getHorizontalAlignment() Returns the horizontal alignment of the icon relative to the painting
area. | public Icon | getIcon() Returns the icon used by this painter. | public int | getIconHeight() Return the height of the icon associated with this painter. | public int | getIconWidth() Return the width of the icon associated with this painter. | public int | getVerticalAlignment() Returns the vertical alignment of the icon relative to the painting area.
The alignment has an effect only if the painting area is larger than the
icon size. | public void | paint(Component comp, Graphics g, int x1, int y1, int width, int height) Renders this image in the given rectangle. | public void | paint(Component comp, Graphics g, Rectangle rect) Renders this image in the given rectangle
Parameters: g - the graphics context Parameters: rect - the rectangle that defines the region to paint. | public void | setHorizontalAlignment(int halign) Sets the horizontal alignment of the icon relative to the painting area. | public void | setIcon(Icon icon) Sets the icon used by this painter. | public void | setVerticalAlignment(int valign) Sets the vertical alignment of the icon relative to the painting area. |
ImagePainter | public ImagePainter()(Code) | | Creates an ImagePainter instance with no icon.
|
ImagePainter | public ImagePainter(Icon icon, int hAlign, int vAlign)(Code) | | Creates an ImagePainter instance with the specified icon
and alignment properties.
Parameters: icon - the icon that will be rendered on the graphics context whenpaint is invoked. Parameters: hAlign - the horizontal alignment of the icon relative to the paintingarea. Parameters: vAlign - the horizontal alignment of the icon relative to the paintingarea. |
getHorizontalAlignment | public int getHorizontalAlignment()(Code) | | Returns the horizontal alignment of the icon relative to the painting
area. The alignment has an effect only if the painting area is larger
than the icon size. Valid values are: ImageProperty.LEFT,
ImageProperty.CENTER, ImageProperty.RIGHT
the horizontal alignment of the icon. Seecom.jeta.forms.store.properties.ImageProperty |
getIcon | public Icon getIcon()(Code) | | Returns the icon used by this painter.
the icon associated with this painter. |
getIconHeight | public int getIconHeight()(Code) | | Return the height of the icon associated with this painter.
the height of the icon associated with this painter |
getIconWidth | public int getIconWidth()(Code) | | Return the width of the icon associated with this painter.
the width of the icon associated with this painter |
getVerticalAlignment | public int getVerticalAlignment()(Code) | | Returns the vertical alignment of the icon relative to the painting area.
The alignment has an effect only if the painting area is larger than the
icon size. Valid values are: ImageProperty.TOP, ImageProperty.CENTER,
ImageProperty.BOTTOM
the vertical alignment of the icon. Seecom.jeta.forms.store.properties.ImageProperty |
paint | public void paint(Component comp, Graphics g, int x1, int y1, int width, int height)(Code) | | Renders this image in the given rectangle. Note, that the coordinates
passed here are different than the clipping rectangle.
Parameters: g - the graphics context Parameters: x - the x position that defines the region to paint. Parameters: y - the y position that defines the region to paint. Parameters: width - the width that defines the region to paint. Parameters: height - the height that defines the region to paint. |
paint | public void paint(Component comp, Graphics g, Rectangle rect)(Code) | | Renders this image in the given rectangle
Parameters: g - the graphics context Parameters: rect - the rectangle that defines the region to paint. Note, thatthis is different than the clipping rectangle. |
setHorizontalAlignment | public void setHorizontalAlignment(int halign)(Code) | | Sets the horizontal alignment of the icon relative to the painting area.
Parameters: halign - the horizontal alignment of the icon. |
setIcon | public void setIcon(Icon icon)(Code) | | Sets the icon used by this painter.
Parameters: icon - the icon associated with this painter. |
setVerticalAlignment | public void setVerticalAlignment(int valign)(Code) | | Sets the vertical alignment of the icon relative to the painting area.
Parameters: valign - the vertical alignment of the icon. |
|
|