jbcl.control Package
java.lang.Object +----java.awt.Component +----com.borland.jbcl.control.TransparentImage
Variables Constructors Properties Methods Event Listeners
Implements ImageObserver, MenuContainer, Serializable
TransparentImage
component paints a specified image. Some images are "transparent" in that you can see through parts of them to the components behind them. TransparentImage
can display these images as transparent, unlike the ImageControl
.
Specify the image to use in the control using the imageName
property or imageURL
property. The image
property contains the java.awt.Image
being used.
You can align the image using the alignment
property. Whether the transparent parts of the image appear transparent depends on the setting of the transparent
property.
Customize the appearance of the border drawn around the image with the drawEdge
and edgeColor
properties.
protected int alignmentContains the alignment setting for the image, which will be one of the
com.borland.dx.text.Alignment
values.
protected boolean drawEdgeControls whether an edge is drawn.
protected Color edgeColorContains the color of the edge.
protected transient Image imageContains the image object.
protected String imageNameContains the name of the image.
protected boolean transparentDetermines whether the image displays as transparent.
protected URL urlContains the URL to the image object.
public TransparentImage()Creates a
TransparentImage
object and sets its size to 100 by 100 pixels.
public int getAlignment() public void setAlignment(int align)Determines the alignment of the image. The value of aligment is one of the
com.borland.dx.text.Alignment
variables.
public boolean isDrawEdge() public void setDrawEdge(boolean drawEdge)Determines whether an edge is drawn around the image. If true, the edge is drawn around the image; if false, no edge is drawn.
public Color getEdgeColor() public void setEdgeColor(Color edgeColor)Determines the color of the edge, if one is drawn. It must be one of the
java.awt.Color
values.
public Image getImage() public void setImage(Image image)Determines the image object that appears in the
TransparentImage
.
public String getImageName() public void setImageName(String path)Specifies the path and file name of the image that displays in
TransparentImage
. Setting the imageName
loads the image into the TransparentImage
control.
public URL getImageURL() public void setImageURL(URL url)Specifies the URL of the image. Setting
imageURL
loads the image at the URL into the TransparentImage
control.
public Dimension getPreferredSize()Read-only property that returns the size of the image if one is specified; otherwise, it returns a size of 100 by 100 pixels.
public boolean isTransparent() public void setTransparent(boolean transparent)Determines whether the "transparent" parts of an image display as transparent. If true, the "transparent" parts of the image display as transparent. If false, the "transparent" parts do not appear transparent.
public void paint(Graphics pg)Paints the image.
Parameters:
g
Graphics
object used for painting.
Overrides: java.awt.Component.paint(java.awt.Graphics)
protected void setupImage(Image im, String path)Locates the image and loads it into the
TransparentImage
control.
public void update(Graphics g)Paints the image by calling the
paint()
method.
Parameters:
g
Graphics
object used for painting.
Overrides: java.awt.Component.update(java.awt.Graphics)
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )