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

Class UICanvas

Methods

public class UICanvas extends Canvas implements IUIComponent,
IAccessible, IUIAccessible 
{
  // Methods
  public void addNotify();
  public void doDefaultAction();
  public boolean ensureVisible(Rectangle rect);
  public void fullValidate();
  public void initGraphics();
  public Component navigate(Component comp, int direction, boolean keyable);
  public String toString();

  public boolean isEnabled();
  public boolean isKeyable();
  public boolean isSelectable();

  public boolean gotFocus(Event e, Object o);
  public boolean lostFocus(Event e, Object o);
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseEnter(Event e, int x, int y);
  public boolean mouseExit(Event e, int x, int y);

  public void accDoDefaultAction(Variant varChild);
  public Variant accHitTest(int xLeft, int yTop);
  public void accLocation(int[] pxLeft, int[] pyTop, int[] pcxWidth, 
                          int[] pcyHeight, Variant varChild);
  public Variant accNavigate(int navDir, Variant varStartFromChildOrSelf);
  public void accSelect(int flagsSelect, Variant varChild);

  public Object getAccChild(Variant varChild);
  public int getAccChildCount();
  public String getAccDefaultAction(Variant varChild);
  public String getAccDescription(Variant varChild);
  public Variant getAccFocus();
  public String getAccHelp(Variant varChild);
  public int getAccHelpTopic(String[] helpFile, Variant varChild);
  public String getAccKeyboardShortcut(Variant varChild);
  public String getAccName(Variant varChild);
  public Object getAccParent();
  public Variant getAccRole(Variant varChild);
  public Variant getAccSelection();
  public Variant getAccState(Variant varChild);
  public String getAccValue(Variant varChild);

  public Rectangle getBounds(Component comp);
  public String getDefaultAction();
  public String getDescription();
  public boolean getChecked();
  public boolean getEnabled();
  public int getFlags();
  public boolean getFocus();
  public String getHelp();
  public boolean getHot();
  public int getID();
  public boolean getIndeterminate();
  public String getKeyboardShortcut();
  public String getName();
  public boolean getPressed();
  public int getRoleCode();
  public IUIRootContainer getRoot();
  public boolean getSelected();
  public int getStateCode();
  public String getValueText();

  public void setAccName(Variant varChild, String name);
  public void setAccValue(Variant varChild, String value);

  public void setChecked(boolean on);
  public void setEnabled(boolean on);
  public void setFlags(int flags);
  public void setFocus(boolean on);
  public void setHot(boolean on);
  public void setID(int id);
  public void setIndeterminate(boolean on);
  public void setName(String name);
  public void setPressed(boolean on);
  public void setSelected(boolean on);
  public void setValueText(String value);

}

A class that manages an extended Canvas object.


Methods


accDoDefaultAction

public void accDoDefaultAction(Variant varChild);

Performs the objects default action.

Return Value:

No return value.

ParameterDescription
varChild A Variant child.

Remarks:

This method is used as part of the Active Accessibility Java classes.


accHitTest

public Variant accHitTest(int xLeft, int yTop);

Retrieves a child object at a given point on the screen.

Return Value:

A Variant class.

ParameterDescription
xLeft The x coordinate of the screen point to be hit tested.
yTop the y coordinate of the screen point to be hit tested.

Remarks:

This method is used as part of the Active Accessibility Java classes.


accLocation

public void accLocation(int[] pxLeft, int[] pyTop, int[] pcxWidth, int[] pcyHeight, Variant varChild);

Retrieves an Active Accessiblity object's screen location, and its child element.

Return Value:

No return value.

ParameterDescription
pxLeft The x coordinate of the object's screen location.
pyTop The y coordinate of the object's screen location.
pcxWidth The width, in pixels, of the object.
pcyHeight The height, in pixels, of the object.
varChild The Variant child contained within the object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


accNavigate

public Variant accNavigate(int navDir, Variant varStartFromChildOrSelf);

Retrieves the object navigated to with the given direction.

Return Value:

Returns the Variant object navigated to.

ParameterDescription
navDir The navigation code.
varStartFromChildOrSelf The Variant object navigated from.

Remarks:

This method is used as part of the Active Accessibility Java classes.


accSelect

public void accSelect(int flagsSelect, Variant varChild);

Changes focus and selection according to the selection flags.

Return Value:

No return value.

ParameterDescription
flagsSelect The selection flags.
varChild

Remarks:

This method is used as part of the Active Accessibility Java classes.


addNotify

public void addNotify();

Monitors calls to addNotify to call initGraphics on the first call.

Return Value:

No return value.


doDefaultAction

public void doDefaultAction();

Performs the default action for the object.

Return Value:

No return value.

Remarks:

The default implementation does nothing.


ensureVisible

public boolean ensureVisible(Rectangle rect);

Forwards a visible request up to parent.

Return Value:

Returns true if any window has moved or been resized to make that rectangle visible; otherwise, returns false if the rectangle was already visible.

Return Value:

No return value.

ParameterDescription
rect Rectangle whose visibility is to be ensured in its container.


fullValidate

public void fullValidate();

Performs a validation from the object where the invalidate propagation stopped.

Return Value:

No return value.


getAccChild

public Object getAccChild(Variant varChild);

Retrieves the child at the specified one-based index.

Return Value:

Returns the requested child object.

ParameterDescription
varChild The Variant that contains the index.

Remarks:

This method is used as part of the Active Accessibility Java classes. It is currently not implemented and throws a ComFailException.


getAccChildCount

public int getAccChildCount();

Retrieves the number of components in the parent container.

Return Value:

Returns the number of components in the parent container.


getAccDefaultAction

public String getAccDefaultAction(Variant varChild);

Performs the default action for the varChild object.

Return Value:

Returns a string describing the default action of the varChild object.

ParameterDescription
varChild The specifiedVariant child object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccDescription

public String getAccDescription(Variant varChild);

Retrieves a description of the object beyond what is provided in getAccRole, getAccState, and getAccName.

Return Value:

Returns a description of the current object.

ParameterDescription
varChild The currently selected object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccFocus

public Variant getAccFocus();

Retrieves the child object of which currently has focus within its container, or retrieves the container object itself.

Return Value:

Returns a Variant object which currently has focus.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccFocus

public Variant getAccFocus();

Retrieves the child object of which currently has focus within its container, or retrieves the container object itself.

Return Value:

Returns a Variant object which currently has focus.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccHelp

public String getAccHelp(Variant varChild);

Provides help text for the object.

Return Value:

Returns a string describing the object's function beyond information provided by getAccRole, getAccState, and getAccName.

ParameterDescription
varChild The selected Variant object for which help text is requested.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccHelpTopic

public int getAccHelpTopic(String[] helpFile, Variant varChild);

This method is not currently implemented.

Return Value:

Currently throws a ComFailException error.

ParameterDescription
helpFile A topic contained in a help file list.
varChild The Variant object for which help was requested.

Remarks:

This method is used as part of the Active Accessibility Java classes. It is currently not implemented.


getAccKeyboardShortcut

public String getAccKeyboardShortcut(Variant varChild);

Retrieves the keyboard shortcut to select the desired object.

Return Value:

Returns a string describing a sequence of keystrokes. Throws a ComFailException error if the specified varChild is invalid.

ParameterDescription
varChild The selected Variant object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccName

public String getAccName(Variant varChild);

Retrieves the object's displayed name.

Return Value:

Returns the string displayed as the object's name.

ParameterDescription
varChild The specified child object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccParent

public Object getAccParent();

Retrieves the parent object or container of the child object.

Return Value:

Returns the parent object of the current object.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccRole

public Variant getAccRole(Variant varChild);

Retrieves the role of the specified object.

Return Value:

Returns a Variant with the role code of the specified varChild.

ParameterDescription
varChild The Variant object for which the role code is requested.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccSelection

public Variant getAccSelection();

Return Value:

Returns a new Variant.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccState

public Variant getAccState(Variant varChild);

Retrieves the state code of the specified Variant object.

Return Value:

Returns a Variant describing the state of the currently selected object.

ParameterDescription
varChild The object for which the state code is requested.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getAccValue

public String getAccValue(Variant varChild);

Provides edit field value text for the object.

Return Value:

Returns the contents of an object's edit field.

ParameterDescription
varChild The object for which the value text is requested.

Remarks:

This method is used as part of the Active Accessibility Java classes.


getBounds

public Rectangle getBounds(Component comp);

Get the bounding rectangle of this component, in coordinates relative to the given component

Return Value:

Returns the bounding rectangle of this component.

ParameterDescription
comp The realtive reference for the bounding rectangle.


getChecked

public boolean getChecked();

Gets the current checked state of this object.

Return Value:

Returns true if this object is checked; otherwise, returns false.


getDefaultAction

public String getDefaultAction();

Retrieve the default action for the object.

Return Value:

Returns a string describing this object's default action (e.g. "Press" for a button).


getDescription

public String getDescription();

Retrieve the description for the object.

Return Value:

Returns a string describing this object beyond what information is already provided by getRoleCode, getStateCode, and getName.


getEnabled

public boolean getEnabled();

Retrieves the enabled status of this object.

Return Value:

Returns true if the object and all of its ancestors are enabled; otherwise, returns false.


getFlags

public int getFlags();

Gets the current owner-defined state bits set for this object.

Return Value:

Returns the current state bit settings.


getFocus

public boolean getFocus();

Gets the current focus state of this object.

Return Value:

Returns true if this object has focus; otherwise, returns false.


getHelp

public String getHelp();

Retrieves the help text for this object.

Return Value:

Returns a string describing this object's function beyond what information is provided by getRoleCode, getStateCode, and getName.

Remarks:

This is used to display a ToolTip for the object when it is tracked.


getHot

public boolean getHot();

Gets the current hot-tracked state of this object.

Return Value:

Returns true if this object is hot-tracked; otherwise, returns false.


getID

public int getID();

Retrieves the object's identification.

Return Value:

Returns the identification value associated with the object.


getIndeterminate

public boolean getIndeterminate();

Gets the current indeterminate state of this object.

Return Value:

Returns true if this object is indeterminate; otherwise, returns false.


getKeyboardShortcut

public String getKeyboardShortcut();

Get the keyboard shortcut for this object.

Return Value:

Returns a string describing the sequence of keystrokes needed to transfer input focus from the currently focused object to this object.


getName

public String getName()

Retrieves the object's displayed name.

Return Value:

Returns the string displayed as the object's name.


getPressed

public boolean getPressed();

Gets the current pressed state of this object.

Return Value:

Returns true if this object is pressed; otherwise, returns false.


getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of this object.

Return Value:

Returns zero.


getRoot

 public IUIRootContainer getRoot();

Retrieves the first component, starting from this component and moving up the parent chain, that implements the IUIRootContainer interface.

Return Value:

Returns the root container.

Remarks:

If a root container is not found, this method returns the global UIFrame object from UIFrame.getFrame.


getSelected

public boolean getSelected();

Gets the current selected state of this object.

Return Value:

Returns true if this object is selected; otherwise, returns false.


getStateCode

public int getStateCode();

Determines the current state of the object.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describes the state of the object.

Remarks:

This returned code always contains the flags STATE_SYSTEM_SIZEABLE and STATE_SYSTEM_MOVEABLE. Depending on the current state of the object, the code may also contain one or more of the following flags.


getValueText

public String getValueText();

Retrieve the help text for this object.

Return Value:

Returns a string describing this object's function beyond what information is provided by getRoleCode, getStateCode, and getName.


gotFocus

public boolean gotFocus(Event e, Object o);

Reacts to receiving focus by setting the focus state of this object.

Return Value:

Returns the result of calling the superclass's gotFocus method.

ParameterDescription
e The event that caused the action.
o The action (typically set to null).


initGraphics

public void initGraphics();

Initializes graphics when a graphics context is initially made available.

Return Value:

No return value.

Remarks:

This method is used instead of the constructor to do an initialization that requires the graphics context. It has no implementation by itself; subclasses should override this method for graphics-dependent initialization code.


isEnabled

public boolean isEnabled()

Determines whether the object is enabled.

Return Value:

Returns true if this object and all of its ancestors are enabled; otherwise, returns false.


isKeyable

public boolean isKeyable();

Determines whether the object can receive keyboard input.

Return Value:

Returns true if the object can receive keyboard input; otherwise, returns false.


isSelectable

public boolean isSelectable();

Determines whether the object can be selected.

Return Value:

Returns true if the object can be selected; otherwise, returns false.


lostFocus

public boolean lostFocus(Event e, Object o);

Reacts to losing focus by clearing the focus state of this object.

Return Value:

Returns the result of calling the superclass's lostFocus method.

ParameterDescription
e The event that caused the action.
o The action (typically set to null).


mouseDown

public boolean mouseDown(Event e, int x, int y);

Reacts to the mouse button being pressed by setting the pressed state of this object.

Return Value:

Returns false.

ParameterDescription
e The event that caused the action.
x The x coordinate.
y The y coordinate.


mouseDrag

public boolean mouseDrag(Event e, int x, int y);

Reacts to the mouse being dragged outside the object or back inside the object by setting or clearing the pressed and hot-tracked states of this object accordingly.

Return Value:

Returns false.

ParameterDescription
e The event that caused the action.
x The x coordinate.
y The y coordinate.

Remarks:

If the mouse is dragged from inside to outside the object, the pressed and hot-track states are both cleared. If the mouse is dragged from outside to inside, the pressed and hot-track states are both set.


mouseEnter

public boolean mouseEnter(Event e, int x, int y);

Reacts to the mouse entering the object by setting the hot-tracked state of this object.

Return Value:

Returns false.

ParameterDescription
e The event that caused the action.
x The x coordinate.
y The y coordinate.


mouseExit

public boolean mouseExit(Event e, int x, int y);

Reacts to the mouse exiting the object by clearing the hot-tracked state of this object.

Return Value:

Returns false.

ParameterDescription
e The event that caused the action.
x The x coordinate.
y The y coordinate.


mouseUp

public boolean mouseUp(Event e, int x, int y);

Reacts to the mouse button being released by clearing the pressed state of this object.

Return Value:

Returns false.

ParameterDescription
e The event that caused the action.
x The x coordinate.
y The y coordinate.


navigate

public Component navigate(Component comp, int direction, boolean keyable);

Navigates to another component from the specified component in the given direction.

Return Value:

Returns null, indicating no component can be navigated to.

ParameterDescription
comp The component from which to navigate.
direction The direction to navigate. Specify one of the field values in IUIAccessible.
keyable If true, non-keyable components will be ignored during the navigation; otherwise, all components can be navigated to.

Remarks:

If an undefined direction is specified, an IllegalArgumentException is thrown.


setAccName

public void setAccName(Variant varChild, String name);

Sets the displayed name for the specified child object.

Return Value:

No return value.

ParameterDescription
varChild The named child object.
name A string set as the object's name.

Remarks:

This method is used as part of the Active Accessibility Java classes.


setAccValue

public void setAccValue(Variant varChild, String value);

Sets the value of an edit field for the specified object.

Return Value:

No return value.

ParameterDescription
varChild The object for which the value text is set.
value A value for the edit field.

Remarks:

This method is used as part of the Active Accessibility Java classes. Value may be also used for a scrollbar or grip position, or indentation level of a tree.


setChecked

public void setChecked(boolean on);

Set or clears the checked state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the checked state is set; otherwise, it is cleared.


setEnabled

public void setEnabled(boolean on);

Set or clears the enabled state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the enabled state is set; otherwise, it is cleared.


setFlags

public void setFlags(int flags);

Sets the current owner-defined state bits for this object.

Return Value:

No return value.

ParameterDescription
flags The new state bit settings.

Remarks:

Any bit in the mask 0xFFFF0000 can be set. An IllegalArgumentException is thrown if any bits outside this mask are specified.


setFocus

public void setFocus(boolean on);

Set or clears the focus state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the focus state is set; otherwise, it is cleared.


setHot

public void setHot(boolean on);

Set or clears the hot-tracked state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the hot-tracked state is set; otherwise, it is cleared.


setID

public void setID(int id);

Sets the object's identification.

Return Value:

No return value.

ParameterDescription
id Identification value to be associated with the object.


setIndeterminate

public void setIndeterminate(boolean on);

Set or clears the indeterminate state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the indeterminate state is set; otherwise, it is cleared.


setName

public void setName(String name);

Sets the name of the canvas object.

Return Value:

No return value.

ParameterDescription
name The name for the canvas object.


setPressed

public void setPressed(boolean on);

Set or clears the pressed state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the pressed state is set; otherwise, it is cleared.


setSelected

public void setSelected(boolean on);

Set or clears the selected state of the canvas object.

Return Value:

No return value.

ParameterDescription
on If true, the selected state is set; otherwise, it is cleared.


setValueText

public void setValueText(String value);

Sets the value text for the specified object.

Return Value:

No return value.

ParameterDescription
value A help description for the object

Remarks:

A string describing the visual information contained in this object, beyond what information is provided by getRoleCode, getStateCode and getName.


toString

public String toString();

Retrieves the description of the object.

Return Value:

Returns a String containing the class and object names.



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