Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class AwtUIGraphic

public class AwtUIGraphic extends AwtUIControl
{
  // Constructors
  public AwtUIGraphic();
  public AwtUIGraphic(Image image);
  public AwtUIGraphic(Image image, int justify);

  // Methods
  public IUIComponent getBase();
  public Rectangle getContentBounds();
  public Image getImage();
  public boolean imageUpdate(Image image, int flags, int x, int y,
        int width, int height);
  public void setImage(Image image);
}

This class implements the functionality of a UIGraphic object in an AWT-based control. An AwtUIGraphic control is an AwtUIHost component whose associated root container holds a UIGraphic object. By hosting this object, an AwtUIGraphic control integrates AFC with AWT. although an AwtUIGraphic control is fully compatible with AWT, a UIGraphic control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIGraphic

Constructors

AwtUIGraphic

public AwtUIGraphic();

Creates an AWT-based graphic control with no image.

AwtUIGraphic

public AwtUIGraphic(Image image);

Creates an AWT-based graphic control with the specified image.

ParameterDescription
image The image to be displayed within the control.

Remarks:

By default, the image is aligned both horizontally and vertically.

AwtUIGraphic

public AwtUIGraphic(Image image, int justify);

Creates an AWT-based graphic control with the specified image and style.

ParameterDescription
image The image to be displayed within the control.
justify The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIGraphic object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIGraphic object.

getContentBounds

public Rectangle getContentBounds();

Retrieves the bounding rectangle of the control's contents.

Return Value:

Returns a Rectangle object that defines the content area within the control's coordinate space.

getImage

public Image getImage();

Retrieves the control's image.

Return Value:

Returns the Image object displayed within the control.

See Also: setImage

imageUpdate

public boolean imageUpdate(Image image, int flags, int x, int y, int width,
        int height);

Incrementally draws the control's image as the bits become available.

Return Value:

Returns true if more information is needed to draw the full image; otherwise, returns false.

ParameterDescription
image The control's image.
flags The flags that specify the status of the image that is being loaded. You can pass any bitwise combination of the fields that are defined in the ImageObserver interface.
x The x coordinate of the image.
y The y coordinate of the image.
width The width of the image (in pixels).
height The height of the image (in pixels).

setImage

public void setImage(Image image);

Sets the control's image.

Return Value:

No return value.

ParameterDescription
image The image to be displayed within the control.

See Also: getImage

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.