public class FlexDisplayObject extends TestObject implements IClickable, IKeyable
Modifier | Constructor and Description |
---|---|
protected |
FlexDisplayObject(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 FlexDisplayObject。
|
Modifier and Type | Method and Description |
---|---|
void |
click()
单击对象。
|
void |
click(int button)
单击对象。
|
void |
click(int button,
Point pos)
单击对象。
|
void |
click(int button,
Point pos,
ModifierKey modifiers)
单击对象。
|
void |
doubleClick()
双击对象上的鼠标按钮。
|
void |
doubleClick(int button)
双击对象上的鼠标按钮。
|
void |
doubleClick(int button,
Point pos)
双击对象上的鼠标按钮。
|
void |
doubleClick(int button,
Point pos,
ModifierKey modifiers)
双击对象上的鼠标按钮。
|
double |
getAlpha()
获取 指定对象的阿尔法透明度值。
|
double |
getHeight()
获取 显示对象的高度(像素)。
|
String |
getStyle(String name)
返回指定样式的样式值。
|
int |
getTabIndex()
获取 SWF 文件中对象的选项卡排序。
|
double |
getWidth()
获取 显示对象的宽度(像素)。
|
double |
getX()
获取 DisplayObject 实例的 x 坐标与父级 DisplayObjectContainer 的局部坐标相对应。
|
double |
getY()
获取 DisplayObject 实例的 y 坐标与父级 DisplayObjectContainer 的局部坐标相对应。
|
boolean |
isMouseEnabled()
获取 此对象是否接收到鼠标消息。
|
boolean |
isTabChildren()
获取 显示对象的子级是否已启用选项卡。
|
boolean |
isTabEnabled()
获取 此对象是否按选项卡顺序排列。
|
boolean |
isVisible()
获取 显示对象是否可见。
|
void |
mouseMove()
将指针移至对象中的指定位置。
|
void |
mouseMove(Point pos)
将指针移至对象中的指定位置。
|
String |
nativeToString()
返回控件的字符串表示形式。
|
void |
pressKeys(String keys)
按住(不松开)一组键或鼠标按钮。
|
void |
pressKeys(String keys,
boolean ensureFocus)
按住(不松开)一组键或鼠标按钮。
|
void |
pressMouse()
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button)
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button,
Point pos)
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button,
Point pos,
ModifierKey modifiers)
按住(不松开)对象上的鼠标按钮。
|
void |
releaseKeys(String keys)
松开一组键或鼠标按钮。
|
void |
releaseKeys(String keys,
boolean ensureFocus)
松开一组键或鼠标按钮。
|
void |
releaseMouse()
松开鼠标按钮。
|
void |
releaseMouse(int button)
松开鼠标按钮。
|
void |
releaseMouse(int button,
Point pos)
松开鼠标按钮。
|
void |
releaseMouse(int button,
Point pos,
ModifierKey modifiers)
松开鼠标按钮。
|
void |
typeKeys(String keys)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
发送一组按键至对象。
|
void |
typePasswordKeys(String keys)
将加密的密码输入对象,例如文本字段。
|
void |
typePasswordKeys(String keys,
int delay)
将加密的密码输入对象,例如文本字段。
|
void |
typePasswordKeys(String keys,
int delay,
boolean ensureFocus)
将加密的密码输入对象,例如文本字段。
|
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
- 可确定 FlexDisplayObject 的句柄desktop
- 此对象所在的桌面public void click()
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
public void click(int button)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void click(int button, Point pos)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击public void click(int button, Point pos, ModifierKey modifiers)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击modifiers
- 修饰符public void doubleClick()
doubleClick
in interface IClickable
public void doubleClick(int button)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void doubleClick(int button, Point pos)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击public void doubleClick(int button, Point pos, ModifierKey modifiers)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击modifiers
- 修饰符public String getStyle(String name)
name
- 样式的名称public void mouseMove()
mouseMove
in interface IClickable
public void mouseMove(Point pos)
mouseMove
in interface IClickable
pos
- 新位置坐标(相对于窗口)public void pressKeys(String keys)
有效按键包括:
public void pressKeys(String keys, boolean ensureFocus)
有效按键包括:
public void pressMouse()
pressMouse
in interface IClickable
public void pressMouse(int button)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void pressMouse(int button, Point pos)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此点按鼠标public void pressMouse(int button, Point pos, ModifierKey modifiers)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此点按鼠标modifiers
- 修饰符public void releaseKeys(String keys)
有效按键包括:
releaseKeys
in interface IKeyable
keys
- 可松开的键或鼠标按钮public void releaseKeys(String keys, boolean ensureFocus)
有效按键包括:
releaseKeys
in interface IKeyable
keys
- 可松开的键或鼠标按钮ensureFocus
- 确定控件是否一定具有按键焦点。默认为 true
public void releaseMouse()
releaseMouse
in interface IClickable
public void releaseMouse(int button)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void releaseMouse(int button, Point pos)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此松开鼠标public void releaseMouse(int button, Point pos, ModifierKey modifiers)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此松开鼠标modifiers
- 修饰符public String nativeToString()
public void typeKeys(String keys)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay, boolean ensureFocus)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typePasswordKeys(String keys)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码public void typePasswordKeys(String keys, int delay)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码delay
- 按键之间延迟时间(毫秒)public void typePasswordKeys(String keys, int delay, boolean ensureFocus)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码delay
- 按键之间延迟时间(毫秒)ensureFocus
- 确定控件是否一定具有按键焦点。默认为 true
public double getAlpha()
有效值为 0(完全透明)至 1(完全不透明)。默认值为 1。阿尔法值设置为 0 的显示对象仍处于活动状态,即使它们不可见。
public double getHeight()
基于显示对象内容的限制计算高度。当您设置高度属性时,scaleY 属性也会相应调整。
public boolean isMouseEnabled()
设置此属性不会发送任何事件。您必须使用 addEventListener
方法创建交互功能。
public boolean isTabChildren()
public boolean isTabEnabled()
如果此对象按选项卡顺序排列,则值为 true
;否则值为 false
。默认情况下,值为 false
,但以下情况除外:SimpleButton
对象、具有 type = input
的 TextField
对象、Sprite
对象或具有 buttonMode = true
的 MovieClip
对象。
public int getTabIndex()
默认情况下,tabIndex 属性为 -1,意味着未为对象设置任何选项卡索引。
如果当前在 SWF 文件中显示的对象包含 tabIndex 属性,则禁止使用自动化选项卡排序,选项卡排序从 SWF 文件中对象的 tabIndex 属性计算得出。自定义选项卡排序只包括具有 tabIndex 属性的对象。
TabIndex 属性可以是非负整数。对象根据 tabIndex 属性以升序排序。具有 tabIndex 值 1 的对象在具有 tabIndex 值 2 的对象之前。不要对多个对象使用相同 tabIndex 值。
TabIndex 属性定义的自定义选项卡排序毫无层次。这意味着未关注 SWF 文件中对象的层次关系。SWF 文件中具有 tabIndex 属性的所有对象均以选项卡顺序排列,选项卡顺序由 tabIndex 值顺序决定。
public boolean isVisible()
禁止使用不可见的显示对象。例如,如果 InteractiveObject 实例设置为 visible=false,则无法单击此实例。
public double getWidth()
基于显示对象内容的限制计算宽度。当您设置宽度属性时,scaleX 属性也会相应调整。
public double getX()
如果对象在具有转换的 DisplayObjectContainer 内,则它在封闭 DisplayObjectContainer 的局部坐标系上。因此,如果 DisplayObjectContainer 逆时针旋转了 90 度,则 DisplayObjectContainer 的子级将继承被逆时针旋转了 90 度的坐标系。对象坐标参考套准点位置。
public double getY()
如果对象在具有转换的 DisplayObjectContainer 内,则它在封闭 DisplayObjectContainer 的局部坐标系上。因此,如果 DisplayObjectContainer 逆时针旋转了 90 度,则 DisplayObjectContainer 的子级将继承被逆时针旋转了 90 度的坐标系。对象坐标参考套准点位置。
Copyright 2009-2012 Micro Focus. All Rights Reserved.