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

Class UIText

Constructors , Methods

public class UIText extends UIStatic
{
  // Constructors
  public UIText();
  public UIText(String text);
  public UIText(String text, int justify);

  // Methods
  public String getName();
  public int getRoleCode();

  public void setFocus(boolean on);
  public void setHot(boolean on);
  public void setName(String text);
  public void setSelected(boolean on);
  public Dimension minimumSize();
  public void initGraphics();
  public void paint(Graphics g, Rectangle rect);

}

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


Constructors


UIText

public UIText();

Creates a text control.


UIText

public UIText(String text);

Creates a text control with a specified string.

ParameterDescription
text The text to be displayed.


UIText

public UIText(String text, int justify);

Creates a text control with a specified string and text justification.

ParameterDescription
text The text to be displayed.
justify The justification style. For a description of valid justification values, see Fields.


Methods


getName

public String getName();

Retrieves the text that isdisplayed by the control.

Return Value:

Returns the string that isdisplayed.


getRoleCode

public int getRoleCode();

Retrieves the role of the text control.

Return Value:

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

Remarks:

This method returns the ROLE_SYSTEM_STATICTEXT code.


initGraphics

public void initGraphics();

Initializes the graphics when the graphics context is initially made available.

Return Value:

No return value.

Remarks:

This method is used instead of the constructor to do initialization that requires the graphics context. In this case, it computes the size of the control.


minimumSize

public Dimension minimumSize();

Retrieves the minimum size of the text control.

Return Value:

Returns minimum dimensions.


paint

public void paint(Graphics g, Rectangle rect);

Draws the text control within the specified rectangle.

Return Value:

No return value.

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


setFocus

public void setFocus(boolean on);

Sets the focus state of this object.

ParameterDescription
on Set to true to enable the state, false to disable the state.

Remarks:

This method forces a repaint if the control contains text.


setHot

public void setHot(boolean on);

Sets the hot-track state of this object.

Return Value:

No return value.

ParameterDescription
on Set to true to enable the state, false to disable the state.

Remarks:

This method forces a repaint if the control contains text.


setText

public void setName(String text);

Sets the text displayed by the control.

Return Value:

No return value.

ParameterDescription
text The text to be displayed.


setSelected

public void setSelected(boolean on);

Sets the selected state of this object.

ParameterDescription
on Set to true to enable the state, false to disable the state.

Remarks:

This method forces a repaint if the control contains text.



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