public class FlexDisplayObject extends TestObject implements IClickable, IKeyable
Modifier | Constructor and Description |
---|---|
protected |
FlexDisplayObject(JtfObjectHandle handle,
Desktop desktop)
Creates a new FlexDisplayObject with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
void |
click()
Clicks on the object.
|
void |
click(int button)
Clicks on the object.
|
void |
click(int button,
Point pos)
Clicks on the object.
|
void |
click(int button,
Point pos,
ModifierKey modifiers)
Clicks on the object.
|
void |
doubleClick()
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button)
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button,
Point pos)
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button,
Point pos,
ModifierKey modifiers)
Double-clicks a mouse button on the object.
|
double |
getAlpha()
Gets the alpha transparency value of the object specified.
|
double |
getHeight()
Gets the height of the display object, in pixels.
|
String |
getStyle(String name)
Returns the style value for the given style.
|
int |
getTabIndex()
Gets the tab ordering of objects in a SWF file.
|
double |
getWidth()
Gets the width of the display object, in pixels.
|
double |
getX()
Gets the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
|
double |
getY()
Gets the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
|
boolean |
isMouseEnabled()
Gets whether this object receives mouse messages.
|
boolean |
isTabChildren()
Gets whether the children of the display object are tab enabled.
|
boolean |
isTabEnabled()
Gets whether this object is in the tab order.
|
boolean |
isVisible()
Gets whether the display object is visible.
|
void |
mouseMove()
Moves the pointer to the specified location in the object.
|
void |
mouseMove(Point pos)
Moves the pointer to the specified location in the object.
|
String |
nativeToString()
Returns a string representation of the control.
|
void |
pressKeys(String keys)
Presses (but does not release) a set of keys or mouse buttons.
|
void |
pressKeys(String keys,
boolean ensureFocus)
Presses (but does not release) a set of keys or mouse buttons.
|
void |
pressMouse()
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button)
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button,
Point pos)
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button,
Point pos,
ModifierKey modifiers)
Presses (but does not release) a mouse button in the object.
|
void |
releaseKeys(String keys)
Releases a set of keys or mouse buttons.
|
void |
releaseKeys(String keys,
boolean ensureFocus)
Releases a set of keys or mouse buttons.
|
void |
releaseMouse()
Releases a mouse button.
|
void |
releaseMouse(int button)
Releases a mouse button.
|
void |
releaseMouse(int button,
Point pos)
Releases a mouse button.
|
void |
releaseMouse(int button,
Point pos,
ModifierKey modifiers)
Releases a mouse button.
|
void |
typeKeys(String keys)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
Sends a set of keystrokes to the object.
|
void |
typePasswordKeys(String keys)
Types an encrypted password into an object, for example a text field.
|
void |
typePasswordKeys(String keys,
int delay)
Types an encrypted password into an object, for example a text field.
|
void |
typePasswordKeys(String keys,
int delay,
boolean ensureFocus)
Types an encrypted password into an object, for example a text field.
|
captureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getText, getValue, highlightObject, highlightObject, highlightObject, invokeMethods, textCapture, textCapture, textClick, textClick, textClick, textClick, textClick, textClick, textExists, textExists, textExists, textExists, textExists, textRectangle, textRectangle, textRectangle, textRectangle, textRectangle, waitForChildDisappearance, waitForChildDisappearance, waitForDisappearance, waitForDisappearance, waitForObject, waitForObject, waitForProperty, waitForProperty
equals, exists, find, find, findAll, findAll, getCustomTypeName, getDesktop, getHandle, getLocator, getProperty, getTypeName, hashCode, imageClick, imageClick, imageClick, imageClick, imageClick, imageClick, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageExists, imageExists, imageExists, imageExistsFile, imageExistsFile, imageExistsFile, imageRectangle, imageRectangle, imageRectangle, imageRectangleFile, imageRectangleFile, imageRectangleFile, invoke, preventFinalLocator, setProperty, toString
protected FlexDisplayObject(JtfObjectHandle handle, Desktop desktop)
handle
- the handle that identifies the FlexDisplayObjectdesktop
- the desktop on which this object livespublic void click()
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
public void click(int button)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void click(int button, Point pos)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickpublic void click(int button, Point pos, ModifierKey modifiers)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickmodifiers
- the modifierpublic void doubleClick()
doubleClick
in interface IClickable
public void doubleClick(int button)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void doubleClick(int button, Point pos)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickpublic void doubleClick(int button, Point pos, ModifierKey modifiers)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickmodifiers
- the modifierpublic String getStyle(String name)
name
- the name of the stylepublic void mouseMove()
mouseMove
in interface IClickable
public void mouseMove(Point pos)
mouseMove
in interface IClickable
pos
- the coordinates (relative to the window) of the new locationpublic void pressKeys(String keys)
Valid keystrokes include:
public void pressKeys(String keys, boolean ensureFocus)
Valid keystrokes include:
public void pressMouse()
pressMouse
in interface IClickable
public void pressMouse(int button)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void pressMouse(int button, Point pos)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to press the mousepublic void pressMouse(int button, Point pos, ModifierKey modifiers)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to press the mousemodifiers
- the modifierpublic void releaseKeys(String keys)
Valid keystrokes include:
releaseKeys
in interface IKeyable
keys
- the keys or mouse buttons to releasepublic void releaseKeys(String keys, boolean ensureFocus)
Valid keystrokes include:
releaseKeys
in interface IKeyable
keys
- the keys or mouse buttons to releaseensureFocus
- determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true
public void releaseMouse()
releaseMouse
in interface IClickable
public void releaseMouse(int button)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void releaseMouse(int button, Point pos)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to release the mousepublic void releaseMouse(int button, Point pos, ModifierKey modifiers)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to release the mousemodifiers
- the modifierpublic String nativeToString()
public void typeKeys(String keys)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay, boolean ensureFocus)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typePasswordKeys(String keys)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passwordpublic void typePasswordKeys(String keys, int delay)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passworddelay
- the delay between keystrokes in millisecondspublic void typePasswordKeys(String keys, int delay, boolean ensureFocus)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passworddelay
- the delay between keystrokes in millisecondsensureFocus
- determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true
public double getAlpha()
Valid values are 0 (fully transparent) to 1 (fully opaque). The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible.
public double getHeight()
The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly.
public boolean isMouseEnabled()
No event is dispatched by setting this property. You must use the addEventListener
method to create interactive functionality.
public boolean isTabChildren()
public boolean isTabEnabled()
If this object is in the tab order, the value is true
; otherwise, the value is false
. By default, the value is false
, except for the following: a SimpleButton
object, a TextField
object with type = input
, or a Sprite
object or MovieClip
object with buttonMode = true
.
public int getTabIndex()
The tabIndex property is -1 by default, meaning no tab index is set for the object.
If any currently displayed object in the SWF file contains a tabIndex property, automatic tab ordering is disabled, and the tab ordering is calculated from the tabIndex properties of objects in the SWF file. The custom tab ordering includes only objects that have tabIndex properties.
The tabIndex property can be a non-negative integer. The objects are ordered according to their tabIndex properties, in ascending order. An object with a tabIndex value of 1 precedes an object with a tabIndex value of 2. Do not use the same tabIndex value for multiple objects.
The custom tab ordering that the tabIndex property defines is flat. This means that no attention is paid to the hierarchical relationships of objects in the SWF file. All objects in the SWF file with tabIndex properties are placed in the tab order, and the tab order is determined by the order of the tabIndex values.
public boolean isVisible()
Display objects that are not visible are disabled. For example, if visible=false for an InteractiveObject instance, it cannot be clicked.
public double getWidth()
The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly.
public double getX()
If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90 degrees counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90 degrees counterclockwise. The object's coordinates refer to the registration point position.
public double getY()
If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90 degrees counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90 degrees counterclockwise. The object's coordinates refer to the registration point position.
Copyright 2009-2012 Micro Focus. All Rights Reserved.