borland Packages  Class Hierarchy  jbcl.control Package  Index 

TransparentImage component

java.lang.Object
   +----java.awt.Component
           +----borland.jbcl.control.TransparentImage

About the TransparentImage component

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.


TransparentImage variables

Variables implemented in this class

Variables implemented in java.awt.Component

TransparentImage constructors

TransparentImage properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.lang.Object

TransparentImage methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.lang.Object

TransparentImage event listeners


TransparentImage variables

alignment

  protected int alignment
Contains the alignment setting for the image, which will be one of the Alignment values.

drawEdge

  protected boolean drawEdge
Controls whether an edge is drawn.

edgeColor

  protected Color edgeColor
Contains the color of the edge.

image

  protected transient Image image
Contains the image object.

imageName

  protected String imageName
Contains the name of the image.

transparent

  protected boolean transparent
Determines whether the image displays as transparent.

url

  protected URL url
Contains the URL to the image object.

TransparentImage constructors

TransparentImage()

  public TransparentImage()
Creates a TransparentImage object and sets its size to 100 by 100 pixels.

TransparentImage properties

alignment

 public int getAlignment()
 public void setAlignment(int align)
Determines the alignment of the image. The value of aligment is one of the Alignment variables.

drawEdge

 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.

edgeColor

 public Color getEdgeColor()
 public void setEdgeColor(java.awt.Color edgeColor)
Determines the color of the edge, if one is drawn. It must be one of the Color values.

image

 public Image getImage()
 public void setImage(java.awt.Image image)
Determines the image object that appears in the TransparentImage.

imageName

 public String getImageName()
 public void setImageName(java.lang.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.

imageURL

 public URL getImageURL()
 public void setImageURL(java.net.URL url)
Specifies the URL of the image. Setting imageURL loads the image at the URL into the TransparentImage control.

preferredSize

 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.

transparent

 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.

TransparentImage methods

paint(java.awt.Graphics)

  public void paint(java.awt.Graphics pg)
Paints the image.

Parameters:

g
The Graphics object used for painting.

Overrides: java.awt.Component.paint(java.awt.Graphics)

setupImage(java.awt.Image, java.lang.String)

  protected void setupImage(java.awt.Image im, java.lang.String path)
Locates the image and loads it into the TransparentImage control.

update(java.awt.Graphics)

  public void update(java.awt.Graphics g)
Paints the image by calling the paint() method.

Parameters:

g
The Graphics object used for painting.

Overrides: java.awt.Component.update(java.awt.Graphics)


TransparentImage event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )