SizeAgent"
From Documentation
Line 1: | Line 1: | ||
{{ZATSEssentialsPageHeader}} | {{ZATSEssentialsPageHeader}} | ||
− | |||
− | |||
Line 30: | Line 28: | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | == Resize == | ||
+ | |||
+ | <tt> SizeAgent </tt> can also mimic resizing a component by specifying '''width''' and '''height'''. As test case is running in a simulated environment, there is no screen rendering. It just changes target component's width and height. | ||
+ | |||
+ | <source lang="java"> | ||
+ | |||
+ | ComponentAgent window = desktopAgent.query("window"); | ||
+ | |||
+ | window.as(SizeAgent.class).resize(100, 100); | ||
+ | |||
+ | </source> | ||
+ | |||
Line 43: | Line 55: | ||
| | | | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{ZATSEssentialsPageFooter}} | {{ZATSEssentialsPageFooter}} |
Revision as of 03:16, 16 May 2012
Maximize and Minimize
With SizeAgent , we can mimic to maximize, minimize, and resize a window or a panel. There are two flags in a window (and a panel) to represent maximized and minimized state respectively. When they are both "false", it represents "original size". To maximize a component, you should set maximized to true and minimized to false. To minimize it, set maximized to false and minimized to true.
ComponentAgent window = desktopAgent.query("window");
//maximize
window.as(SizeAgent.class).maximize(true);
window.as(SizeAgent.class).minimize(false)
//restore to original size
window.as(SizeAgent.class).maximize(false);
window.as(SizeAgent.class).minimize(false)
//minimize
window.as(SizeAgent.class).maximize(false);
window.as(SizeAgent.class).minimize(true);
Resize
SizeAgent can also mimic resizing a component by specifying width and height. As test case is running in a simulated environment, there is no screen rendering. It just changes target component's width and height.
ComponentAgent window = desktopAgent.query("window");
window.as(SizeAgent.class).resize(100, 100);
Supported Components
Panel, Window | 5, 6 |