SizeAgent"

From Documentation
(Created page with "{{ZATSEssentialsPageHeader}} With <tt> SizeAgent </tt>, we can mimic maximize, minimize, and resize a ''window'' or a ''panel''. There are two flags in a ''window'' (or a ''pa...")
 
m (correct highlight (via JWB))
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
  
With <tt> SizeAgent </tt>, we can mimic maximize, minimize, and resize a ''window'' or a ''panel''. There are two flags in a ''window'' (or a ''panel'') to represent maximized and minimized state respectively. When they are both "false", it represents "original size"
+
__TOC__
 +
 
 +
 
 +
== Maximize and Minimize ==
 +
 
 +
With <code> SizeAgent </code>, 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'''.
  
  
Line 12: Line 17:
 
//maximize
 
//maximize
 
window.as(SizeAgent.class).maximize(true);
 
window.as(SizeAgent.class).maximize(true);
 +
window.as(SizeAgent.class).minimize(false)
  
 
//restore to original size
 
//restore to original size
 
window.as(SizeAgent.class).maximize(false);
 
window.as(SizeAgent.class).maximize(false);
 +
window.as(SizeAgent.class).minimize(false)
  
 
//minimize
 
//minimize
 +
window.as(SizeAgent.class).maximize(false);
 
window.as(SizeAgent.class).minimize(true);
 
window.as(SizeAgent.class).minimize(true);
  
//restore to original size
+
</source>
window.as(SizeAgent.class).minimize(false);
+
 
 +
 
 +
== Resize ==
 +
 
 +
<code> SizeAgent </code> can also mimic resizing a component by specifying '''width''' and '''height'''. As test case runs in a simulated environment, there is no screen rendering involved, it simply changes target component's width and height.,
 +
 
 +
<source lang="java">
 +
 
 +
ComponentAgent window = desktopAgent.query("window");
 +
 
 +
window.as(SizeAgent.class).resize(100, 100);
  
 
</source>
 
</source>
  
 +
=Supported Components=
 +
 +
{| border="1" | width="100%"
 +
! <center>Components</center>
 +
! <center>Version</center>
 +
! <center>Note</center>
 +
|-
 +
| Panel, Window
 +
| 5, 6
 +
|
 +
|}
  
  
  
 +
{{ZATSEssentialsPageHeader}}
 
{{ZATSEssentialsPageFooter}}
 
{{ZATSEssentialsPageFooter}}

Latest revision as of 02:56, 18 January 2022




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 runs in a simulated environment, there is no screen rendering involved, it simply changes target component's width and height.,

ComponentAgent window = desktopAgent.query("window");

window.as(SizeAgent.class).resize(100, 100);

Supported Components

Components
Version
Note
Panel, Window 5, 6





Last Update : 2022/01/18

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.