Package com.ms.ui Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class UIGraphic

Constructors , Methods

public class UIGraphic extends UIStatic
{

  // Constructors
  public UIGraphic();
  public UIGraphic(Image image);
  public UIGraphic(Image image, int justify);

  // Methods
  public Image getImage();
  public void setImage(Image image);
  public boolean imageUpdate(Image image, int flags, int x, int y, 
                             int width, int height);
  public int getRoleCode();
  public Dimension minimumSize();
  public void paint(Graphics g, Rectangle rect);

}

A class that manages a static graphic control object, used to display graphical information.


Constructors


UIGraphic

public UIGraphic();

Creates a graphic control with no image and a justification of centered.


UIGraphic

public UIGraphic(Image image);

Creates a graphic control with a specified image and a justification of centered.

ParameterDescription
image The image to be displayed.


UIGraphic

public UIGraphic(Image image, int justify);

Creates a graphic control with a specified image and justification.

ParameterDescription
image The image to be displayed.
justify The justification used when arranging content within the control. For a description of valid justification values, see the UIStatic class fields (Fields).


Methods


imageUpdate

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

Updates the image displayed by the control.

Return Value:

Returns false if the image passed is not the image displayed by the control.

ParameterDescription
image The image displayed by the control.
flags Flags that specify information about the image update. You can pass any bitwise combination of the fields defined in the ImageObserver interface.
x The x coordinate for the clipping rectangle used by this graphics context.
y The y coordinate for the clipping rectange used by this graphics context.
width The width of the clipping rectangle.
height The height of the clipping rectangle.


getImage

public Image getImage();

Retrieves the image that is displayed by the control.

Return Value:

Returns the control's Image object.


getRoleCode

public int getRoleCode();

Retrieves the role of the graphic control.

Return Value:

Returns the ROLE_SYSTEM code that best describes the role of the control.

Remarks:

This method returns the ROLE_SYSTEM_GRAPHIC code.


minimumSize

public Dimension minimumSize();

Retrieves the minimum size of the graphic control.

Return Value:

Returns the minimum size.

Overrides:

Overrides minimumSize in class UIStatic.


paint

public void paint(Graphics g, Rectangle rect);

Repaints the graphic control within the specified rectangle.

Return Value:

No return value.

ParameterDescription
g The graphics context.
Rectangle The rectangle to paint the graphics in.

Overrides:

Overrides Paint in class UIStatic.


setImage

public void setImage(Image image);

Sets the image that is displayed by the control.

Return Value:

No return value.

ParameterDescription
image The image to be displayed.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.