Packages
 In this topic

*Constructors

*Methods

 

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

 


Class FxCaret

public class FxCaret implements TimerListener
{
  // Constructors
  public FxCaret(Component c, int w, int h);
  public FxCaret(IUIComponent c, int w, int h);

  // Methods
  public int getHeight();
  public int getWidth();
  public void hide();
  public boolean isVisible();
  public void setInputMethod( InputMethodListener ime );
  public void setPos(Point p);
  public void setPos(int px, int py);
  public void show();
  public void timeTriggered(TimerEvent te);
}

This is a cross-platform class that manages a caret object.

The caret can also connect to an Input Method Editor (IME). Use the setInputMethod method to associate an InputMethodListener object with the FxCaret object. When you call the show and setPos methods, the IME's composition window is displayed.

Constructors

FxCaret

public FxCaret(Component c, int w, int h);

Creates a caret and links it to a java.awt Component. Initially, the caret object is invisible.

ParameterDescription
c The component where the caret should be displayed. This is passed to the setVisibleComponent method, and the font used in this component is passed to the setFont method. The attached IME then uses the component's font, and the composition window appears in a position near the caret.
w The width of the caret (in pixels).
h The height of the caret (in pixels).

FxCaret

public FxCaret(IUIComponent c, int w, int h);

Creates a caret and links it to a com.ms.ui.IUIComponent. Initially, the caret object is invisible.

ParameterDescription
c The component where the caret is displayed. This is passed to the setVisibleComponent method, and the font used in this component is passed to the setFont method. The attached IME then uses the component's font, and the composition window appears in a position near the caret.
w The width of the caret (in pixels).
h The height of the caret (in pixels).

Methods

getHeight

public int getHeight();

Retrieves the current height of the caret.

Return Value:

Returns the height of the caret (in pixels).

getWidth

public int getWidth();

Retrieves the current width of the caret.

Return Value:

Returns the width of the caret (in pixels).

hide

public void hide();

Hides the caret, if it is visible.

Return Value:

No return value.

isVisible

public boolean isVisible();

Retrieves the visible state of the caret.

Return Value:

Returns true if the caret is visible; otherwise, returns false.

setInputMethod

public void setInputMethod( InputMethodListener ime );

Sets the InputMethodListener for an FxCaret object. The FxCaret displays the composition window of the InputMethodListener near the caret.

Return Value:

No return value.

ParameterDescription
ime the InputMethodListener to be set.

Remarks:

You must set an InputMethodListener before you call the show method. The font of the composition window is dependent on the attached component.

setPos

public void setPos(Point p);

Sets the caret position, relative to the owning component's upper-left corner.

Return Value:

No return value.

ParameterDescription
p The Point that defines the caret's position.

setPos

public void setPos(int px, int py);

Sets the caret position, relative to the owning component's upper-left corner.

Return Value:

No return value.

ParameterDescription
px The x coordinate for the caret.
py The y coordinate for the caret.

show

public void show();

Displays the caret, if it is not already visible. The caret can be active in only one component at a time.

Return Value:

No return value.

timeTriggered

public void timeTriggered(TimerEvent te);

This method is called when a timer linked to the caret has expired.

Return Value:

No return value.

ParameterDescription
te A TimerEvent that describes the event.

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